Bug 1360508: Adjust text-combine properly. r=jryans

Text style is always resolved via ServoStyleSet::ResolveStyleForText, either
from the frame constructor initially, or from
ServoRestyleManager::ProcessPostTraversalForText.

So text-only adjustments should go there instead. Since that doesn't call into
cascade(), all the code that passes `pseudo` there is dead code we can remove.

MozReview-Commit-ID: jpbBYpLlUL
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-04-28 13:10:00 +02:00
parent ad87d36a69
commit 5cbc6a9b16
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
11 changed files with 95 additions and 63 deletions

View file

@ -102,8 +102,10 @@ pub struct ComputedValues {
}
impl ComputedValues {
pub fn inherit_from(parent: &Self, default: &Self) -> Arc<Self> {
Arc::new(ComputedValues {
/// Inherits style from the parent element, accounting for the default
/// computed values that need to be provided as well.
pub fn inherit_from(parent: &Self, default: &Self) -> Self {
ComputedValues {
custom_properties: parent.custom_properties.clone(),
writing_mode: parent.writing_mode,
root_font_size: parent.root_font_size,
@ -116,7 +118,7 @@ impl ComputedValues {
${style_struct.ident}: default.${style_struct.ident}.clone(),
% endif
% endfor
})
}
}
pub fn new(custom_properties: Option<Arc<ComputedValuesMap>>,

View file

@ -30,7 +30,6 @@ use logical_geometry::WritingMode;
use media_queries::Device;
use parser::{LengthParsingMode, Parse, ParserContext};
use properties::animated_properties::TransitionProperty;
use selector_parser::PseudoElement;
#[cfg(feature = "servo")] use servo_config::prefs::PREFS;
use shared_lock::StylesheetGuards;
use style_traits::ToCss;
@ -2114,7 +2113,6 @@ bitflags! {
///
pub fn cascade(device: &Device,
rule_node: &StrongRuleNode,
pseudo: Option<<&PseudoElement>,
guards: &StylesheetGuards,
parent_style: Option<<&ComputedValues>,
layout_parent_style: Option<<&ComputedValues>,
@ -2161,7 +2159,6 @@ pub fn cascade(device: &Device,
};
apply_declarations(device,
is_root_element,
pseudo,
iter_declarations,
inherited_style,
layout_parent_style,
@ -2177,7 +2174,6 @@ pub fn cascade(device: &Device,
#[allow(unused_mut)] // conditionally compiled code for "position"
pub fn apply_declarations<'a, F, I>(device: &Device,
is_root_element: bool,
pseudo: Option<<&PseudoElement>,
iter_declarations: F,
inherited_style: &ComputedValues,
layout_parent_style: &ComputedValues,
@ -2386,7 +2382,7 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
let mut style = context.style;
StyleAdjuster::new(&mut style, is_root_element, pseudo)
StyleAdjuster::new(&mut style, is_root_element)
.adjust(context.layout_parent_style,
flags.contains(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP));