mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
stylo: Switch Gecko over to ServoStyleContext
This commit is contained in:
parent
74519cc1a7
commit
89930e7565
19 changed files with 4479 additions and 2353 deletions
|
@ -39,7 +39,7 @@ use style::gecko_bindings::bindings::{RawServoNamespaceRule, RawServoNamespaceRu
|
|||
use style::gecko_bindings::bindings::{RawServoPageRule, RawServoPageRuleBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSetOwned};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSheetContentsBorrowed, ServoComputedValuesBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSheetContentsStrong, ServoComputedValuesStrong};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSheetContentsStrong, ServoStyleContextBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoSupportsRule, RawServoSupportsRuleBorrowed};
|
||||
use style::gecko_bindings::bindings::{ServoCssRulesBorrowed, ServoCssRulesStrong};
|
||||
use style::gecko_bindings::bindings::{nsACString, nsAString, nsCSSPropertyIDSetBorrowedMut};
|
||||
|
@ -61,13 +61,14 @@ use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowedMut;
|
|||
use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
|
||||
use style::gecko_bindings::bindings::RawServoStyleRuleBorrowed;
|
||||
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
|
||||
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, ServoStyleSheet};
|
||||
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom, nsCSSPropertyID};
|
||||
use style::gecko_bindings::structs::{RawServoStyleRule, ServoStyleContextStrong};
|
||||
use style::gecko_bindings::structs::{ServoStyleSheet, SheetParsingMode, nsIAtom, nsCSSPropertyID};
|
||||
use style::gecko_bindings::structs::{nsCSSFontFaceRule, nsCSSCounterStyleRule};
|
||||
use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint, PropertyValuePair};
|
||||
use style::gecko_bindings::structs::IterationCompositeOperation;
|
||||
|
@ -92,7 +93,7 @@ use style::parallel;
|
|||
use style::parser::ParserContext;
|
||||
use style::properties::{ComputedValues, ComputedValuesInner, Importance, SourcePropertyDeclaration};
|
||||
use style::properties::{LonghandIdSet, PropertyDeclaration, PropertyDeclarationBlock, PropertyId, StyleBuilder};
|
||||
use style::properties::SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP;
|
||||
use style::properties::{SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, PseudoInfo, ParentStyleContextInfo};
|
||||
use style::properties::animated_properties::{Animatable, AnimatableLonghand, AnimationValue};
|
||||
use style::properties::parse_one_declaration_into;
|
||||
use style::rule_tree::StyleSource;
|
||||
|
@ -655,10 +656,10 @@ pub extern "C" fn Servo_AnimationValue_Uncompute(value: RawServoAnimationValueBo
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_GetBaseComputedValuesForElement(raw_data: RawServoStyleSetBorrowed,
|
||||
element: RawGeckoElementBorrowed,
|
||||
computed_values: ServoComputedValuesBorrowed,
|
||||
computed_values: ServoStyleContextBorrowed,
|
||||
snapshots: *const ServoElementSnapshotTable,
|
||||
pseudo_type: CSSPseudoElementType)
|
||||
-> ServoComputedValuesStrong
|
||||
-> ServoStyleContextStrong
|
||||
{
|
||||
use style::style_resolver::StyleResolverForElement;
|
||||
|
||||
|
@ -731,7 +732,6 @@ pub extern "C" fn Servo_ComputedValues_ExtractAnimationValue(computed_values: Se
|
|||
None => { return Strong::null(); }
|
||||
};
|
||||
|
||||
let computed_values = ComputedValues::as_arc(&computed_values);
|
||||
Arc::new(AnimationValue::from_computed_values(&property, computed_values)).into_strong()
|
||||
}
|
||||
|
||||
|
@ -1501,10 +1501,11 @@ pub extern "C" fn Servo_DocumentRule_GetConditionText(rule: RawServoDocumentRule
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null: ServoComputedValuesBorrowedOrNull,
|
||||
pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null: ServoStyleContextBorrowedOrNull,
|
||||
pseudo_type: CSSPseudoElementType,
|
||||
pseudo_tag: *mut nsIAtom,
|
||||
raw_data: RawServoStyleSetBorrowed)
|
||||
-> ServoComputedValuesStrong {
|
||||
-> ServoStyleContextStrong {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
let guards = StylesheetGuards::same(&guard);
|
||||
|
@ -1513,23 +1514,24 @@ pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null:
|
|||
let pseudo = PseudoElement::from_anon_box_atom(&atom)
|
||||
.expect("Not an anon box pseudo?");
|
||||
|
||||
|
||||
let maybe_parent = ComputedValues::arc_from_borrowed(&parent_style_or_null)
|
||||
.map(|p| &p.inner);
|
||||
let cascade_flags = SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP;
|
||||
let metrics = get_metrics_provider_for_product();
|
||||
data.stylist.precomputed_values_for_pseudo(&guards, &pseudo, maybe_parent,
|
||||
cascade_flags, &metrics)
|
||||
data.stylist.precomputed_values_for_pseudo(&guards, &pseudo, parent_style_or_null.map(|x| &**x),
|
||||
cascade_flags, &metrics,
|
||||
(pseudo_tag, pseudo_type),
|
||||
parent_style_or_null)
|
||||
.into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
||||
pseudo_type: CSSPseudoElementType,
|
||||
pseudo_tag: *mut nsIAtom,
|
||||
is_probe: bool,
|
||||
inherited_style: ServoComputedValuesBorrowedOrNull,
|
||||
parent_style_context: ServoStyleContextBorrowedOrNull,
|
||||
raw_data: RawServoStyleSetBorrowed)
|
||||
-> ServoComputedValuesStrong
|
||||
-> ServoStyleContextStrong
|
||||
{
|
||||
let element = GeckoElement(element);
|
||||
let data = unsafe { element.ensure_data() };
|
||||
|
@ -1544,7 +1546,9 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
|||
return if is_probe {
|
||||
Strong::null()
|
||||
} else {
|
||||
doc_data.default_computed_values().clone().to_outer().into_strong()
|
||||
doc_data.default_computed_values()
|
||||
.clone().to_outer(doc_data.stylist.device(), parent_style_context,
|
||||
Some((pseudo_tag, pseudo_type))).into_strong()
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1559,9 +1563,11 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
|||
&pseudo,
|
||||
RuleInclusion::All,
|
||||
&data.styles,
|
||||
ComputedValues::arc_from_borrowed(&inherited_style).map(|x| &***x),
|
||||
inherited_style,
|
||||
&*doc_data,
|
||||
is_probe
|
||||
is_probe,
|
||||
(pseudo_tag, pseudo_type),
|
||||
parent_style_context
|
||||
);
|
||||
|
||||
match style {
|
||||
|
@ -1575,7 +1581,7 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_SetExplicitStyle(element: RawGeckoElementBorrowed,
|
||||
style: ServoComputedValuesBorrowed)
|
||||
style: ServoStyleContextBorrowed)
|
||||
{
|
||||
let element = GeckoElement(element);
|
||||
let style = ComputedValues::as_arc(&style);
|
||||
|
@ -1616,6 +1622,8 @@ fn get_pseudo_style(
|
|||
inherited_styles: Option<&ComputedValuesInner>,
|
||||
doc_data: &PerDocumentStyleDataImpl,
|
||||
is_probe: bool,
|
||||
pseudo_info: PseudoInfo,
|
||||
parent_style_context: ParentStyleContextInfo,
|
||||
) -> Option<Arc<ComputedValues>> {
|
||||
let style = match pseudo.cascade_type() {
|
||||
PseudoElementCascadeType::Eager => {
|
||||
|
@ -1637,7 +1645,9 @@ fn get_pseudo_style(
|
|||
&inputs,
|
||||
&guards,
|
||||
inherited_styles,
|
||||
&metrics)
|
||||
&metrics,
|
||||
pseudo_info.clone(),
|
||||
parent_style_context)
|
||||
})
|
||||
},
|
||||
_ => {
|
||||
|
@ -1668,7 +1678,9 @@ fn get_pseudo_style(
|
|||
rule_inclusion,
|
||||
base,
|
||||
is_probe,
|
||||
&metrics)
|
||||
&metrics,
|
||||
pseudo_info.clone(),
|
||||
parent_style_context)
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -1680,21 +1692,23 @@ fn get_pseudo_style(
|
|||
StyleBuilder::for_inheritance(
|
||||
styles.primary(),
|
||||
doc_data.default_computed_values(),
|
||||
).build().to_outer()
|
||||
).build().to_outer(doc_data.stylist.device(), parent_style_context,
|
||||
Some(pseudo_info))
|
||||
}))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_Inherit(
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
parent_style: ServoComputedValuesBorrowedOrNull,
|
||||
pseudo_type: CSSPseudoElementType,
|
||||
pseudo_tag: *mut nsIAtom,
|
||||
parent_style_context: ServoStyleContextBorrowedOrNull,
|
||||
target: structs::InheritTarget
|
||||
) -> ServoComputedValuesStrong {
|
||||
) -> ServoStyleContextStrong {
|
||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
let maybe_arc = ComputedValues::arc_from_borrowed(&parent_style);
|
||||
|
||||
let for_text = target == structs::InheritTarget::Text;
|
||||
let style = if let Some(reference) = maybe_arc.as_ref() {
|
||||
let style = if let Some(reference) = parent_style_context {
|
||||
let mut style =
|
||||
StyleBuilder::for_inheritance(reference,
|
||||
&data.default_computed_values());
|
||||
|
@ -1709,22 +1723,42 @@ pub extern "C" fn Servo_ComputedValues_Inherit(
|
|||
data.default_computed_values().clone()
|
||||
};
|
||||
|
||||
style.to_outer().into_strong()
|
||||
let pseudo_info = if pseudo_tag.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some((pseudo_tag, pseudo_type))
|
||||
};
|
||||
|
||||
style.to_outer(data.stylist.device(), parent_style_context, pseudo_info).into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_GetVisitedStyle(values: ServoComputedValuesBorrowed)
|
||||
-> ServoComputedValuesStrong {
|
||||
match ComputedValues::as_arc(&values).clone_visited_style() {
|
||||
-> ServoStyleContextStrong {
|
||||
match ComputedValuesInner::as_arc(&values).clone_visited_style() {
|
||||
Some(v) => v.into_strong(),
|
||||
None => Strong::null(),
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleContext_NewContext(values: ServoComputedValuesBorrowed,
|
||||
parent: ServoStyleContextBorrowedOrNull,
|
||||
pres_context: bindings::RawGeckoPresContextBorrowed,
|
||||
pseudo_type: CSSPseudoElementType,
|
||||
pseudo_tag: *mut nsIAtom)
|
||||
-> ServoStyleContextStrong {
|
||||
let arc = ComputedValuesInner::as_arc(&values);
|
||||
unsafe {
|
||||
ComputedValuesInner::to_outer_from_arc(arc.clone_arc(), pres_context, parent,
|
||||
pseudo_type, pseudo_tag).into_strong()
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_GetStyleBits(values: ServoComputedValuesBorrowed) -> u64 {
|
||||
use style::properties::computed_value_flags::*;
|
||||
let flags = ComputedValues::as_arc(&values).flags;
|
||||
let flags = values.flags;
|
||||
let mut result = 0;
|
||||
if flags.contains(HAS_TEXT_DECORATION_LINES) {
|
||||
result |= structs::NS_STYLE_HAS_TEXT_DECORATION_LINES as u64;
|
||||
|
@ -1738,7 +1772,6 @@ pub extern "C" fn Servo_ComputedValues_GetStyleBits(values: ServoComputedValuesB
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_SpecifiesAnimationsOrTransitions(values: ServoComputedValuesBorrowed)
|
||||
-> bool {
|
||||
let values = ComputedValues::as_arc(&values);
|
||||
let b = values.get_box();
|
||||
b.specifies_animations() || b.specifies_transitions()
|
||||
}
|
||||
|
@ -1748,15 +1781,12 @@ pub extern "C" fn Servo_ComputedValues_EqualCustomProperties(
|
|||
first: ServoComputedValuesBorrowed,
|
||||
second: ServoComputedValuesBorrowed
|
||||
) -> bool {
|
||||
let first = ComputedValues::as_arc(&first);
|
||||
let second = ComputedValues::as_arc(&second);
|
||||
first.get_custom_properties() == second.get_custom_properties()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(values: ServoComputedValuesBorrowed,
|
||||
rules: RawGeckoServoStyleRuleListBorrowedMut) {
|
||||
let values = ComputedValues::as_arc(&values);
|
||||
if let Some(ref rule_node) = values.rules {
|
||||
let mut result = vec![];
|
||||
for node in rule_node.self_and_ancestors() {
|
||||
|
@ -2775,7 +2805,7 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
||||
_raw_data: RawServoStyleSetBorrowed)
|
||||
-> ServoComputedValuesStrong
|
||||
-> ServoStyleContextStrong
|
||||
{
|
||||
let element = GeckoElement(element);
|
||||
debug!("Servo_ResolveStyle: {:?}", element);
|
||||
|
@ -2792,10 +2822,12 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed,
|
||||
pseudo_type: CSSPseudoElementType,
|
||||
pseudo_tag: *mut nsIAtom,
|
||||
parent_style_context: ServoStyleContextBorrowedOrNull,
|
||||
rule_inclusion: StyleRuleInclusion,
|
||||
snapshots: *const ServoElementSnapshotTable,
|
||||
raw_data: RawServoStyleSetBorrowed)
|
||||
-> ServoComputedValuesStrong
|
||||
-> ServoStyleContextStrong
|
||||
{
|
||||
debug_assert!(!snapshots.is_null());
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
|
@ -2816,6 +2848,8 @@ pub extern "C" fn Servo_ResolveStyleLazily(element: RawGeckoElementBorrowed,
|
|||
/* inherited_styles = */ None,
|
||||
&*data,
|
||||
/* is_probe = */ false,
|
||||
(pseudo_tag, pseudo_type),
|
||||
parent_style_context
|
||||
).expect("We're not probing, so we should always get a style \
|
||||
back")
|
||||
}
|
||||
|
@ -2869,11 +2903,11 @@ fn simulate_compute_values_failure(_: &PropertyValuePair) -> bool {
|
|||
|
||||
fn create_context<'a>(per_doc_data: &'a PerDocumentStyleDataImpl,
|
||||
font_metrics_provider: &'a FontMetricsProvider,
|
||||
style: &'a ComputedValues,
|
||||
parent_style: &'a Option<&Arc<ComputedValues>>)
|
||||
style: &'a ComputedValuesInner,
|
||||
parent_style: &'a Option<&ComputedValuesInner>)
|
||||
-> Context<'a> {
|
||||
let default_values = per_doc_data.default_computed_values();
|
||||
let inherited_style = parent_style.map(|x| &x.inner).unwrap_or(default_values);
|
||||
let inherited_style = parent_style.unwrap_or(default_values);
|
||||
|
||||
Context {
|
||||
is_root_element: false,
|
||||
|
@ -2900,12 +2934,11 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis
|
|||
|
||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
let metrics = get_metrics_provider_for_product();
|
||||
let style = ComputedValues::as_arc(&style);
|
||||
|
||||
let element = GeckoElement(element);
|
||||
let parent_element = element.inheritance_parent();
|
||||
let parent_data = parent_element.as_ref().and_then(|e| e.borrow_data());
|
||||
let parent_style = parent_data.as_ref().map(|d| d.styles.primary());
|
||||
let parent_style = parent_data.as_ref().map(|d| d.styles.primary()).map(|x| &***x);
|
||||
|
||||
let mut context = create_context(&data, &metrics, style, &parent_style);
|
||||
|
||||
|
@ -2980,13 +3013,12 @@ pub extern "C" fn Servo_GetAnimationValues(declarations: RawServoDeclarationBloc
|
|||
raw_data: RawServoStyleSetBorrowed,
|
||||
animation_values: RawGeckoServoAnimationValueListBorrowedMut) {
|
||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
let style = ComputedValues::as_arc(&style);
|
||||
let metrics = get_metrics_provider_for_product();
|
||||
|
||||
let element = GeckoElement(element);
|
||||
let parent_element = element.inheritance_parent();
|
||||
let parent_data = parent_element.as_ref().and_then(|e| e.borrow_data());
|
||||
let parent_style = parent_data.as_ref().map(|d| d.styles.primary());
|
||||
let parent_style = parent_data.as_ref().map(|d| d.styles.primary()).map(|x| &***x);
|
||||
|
||||
let mut context = create_context(&data, &metrics, style, &parent_style);
|
||||
|
||||
|
@ -3009,13 +3041,12 @@ pub extern "C" fn Servo_AnimationValue_Compute(element: RawGeckoElementBorrowed,
|
|||
raw_data: RawServoStyleSetBorrowed)
|
||||
-> RawServoAnimationValueStrong {
|
||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
let style = ComputedValues::as_arc(&style);
|
||||
let metrics = get_metrics_provider_for_product();
|
||||
|
||||
let element = GeckoElement(element);
|
||||
let parent_element = element.inheritance_parent();
|
||||
let parent_data = parent_element.as_ref().and_then(|e| e.borrow_data());
|
||||
let parent_style = parent_data.as_ref().map(|d| d.styles.primary());
|
||||
let parent_style = parent_data.as_ref().map(|d| d.styles.primary()).map(|x| &***x);
|
||||
|
||||
let mut context = create_context(&data, &metrics, style, &parent_style);
|
||||
|
||||
|
@ -3259,16 +3290,16 @@ pub extern "C" fn Servo_StyleSet_GetCounterStyleRule(raw_data: RawServoStyleSetB
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_ResolveForDeclarations(
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
parent_style_or_null: ServoComputedValuesBorrowedOrNull,
|
||||
declarations: RawServoDeclarationBlockBorrowed
|
||||
) -> ServoComputedValuesStrong {
|
||||
parent_style_context: ServoStyleContextBorrowedOrNull,
|
||||
declarations: RawServoDeclarationBlockBorrowed,
|
||||
) -> ServoStyleContextStrong {
|
||||
let doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
let guards = StylesheetGuards::same(&guard);
|
||||
|
||||
let parent_style = match ComputedValues::arc_from_borrowed(&parent_style_or_null) {
|
||||
Some(parent) => &parent.inner,
|
||||
let parent_style = match parent_style_context {
|
||||
Some(parent) => &**parent,
|
||||
None => doc_data.default_computed_values(),
|
||||
};
|
||||
|
||||
|
@ -3276,7 +3307,8 @@ pub extern "C" fn Servo_StyleSet_ResolveForDeclarations(
|
|||
|
||||
doc_data.stylist.compute_for_declarations(&guards,
|
||||
parent_style,
|
||||
declarations.clone_arc()).into_strong()
|
||||
declarations.clone_arc(),
|
||||
parent_style_context).into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -3336,7 +3368,8 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency(
|
|||
pub extern "C" fn Servo_GetCustomPropertyValue(computed_values: ServoComputedValuesBorrowed,
|
||||
name: *const nsAString,
|
||||
value: *mut nsAString) -> bool {
|
||||
let custom_properties = match ComputedValues::as_arc(&computed_values).custom_properties() {
|
||||
|
||||
let custom_properties = match computed_values.custom_properties() {
|
||||
Some(p) => p,
|
||||
None => return false,
|
||||
};
|
||||
|
@ -3353,7 +3386,7 @@ pub extern "C" fn Servo_GetCustomPropertyValue(computed_values: ServoComputedVal
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_GetCustomPropertiesCount(computed_values: ServoComputedValuesBorrowed) -> u32 {
|
||||
match ComputedValues::as_arc(&computed_values).custom_properties() {
|
||||
match ComputedValuesInner::as_arc(&computed_values).custom_properties() {
|
||||
Some(p) => p.len() as u32,
|
||||
None => 0,
|
||||
}
|
||||
|
@ -3363,7 +3396,7 @@ pub extern "C" fn Servo_GetCustomPropertiesCount(computed_values: ServoComputedV
|
|||
pub extern "C" fn Servo_GetCustomPropertyNameAt(computed_values: ServoComputedValuesBorrowed,
|
||||
index: u32,
|
||||
name: *mut nsAString) -> bool {
|
||||
let custom_properties = match ComputedValues::as_arc(&computed_values).custom_properties() {
|
||||
let custom_properties = match ComputedValuesInner::as_arc(&computed_values).custom_properties() {
|
||||
Some(p) => p,
|
||||
None => return false,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue