Port text-combine-upright writing mode fixup to Servo

Ports the Gecko fixup for text-combine-upright writing mode to Servo.  In
addition, this passes the current pseudo element (if any) down to the cascade
for use during the fixup process.

MozReview-Commit-ID: BkHd4AvSsOt
This commit is contained in:
J. Ryan Stinnett 2017-04-24 16:04:15 -05:00
parent 78a2e3be51
commit 978239927d
7 changed files with 57 additions and 12 deletions

View file

@ -1257,7 +1257,7 @@ ${helpers.single_keyword("ruby-position", "over under",
// https://drafts.csswg.org/css-writing-modes-3/
${helpers.single_keyword("text-combine-upright", "none all",
products="gecko", animation_value_type="none",
products="gecko", animation_value_type="none", need_clone=True,
spec="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright")}
// SVG 1.1: Section 11 - Painting: Filling, Stroking and Marker Symbols

View file

@ -29,6 +29,7 @@ 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;
@ -2108,6 +2109,7 @@ bitflags! {
///
pub fn cascade(device: &Device,
rule_node: &StrongRuleNode,
pseudo: Option<<&PseudoElement>,
guards: &StylesheetGuards,
parent_style: Option<<&ComputedValues>,
layout_parent_style: Option<<&ComputedValues>,
@ -2153,6 +2155,7 @@ pub fn cascade(device: &Device,
};
apply_declarations(device,
is_root_element,
pseudo,
iter_declarations,
inherited_style,
layout_parent_style,
@ -2167,6 +2170,7 @@ 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,
@ -2373,7 +2377,7 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
let mut style = context.style;
StyleAdjuster::new(&mut style, is_root_element)
StyleAdjuster::new(&mut style, is_root_element, pseudo)
.adjust(context.layout_parent_style,
flags.contains(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP));