Last active
August 11, 2017 21:51
-
-
Save jryans/034936f42b1bd51e96a0cb6d19ab2338 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/layout/style/ServoBindingList.h b/layout/style/ServoBindingList.h | |
index 8e424f8..7ab43fa 100644 | |
--- a/layout/style/ServoBindingList.h | |
+++ b/layout/style/ServoBindingList.h | |
@@ -39,17 +39,17 @@ SERVO_BINDING_FUNC(Servo_StyleSheet_HasRules, bool, | |
SERVO_BINDING_FUNC(Servo_StyleSheet_GetRules, ServoCssRulesStrong, | |
RawServoStyleSheetContentsBorrowed sheet) | |
SERVO_BINDING_FUNC(Servo_StyleSheet_Clone, RawServoStyleSheetContentsStrong, | |
RawServoStyleSheetContentsBorrowed sheet, | |
const mozilla::ServoStyleSheet* reference_sheet); | |
SERVO_BINDING_FUNC(Servo_StyleSheet_SizeOfIncludingThis, size_t, | |
mozilla::MallocSizeOf malloc_size_of, | |
RawServoStyleSheetContentsBorrowed sheet) | |
-SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSetOwned, RawGeckoPresContextOwned pres_context) | |
+SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSet*, RawGeckoPresContextOwned pres_context) | |
SERVO_BINDING_FUNC(Servo_StyleSet_Clear, void, | |
RawServoStyleSetBorrowed set) | |
SERVO_BINDING_FUNC(Servo_StyleSet_RebuildCachedData, void, | |
RawServoStyleSetBorrowed set) | |
SERVO_BINDING_FUNC(Servo_StyleSet_MediumFeaturesChanged, bool, | |
RawServoStyleSetBorrowed set, bool* viewport_units_used) | |
SERVO_BINDING_FUNC(Servo_StyleSet_Drop, void, RawServoStyleSetOwned set) | |
SERVO_BINDING_FUNC(Servo_StyleSet_CompatModeChanged, void, | |
diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs | |
index 1fa8516..9e715c9 100644 | |
--- a/servo/ports/geckolib/glue.rs | |
+++ b/servo/ports/geckolib/glue.rs | |
@@ -56,16 +56,17 @@ use style::gecko_bindings::bindings::RawGeckoFontFaceRuleListBorrowedMut; | |
use style::gecko_bindings::bindings::RawGeckoServoAnimationValueListBorrowed; | |
use style::gecko_bindings::bindings::RawGeckoServoAnimationValueListBorrowedMut; | |
use style::gecko_bindings::bindings::RawGeckoServoStyleRuleListBorrowedMut; | |
use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed; | |
use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowedMut; | |
use style::gecko_bindings::bindings::RawServoAnimationValueStrong; | |
use style::gecko_bindings::bindings::RawServoAnimationValueTableBorrowed; | |
use style::gecko_bindings::bindings::RawServoStyleRuleBorrowed; | |
+use style::gecko_bindings::bindings::RawServoStyleSet; | |
use style::gecko_bindings::bindings::ServoStyleContextBorrowedOrNull; | |
use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t; | |
use style::gecko_bindings::bindings::nsTimingFunctionBorrowed; | |
use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut; | |
use style::gecko_bindings::structs; | |
use style::gecko_bindings::structs::{CSSPseudoElementType, CompositeOperation, Loader}; | |
use style::gecko_bindings::structs::{RawServoStyleRule, ServoStyleContextStrong}; | |
use style::gecko_bindings::structs::{ServoStyleSheet, SheetParsingMode, nsIAtom, nsCSSPropertyID}; | |
@@ -81,17 +82,17 @@ use style::gecko_bindings::structs::ServoTraversalFlags; | |
use style::gecko_bindings::structs::StyleRuleInclusion; | |
use style::gecko_bindings::structs::URLExtraData; | |
use style::gecko_bindings::structs::nsCSSValueSharedList; | |
use style::gecko_bindings::structs::nsCompatibility; | |
use style::gecko_bindings::structs::nsIDocument; | |
use style::gecko_bindings::structs::nsStyleTransformMatrix::MatrixTransformOperator; | |
use style::gecko_bindings::structs::nsTArray; | |
use style::gecko_bindings::structs::nsresult; | |
-use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI}; | |
+use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI}; | |
use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong}; | |
use style::gecko_bindings::sugar::refptr::RefPtr; | |
use style::gecko_properties::style_structs; | |
use style::invalidation::element::restyle_hints; | |
use style::media_queries::{MediaList, parse_media_query_list}; | |
use style::parallel; | |
use style::parser::{ParserContext, self}; | |
use style::properties::{CascadeFlags, ComputedValues, Importance}; | |
@@ -1839,19 +1840,19 @@ pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(values: ServoStyleContex | |
} | |
} | |
/// See the comment in `Device` to see why it's ok to pass an owned reference to | |
/// the pres context (hint: the context outlives the StyleSet, that holds the | |
/// device alive). | |
#[no_mangle] | |
pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned) | |
- -> RawServoStyleSetOwned { | |
+ -> *mut RawServoStyleSet { | |
let data = Box::new(PerDocumentStyleData::new(pres_context)); | |
- data.into_ffi() | |
+ Box::into_raw(data) as *mut RawServoStyleSet | |
} | |
#[no_mangle] | |
pub extern "C" fn Servo_StyleSet_RebuildCachedData(raw_data: RawServoStyleSetBorrowed) { | |
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); | |
data.stylist.device_mut().rebuild_cached_data(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment