This commit is contained in:
Manish Goregaokar 2017-07-17 18:45:19 -07:00
parent c33fa3effa
commit 8eafe6a3b7
6 changed files with 17 additions and 17 deletions

View file

@ -10,8 +10,7 @@
use gecko_bindings::bindings::{RawServoImportRule, RawServoSupportsRule}; use gecko_bindings::bindings::{RawServoImportRule, RawServoSupportsRule};
use gecko_bindings::bindings::{RawServoKeyframe, RawServoKeyframesRule}; use gecko_bindings::bindings::{RawServoKeyframe, RawServoKeyframesRule};
use gecko_bindings::bindings::RawServoMediaRule; use gecko_bindings::bindings::{RawServoMediaRule, RawServoNamespaceRule, RawServoPageRule};
use gecko_bindings::bindings::{RawServoNamespaceRule, RawServoPageRule};
use gecko_bindings::bindings::{RawServoRuleNode, RawServoRuleNodeStrong, RawServoDocumentRule}; use gecko_bindings::bindings::{RawServoRuleNode, RawServoRuleNodeStrong, RawServoDocumentRule};
use gecko_bindings::bindings::ServoCssRules; use gecko_bindings::bindings::ServoCssRules;
use gecko_bindings::structs::{RawServoAnimationValue, RawServoDeclarationBlock, RawServoStyleRule, RawServoMediaList}; use gecko_bindings::structs::{RawServoAnimationValue, RawServoDeclarationBlock, RawServoStyleRule, RawServoMediaList};

View file

