servo: Merge #14460 - stylo: Use master bindgen again (from emilio:stylo-bindgenup); r=heycam

<!-- Please describe your changes on the following line: -->

To be fair, this is master bindgen with https://github.com/servo/rust-bindgen/pull/318.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6c3e94805f74e78b091b37fe374af12ad2249528
This commit is contained in:
Emilio Cobos Álvarez 2016-12-05 03:52:16 -08:00
Родитель d63ff4d088
Коммит 89cb8d3586
7 изменённых файлов: 5932 добавлений и 5473 удалений

Просмотреть файл

@ -23,6 +23,7 @@ COMPILATION_TARGETS = {
COMMON_BUILD_KEY: { COMMON_BUILD_KEY: {
"flags": [ "flags": [
"--no-unstable-rust", "--no-unstable-rust",
"--disable-name-namespacing",
], ],
"clang_flags": [ "clang_flags": [
"-x", "c++", "-std=c++14", "-x", "c++", "-std=c++14",
@ -42,8 +43,7 @@ COMPILATION_TARGETS = {
"structs": { "structs": {
"target_dir": "../gecko_bindings", "target_dir": "../gecko_bindings",
"flags": [ "flags": [
"--ignore-functions", "--generate", "types,vars",
"--ignore-methods",
], ],
"includes": [ "includes": [
"{}/dist/include/gfxFontConstants.h", "{}/dist/include/gfxFontConstants.h",
@ -51,6 +51,7 @@ COMPILATION_TARGETS = {
"{}/dist/include/mozilla/dom/AnimationEffectReadOnlyBinding.h", "{}/dist/include/mozilla/dom/AnimationEffectReadOnlyBinding.h",
"{}/dist/include/mozilla/ServoElementSnapshot.h", "{}/dist/include/mozilla/ServoElementSnapshot.h",
"{}/dist/include/mozilla/dom/Element.h", "{}/dist/include/mozilla/dom/Element.h",
"{}/dist/include/mozilla/ServoBindings.h",
], ],
"files": [ "files": [
"{}/dist/include/nsStyleStruct.h", "{}/dist/include/nsStyleStruct.h",
@ -70,7 +71,9 @@ COMPILATION_TARGETS = {
"use data::ElementData;", "use data::ElementData;",
"pub use nsstring::nsStringRepr as nsString;" "pub use nsstring::nsStringRepr as nsString;"
], ],
"blacklist_types": ["nsString"], "blacklist_types": [
"nsString",
],
"whitelist_vars": [ "whitelist_vars": [
"NS_THEME_.*", "NS_THEME_.*",
"NODE_.*", "NODE_.*",
@ -82,6 +85,13 @@ COMPILATION_TARGETS = {
"BORDER_STYLE_.*" "BORDER_STYLE_.*"
], ],
"whitelist": [ "whitelist": [
"RawGecko.*",
"mozilla_ServoElementSnapshot.*",
"mozilla_ConsumeStyleBehavior",
"mozilla_LazyComputeBehavior",
"mozilla_css_SheetParsingMode",
"mozilla_SkipRootBehavior",
".*ThreadSafe.*Holder",
"AnonymousContent", "AnonymousContent",
"AudioContext", "AudioContext",
"CapturingContentInfo", "CapturingContentInfo",
@ -103,8 +113,8 @@ COMPILATION_TARGETS = {
"nsAttrName", "nsAttrName",
"nsAttrValue", "nsAttrValue",
"nsBorderColors", "nsBorderColors",
"nsChangeHint",
"nscolor", "nscolor",
"nsChangeHint",
"nsCSSKeyword", "nsCSSKeyword",
"nsCSSPropertyID", "nsCSSPropertyID",
"nsCSSRect", "nsCSSRect",
@ -139,8 +149,6 @@ COMPILATION_TARGETS = {
"nsStyleContentData", "nsStyleContentData",
"nsStyleContext", "nsStyleContext",
"nsStyleCoord", "nsStyleCoord",
"nsStyleCoord",
"nsStyleCoord",
"nsStyleCounterData", "nsStyleCounterData",
"nsStyleDisplay", "nsStyleDisplay",
"nsStyleEffects", "nsStyleEffects",
@ -150,8 +158,6 @@ COMPILATION_TARGETS = {
"nsStyleGradientStop", "nsStyleGradientStop",
"nsStyleImage", "nsStyleImage",
"nsStyleImageLayers", "nsStyleImageLayers",
"nsStyleImageLayers_Layer",
"nsStyleImageLayers_LayerType",
"nsStyleList", "nsStyleList",
"nsStyleMargin", "nsStyleMargin",
"nsStyleOutline", "nsStyleOutline",
@ -178,11 +184,10 @@ COMPILATION_TARGETS = {
"ServoAttrSnapshot", "ServoAttrSnapshot",
"ServoElementSnapshot", "ServoElementSnapshot",
"SheetParsingMode", "SheetParsingMode",
"Side", "mozilla_Side",
"StaticRefPtr", "StaticRefPtr",
"StyleAnimation", "StyleAnimation",
"StyleBasicShape", "StyleBasicShape",
"StyleBasicShape",
"StyleBasicShapeType", "StyleBasicShapeType",
"StyleClipPath", "StyleClipPath",
"StyleClipPathGeometryBox", "StyleClipPathGeometryBox",
@ -196,13 +201,18 @@ COMPILATION_TARGETS = {
"nsAString_internal_incompatible_char_type", "nsAString_internal_incompatible_char_type",
"nsACString_internal_char_traits", "nsACString_internal_char_traits",
"nsACString_internal_incompatible_char_type", "nsACString_internal_incompatible_char_type",
"RefPtr_Proxy", "nsAutoPtr_Proxy", "Pair_Base", "RefPtr_Proxy",
"RefPtr_Proxy_member_function", "nsAutoPtr_Proxy_member_function", "RefPtr_Proxy_member_function",
"nsAutoPtr_Proxy",
"nsAutoPtr_Proxy_member_function",
"mozilla_detail_PointerType",
"mozilla_Pair_Base",
"mozilla_SupportsWeakPtr",
"SupportsWeakPtr",
"mozilla_detail_WeakReference",
"mozilla_WeakPtr",
"nsWritingIterator_reference", "nsReadingIterator_reference", "nsWritingIterator_reference", "nsReadingIterator_reference",
"Heap", "TenuredHeap", "Rooted", "WeakPtr", # <- More template magic than what
# we support.
"nsTObserverArray", # <- Inherits from nsAutoTObserverArray<T, 0> "nsTObserverArray", # <- Inherits from nsAutoTObserverArray<T, 0>
"PLArenaPool", # <- Bindgen bug
"nsTHashtable", # <- Inheriting from inner typedefs that clang "nsTHashtable", # <- Inheriting from inner typedefs that clang
# doesn't expose properly. # doesn't expose properly.
"nsRefPtrHashtable", "nsDataHashtable", "nsClassHashtable", # <- Ditto "nsRefPtrHashtable", "nsDataHashtable", "nsClassHashtable", # <- Ditto
@ -211,11 +221,9 @@ COMPILATION_TARGETS = {
# for clang. # for clang.
"nsPIDOMWindow", # <- Takes the vtable from a template parameter, and we can't "nsPIDOMWindow", # <- Takes the vtable from a template parameter, and we can't
# generate it conditionally. # generate it conditionally.
"SupportsWeakPtr", "JS_Rooted",
"Maybe", # <- AlignedStorage, which means templated union, which "mozilla_Maybe",
# means impossible to represent in stable rust as of "gfxSize", # <- union { struct { T width; T height; }; T components[2] };
# right now.
"gfxSize", # <- Same, union { struct { T width; T height; }; T components[2] };
"gfxSize_Super", # Ditto. "gfxSize_Super", # Ditto.
], ],
"servo_mapped_generic_types": [ "servo_mapped_generic_types": [
@ -237,17 +245,13 @@ COMPILATION_TARGETS = {
# Generation of the ffi bindings. # Generation of the ffi bindings.
"bindings": { "bindings": {
"target_dir": "../gecko_bindings", "target_dir": "../gecko_bindings",
"blacklist_types": [
"nsACString_internal",
"nsAString_internal",
],
"raw_lines": [ "raw_lines": [
"pub use nsstring::{nsACString, nsAString};", "pub use nsstring::{nsACString, nsAString};",
"type nsACString_internal = nsACString;", "type nsACString_internal = nsACString;",
"type nsAString_internal = nsAString;" "type nsAString_internal = nsAString;"
], ],
"flags": [ "flags": [
"--ignore-methods", "--generate", "functions",
], ],
"match_headers": [ "match_headers": [
"ServoBindingList.h", "ServoBindingList.h",
@ -258,19 +262,16 @@ COMPILATION_TARGETS = {
"files": [ "files": [
"{}/dist/include/mozilla/ServoBindings.h", "{}/dist/include/mozilla/ServoBindings.h",
], ],
"whitelist": [ # Types to just use from the `structs` target.
"structs_types": [
"RawGeckoDocument", "RawGeckoDocument",
"RawGeckoElement", "RawGeckoElement",
"RawGeckoNode", "RawGeckoNode",
"ThreadSafe.*Holder", "ThreadSafeURIHolder",
"ThreadSafePrincipalHolder",
"ConsumeStyleBehavior", "ConsumeStyleBehavior",
"LazyComputeBehavior", "LazyComputeBehavior",
"SkipRootBehavior", "SkipRootBehavior",
],
# Types to just use from the `structs` target.
"structs_types": [
"Element",
"FontFamilyList", "FontFamilyList",
"FontFamilyType", "FontFamilyType",
"ServoElementSnapshot", "ServoElementSnapshot",
@ -286,11 +287,6 @@ COMPILATION_TARGETS = {
"nsCursorImage", "nsCursorImage",
"nsFont", "nsFont",
"nsIAtom", "nsIAtom",
"nsIDocument",
"nsINode",
"nsIPrincipal",
"nsIURI",
"nsMainThreadPtrHolder",
"nsRestyleHint", "nsRestyleHint",
"nsStyleBackground", "nsStyleBackground",
"nsStyleBorder", "nsStyleBorder",
@ -614,7 +610,7 @@ Option<&'a mut {0}>;".format(ty))
if "servo_mapped_generic_types" in current_target: if "servo_mapped_generic_types" in current_target:
for ty in current_target["servo_mapped_generic_types"]: for ty in current_target["servo_mapped_generic_types"]:
flags.append("--blacklist-type") flags.append("--blacklist-type")
flags.append("{}".format(ty["gecko"])) flags.append("mozilla_{}".format(ty["gecko"]))
flags.append("--raw-line") flags.append("--raw-line")
flags.append("pub type {0}{2} = {1}{2};".format(ty["gecko"], ty["servo"], "<T>" if ty["generic"] else "")) flags.append("pub type {0}{2} = {1}{2};".format(ty["gecko"], ty["servo"], "<T>" if ty["generic"] else ""))

Просмотреть файл

@ -20,10 +20,10 @@ use gecko_bindings::bindings::{Gecko_GetServoDeclarationBlock, Gecko_IsHTMLEleme
use gecko_bindings::bindings::{Gecko_IsLink, Gecko_IsRootElement}; use gecko_bindings::bindings::{Gecko_IsLink, Gecko_IsRootElement};
use gecko_bindings::bindings::{Gecko_IsUnvisitedLink, Gecko_IsVisitedLink, Gecko_Namespace}; use gecko_bindings::bindings::{Gecko_IsUnvisitedLink, Gecko_IsVisitedLink, Gecko_Namespace};
use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags}; use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
use gecko_bindings::bindings::{RawGeckoElement, RawGeckoNode};
use gecko_bindings::bindings::Gecko_ClassOrClassList; use gecko_bindings::bindings::Gecko_ClassOrClassList;
use gecko_bindings::bindings::Gecko_GetStyleContext; use gecko_bindings::bindings::Gecko_GetStyleContext;
use gecko_bindings::structs; use gecko_bindings::structs;
use gecko_bindings::structs::{RawGeckoElement, RawGeckoNode};
use gecko_bindings::structs::{nsIAtom, nsIContent, nsStyleContext}; use gecko_bindings::structs::{nsIAtom, nsIContent, nsStyleContext};
use gecko_bindings::structs::NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO; use gecko_bindings::structs::NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO;
use gecko_bindings::structs::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; use gecko_bindings::structs::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE;

Просмотреть файл

@ -63,7 +63,14 @@ pub type ServoElementSnapshotOwned = ::gecko_bindings::sugar::ownership::Owned<S
pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>; pub type ServoElementSnapshotBorrowedOrNull<'a> = Option<&'a ServoElementSnapshot>;
pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>; pub type ServoElementSnapshotBorrowedMutOrNull<'a> = Option<&'a mut ServoElementSnapshot>;
pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<ServoElementSnapshot>; pub type ServoElementSnapshotOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<ServoElementSnapshot>;
use gecko_bindings::structs::Element; use gecko_bindings::structs::RawGeckoDocument;
use gecko_bindings::structs::RawGeckoElement;
use gecko_bindings::structs::RawGeckoNode;
use gecko_bindings::structs::ThreadSafeURIHolder;
use gecko_bindings::structs::ThreadSafePrincipalHolder;
use gecko_bindings::structs::ConsumeStyleBehavior;
use gecko_bindings::structs::LazyComputeBehavior;
use gecko_bindings::structs::SkipRootBehavior;
use gecko_bindings::structs::FontFamilyList; use gecko_bindings::structs::FontFamilyList;
use gecko_bindings::structs::FontFamilyType; use gecko_bindings::structs::FontFamilyType;
use gecko_bindings::structs::ServoElementSnapshot; use gecko_bindings::structs::ServoElementSnapshot;
@ -79,11 +86,6 @@ use gecko_bindings::structs::nsChangeHint;
use gecko_bindings::structs::nsCursorImage; use gecko_bindings::structs::nsCursorImage;
use gecko_bindings::structs::nsFont; use gecko_bindings::structs::nsFont;
use gecko_bindings::structs::nsIAtom; use gecko_bindings::structs::nsIAtom;
use gecko_bindings::structs::nsIDocument;
use gecko_bindings::structs::nsINode;
use gecko_bindings::structs::nsIPrincipal;
use gecko_bindings::structs::nsIURI;
use gecko_bindings::structs::nsMainThreadPtrHolder;
use gecko_bindings::structs::nsRestyleHint; use gecko_bindings::structs::nsRestyleHint;
use gecko_bindings::structs::nsStyleBackground; use gecko_bindings::structs::nsStyleBackground;
unsafe impl Send for nsStyleBackground {} unsafe impl Send for nsStyleBackground {}
@ -202,18 +204,6 @@ unsafe impl Sync for nsStyleXUL {}
use gecko_bindings::structs::nscoord; use gecko_bindings::structs::nscoord;
use gecko_bindings::structs::nsresult; use gecko_bindings::structs::nsresult;
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ConsumeStyleBehavior { Consume = 0, DontConsume = 1, }
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum LazyComputeBehavior { Allow = 0, Assert = 1, }
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum SkipRootBehavior { Skip = 0, DontSkip = 1, }
pub type RawGeckoNode = nsINode;
pub type RawGeckoElement = Element;
pub type RawGeckoDocument = nsIDocument;
extern "C" { extern "C" {
pub fn Servo_CssRules_AddRef(ptr: ServoCssRulesBorrowed); pub fn Servo_CssRules_AddRef(ptr: ServoCssRulesBorrowed);
} }
@ -257,7 +247,6 @@ extern "C" {
pub fn Gecko_ClearPODTArray(aArray: *mut ::std::os::raw::c_void, pub fn Gecko_ClearPODTArray(aArray: *mut ::std::os::raw::c_void,
aElementSize: usize, aElementAlign: usize); aElementSize: usize, aElementAlign: usize);
} }
pub type ThreadSafePrincipalHolder = nsMainThreadPtrHolder<nsIPrincipal>;
extern "C" { extern "C" {
pub fn Gecko_AddRefPrincipalArbitraryThread(aPtr: pub fn Gecko_AddRefPrincipalArbitraryThread(aPtr:
*mut ThreadSafePrincipalHolder); *mut ThreadSafePrincipalHolder);
@ -266,7 +255,6 @@ extern "C" {
pub fn Gecko_ReleasePrincipalArbitraryThread(aPtr: pub fn Gecko_ReleasePrincipalArbitraryThread(aPtr:
*mut ThreadSafePrincipalHolder); *mut ThreadSafePrincipalHolder);
} }
pub type ThreadSafeURIHolder = nsMainThreadPtrHolder<nsIURI>;
extern "C" { extern "C" {
pub fn Gecko_AddRefURIArbitraryThread(aPtr: *mut ThreadSafeURIHolder); pub fn Gecko_AddRefURIArbitraryThread(aPtr: *mut ThreadSafeURIHolder);
} }

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -232,10 +232,10 @@ macro_rules! impl_threadsafe_refcount {
); );
} }
impl_threadsafe_refcount!(::gecko_bindings::bindings::ThreadSafePrincipalHolder, impl_threadsafe_refcount!(::gecko_bindings::structs::ThreadSafePrincipalHolder,
Gecko_AddRefPrincipalArbitraryThread, Gecko_AddRefPrincipalArbitraryThread,
Gecko_ReleasePrincipalArbitraryThread); Gecko_ReleasePrincipalArbitraryThread);
impl_threadsafe_refcount!(::gecko_bindings::bindings::ThreadSafeURIHolder, impl_threadsafe_refcount!(::gecko_bindings::structs::ThreadSafeURIHolder,
Gecko_AddRefURIArbitraryThread, Gecko_AddRefURIArbitraryThread,
Gecko_ReleaseURIArbitraryThread); Gecko_ReleaseURIArbitraryThread);
impl_threadsafe_refcount!(::gecko_bindings::structs::nsStyleQuoteValues, impl_threadsafe_refcount!(::gecko_bindings::structs::nsStyleQuoteValues,
@ -244,5 +244,5 @@ impl_threadsafe_refcount!(::gecko_bindings::structs::nsStyleQuoteValues,
impl_threadsafe_refcount!(::gecko_bindings::structs::nsCSSValueSharedList, impl_threadsafe_refcount!(::gecko_bindings::structs::nsCSSValueSharedList,
Gecko_AddRefCSSValueSharedListArbitraryThread, Gecko_AddRefCSSValueSharedListArbitraryThread,
Gecko_ReleaseCSSValueSharedListArbitraryThread); Gecko_ReleaseCSSValueSharedListArbitraryThread);
pub type GeckoArcPrincipal = RefPtr<::gecko_bindings::bindings::ThreadSafePrincipalHolder>; pub type GeckoArcPrincipal = RefPtr<::gecko_bindings::structs::ThreadSafePrincipalHolder>;
pub type GeckoArcURI = RefPtr<::gecko_bindings::bindings::ThreadSafeURIHolder>; pub type GeckoArcURI = RefPtr<::gecko_bindings::structs::ThreadSafeURIHolder>;

Просмотреть файл

@ -28,20 +28,19 @@ use style::gecko::selector_parser::{SelectorImpl, PseudoElement};
use style::gecko::traversal::RecalcStyleOnly; use style::gecko::traversal::RecalcStyleOnly;
use style::gecko::wrapper::DUMMY_BASE_URL; use style::gecko::wrapper::DUMMY_BASE_URL;
use style::gecko::wrapper::GeckoElement; use style::gecko::wrapper::GeckoElement;
use style::gecko_bindings::bindings;
use style::gecko_bindings::bindings::{RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockStrong}; use style::gecko_bindings::bindings::{RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockStrong};
use style::gecko_bindings::bindings::{RawServoStyleRuleBorrowed, RawServoStyleRuleStrong}; use style::gecko_bindings::bindings::{RawServoStyleRuleBorrowed, RawServoStyleRuleStrong};
use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSetOwned}; use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSetOwned};
use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed}; use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed};
use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong}; use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong};
use style::gecko_bindings::bindings::{ServoCssRulesBorrowed, ServoCssRulesStrong}; use style::gecko_bindings::bindings::{ServoCssRulesBorrowed, ServoCssRulesStrong};
use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
use style::gecko_bindings::bindings::{nsACString, nsAString}; use style::gecko_bindings::bindings::{nsACString, nsAString};
use style::gecko_bindings::bindings::RawGeckoElementBorrowed; use style::gecko_bindings::bindings::RawGeckoElementBorrowed;
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull; use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t; use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
use style::gecko_bindings::structs; use style::gecko_bindings::structs;
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom}; use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom};
use style::gecko_bindings::structs::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint}; use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint};
use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::structs::nsresult;
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI}; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasArcFFI, HasBoxFFI};
@ -160,10 +159,10 @@ fn traverse_subtree(element: GeckoElement, raw_data: RawServoStyleSetBorrowed,
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed,
raw_data: RawServoStyleSetBorrowed, raw_data: RawServoStyleSetBorrowed,
skip_root: bindings::SkipRootBehavior) -> () { skip_root: structs::SkipRootBehavior) -> () {
let element = GeckoElement(root); let element = GeckoElement(root);
debug!("Servo_TraverseSubtree: {:?}", element); debug!("Servo_TraverseSubtree: {:?}", element);
traverse_subtree(element, raw_data, skip_root == bindings::SkipRootBehavior::Skip); traverse_subtree(element, raw_data, skip_root == structs::SkipRootBehavior::Skip);
} }
#[no_mangle] #[no_mangle]
@ -812,13 +811,13 @@ pub extern "C" fn Servo_CheckChangeHint(element: RawGeckoElementBorrowed) -> nsC
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed, pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
raw_data: RawServoStyleSetBorrowed, raw_data: RawServoStyleSetBorrowed,
consume: bindings::ConsumeStyleBehavior, consume: structs::ConsumeStyleBehavior,
compute: bindings::LazyComputeBehavior) -> ServoComputedValuesStrong compute: structs::LazyComputeBehavior) -> ServoComputedValuesStrong
{ {
let element = GeckoElement(element); let element = GeckoElement(element);
debug!("Servo_ResolveStyle: {:?}, consume={:?}, compute={:?}", element, consume, compute); debug!("Servo_ResolveStyle: {:?}, consume={:?}, compute={:?}", element, consume, compute);
if compute == bindings::LazyComputeBehavior::Allow { if compute == structs::LazyComputeBehavior::Allow {
let should_compute = unsafe { element.ensure_data() }.borrow().get_current_styles().is_none(); let should_compute = unsafe { element.ensure_data() }.borrow().get_current_styles().is_none();
if should_compute { if should_compute {
debug!("Performing manual style computation"); debug!("Performing manual style computation");
@ -856,7 +855,7 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
} }
}; };
if consume == bindings::ConsumeStyleBehavior::Consume { if consume == structs::ConsumeStyleBehavior::Consume {
// FIXME(bholley): Once we start storing style data on frames, we'll want to // FIXME(bholley): Once we start storing style data on frames, we'll want to
// drop the data here instead. // drop the data here instead.
data.unwrap().persist(); data.unwrap().persist();