@ -866,8 +866,8 @@ impl<'le> TElement for GeckoElement<'le> {
} }
let declarations = unsafe { Gecko_GetStyleAttrDeclarationBlock(self.0) }; let declarations = unsafe { Gecko_GetStyleAttrDeclarationBlock(self.0) };
let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> =
= declarations.and_then(|s| s.as_arc_opt()); declarations.and_then(|s| s.as_arc_opt());
declarations.map(|s| s.borrow_arc()) declarations.map(|s| s.borrow_arc())
} }
@ -881,8 +881,8 @@ impl<'le> TElement for GeckoElement<'le> {
fn get_smil_override(&self) -> Option<ArcBorrow<Locked<PropertyDeclarationBlock>>> { fn get_smil_override(&self) -> Option<ArcBorrow<Locked<PropertyDeclarationBlock>>> {
let declarations = unsafe { Gecko_GetSMILOverrideDeclarationBlock(self.0) }; let declarations = unsafe { Gecko_GetSMILOverrideDeclarationBlock(self.0) };
let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> =
= declarations.and_then(|s| s.as_arc_opt()); declarations.and_then(|s| s.as_arc_opt());
declarations.map(|s| s.borrow_arc()) declarations.map(|s| s.borrow_arc())
} }
@ -1431,16 +1431,16 @@ impl<'le> PresentationalHintsSynthesizer for GeckoElement<'le> {
} }
} }
let declarations = unsafe { Gecko_GetHTMLPresentationAttrDeclarationBlock(self.0) }; let declarations = unsafe { Gecko_GetHTMLPresentationAttrDeclarationBlock(self.0) };
let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> =
= declarations.and_then(|s| s.as_arc_opt()); declarations.and_then(|s| s.as_arc_opt());
if let Some(decl) = declarations { if let Some(decl) = declarations {
hints.push( hints.push(
ApplicableDeclarationBlock::from_declarations(decl.clone_arc(), ServoCascadeLevel::PresHints) ApplicableDeclarationBlock::from_declarations(decl.clone_arc(), ServoCascadeLevel::PresHints)
); );
} }
let declarations = unsafe { Gecko_GetExtraContentStyleDeclarations(self.0) }; let declarations = unsafe { Gecko_GetExtraContentStyleDeclarations(self.0) };
let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> =
= declarations.and_then(|s| s.as_arc_opt()); declarations.and_then(|s| s.as_arc_opt());
if let Some(decl) = declarations { if let Some(decl) = declarations {
hints.push( hints.push(
ApplicableDeclarationBlock::from_declarations(decl.clone_arc(), ServoCascadeLevel::PresHints) ApplicableDeclarationBlock::from_declarations(decl.clone_arc(), ServoCascadeLevel::PresHints)
@ -1474,8 +1474,8 @@ impl<'le> PresentationalHintsSynthesizer for GeckoElement<'le> {
let active = self.get_state().intersects(NonTSPseudoClass::Active.state_flag()); let active = self.get_state().intersects(NonTSPseudoClass::Active.state_flag());
if active { if active {
let declarations = unsafe { Gecko_GetActiveLinkAttrDeclarationBlock(self.0) }; let declarations = unsafe { Gecko_GetActiveLinkAttrDeclarationBlock(self.0) };
let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> let declarations: Option<&RawOffsetArc<Locked<PropertyDeclarationBlock>>> =
= declarations.and_then(|s| s.as_arc_opt()); declarations.and_then(|s| s.as_arc_opt());
if let Some(decl) = declarations { if let Some(decl) = declarations {
hints.push( hints.push(
ApplicableDeclarationBlock::from_declarations(decl.clone_arc(), ServoCascadeLevel::PresHints) ApplicableDeclarationBlock::from_declarations(decl.clone_arc(), ServoCascadeLevel::PresHints)

View file

@ -148,7 +148,9 @@ impl ComputedValuesInner {
visited_style: None, visited_style: None,
flags: ComputedValueFlags::empty(), flags: ComputedValueFlags::empty(),
% for style_struct in data.style_structs: % for style_struct in data.style_structs:
${style_struct.gecko_name}: Arc::into_raw_offset(style_structs::${style_struct.name}::default(pres_context)), ${style_struct.gecko_name}: Arc::into_raw_offset(
style_structs::${style_struct.name}::default(pres_context)
),
% endfor % endfor
} }
} }

View file

@ -168,7 +168,7 @@ impl PseudoElement {
} }
/// Stub, only Gecko needs this /// Stub, only Gecko needs this
pub fn pseudo_info(&self) -> () { () } pub fn pseudo_info(&self) { () }
} }
/// The type used for storing pseudo-class string arguments. /// The type used for storing pseudo-class string arguments.

View file

@ -3358,7 +3358,6 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency(
pub extern "C" fn Servo_GetCustomPropertyValue(computed_values: ServoComputedValuesBorrowed, pub extern "C" fn Servo_GetCustomPropertyValue(computed_values: ServoComputedValuesBorrowed,
name: *const nsAString, name: *const nsAString,
value: *mut nsAString) -> bool { value: *mut nsAString) -> bool {
let custom_properties = match computed_values.custom_properties() { let custom_properties = match computed_values.custom_properties() {
Some(p) => p, Some(p) => p,
None => return false, None => return false,

View file

@ -11,7 +11,7 @@ use style::context::QuirksMode;
use style::font_metrics::ServoMetricsProvider; use style::font_metrics::ServoMetricsProvider;
use style::media_queries::{Device, MediaType}; use style::media_queries::{Device, MediaType};
use style::parser::ParserContext; use style::parser::ParserContext;
use style::properties::{ComputedValues, StyleBuilder}; use style::properties::{ComputedValues, ComputedValuesInner, StyleBuilder};
use style::stylesheets::{CssRuleType, Origin}; use style::stylesheets::{CssRuleType, Origin};
use style::values::computed::{Context, ToComputedValue}; use style::values::computed::{Context, ToComputedValue};
use style_traits::{PARSING_MODE_DEFAULT, ToCss, ParseError}; use style_traits::{PARSING_MODE_DEFAULT, ToCss, ParseError};
@ -49,7 +49,7 @@ fn assert_computed_serialization<C, F, T>(f: F, input: &'static str, output: &st
T: ToComputedValue<ComputedValue=C>, C: ToCss T: ToComputedValue<ComputedValue=C>, C: ToCss
{ {
let viewport_size = TypedSize2D::new(0., 0.); let viewport_size = TypedSize2D::new(0., 0.);
let initial_style = ComputedValues::initial_values(); let initial_style = ComputedValuesInner::initial_values();
let device = Device::new(MediaType::Screen, viewport_size); let device = Device::new(MediaType::Screen, viewport_size);
let context = Context { let context = Context {