Skip to content
Permalink
Browse files

Make sure we don't recreate boxes just because we have a ::first-line.

Servo part of part 5 of the fix for Gecko bug 1324619.  r=emilio
  • Loading branch information
bzbarsky committed Jul 29, 2017
1 parent 7161fff commit c531af96aeffb33a0095a0a48a706a42bea52f71
@@ -87,6 +87,12 @@ impl PseudoElement {
*self == PseudoElement::FirstLetter
}

/// Whether this pseudo-element is ::first-line.
#[inline]
pub fn is_first_line(&self) -> bool {
*self == PseudoElement::FirstLine
}

/// Whether this pseudo-element is ::-moz-fieldset-content.
#[inline]
pub fn is_fieldset_content(&self) -> bool {
@@ -827,7 +827,7 @@ pub trait MatchMethods : TElement {
return StyleDifference::new(RestyleDamage::empty(), StyleChange::Unchanged)
}

if pseudo.map_or(false, |p| p.is_first_letter()) {
if pseudo.map_or(false, |p| p.is_first_letter() || p.is_first_line()) {
// No one cares about this pseudo, and we've checked above that
// we're not switching from a "cares" to a "doesn't care" state
// or vice versa.
@@ -42,6 +42,8 @@ pub enum PseudoElement {
Selection,
// If/when :first-letter is added, update is_first_letter accordingly.

// If/when :first-line is added, update is_first_line accordingly.

// If/when ::first-letter, ::first-line, or ::placeholder are added, adjust
// our property_restriction implementation to do property filtering for
// them. Also, make sure the UA sheet has the !important rules some of the
@@ -125,6 +127,12 @@ impl PseudoElement {
false
}

/// Whether the current pseudo element is :first-line
#[inline]
pub fn is_first_line(&self) -> bool {
false
}

/// Whether this pseudo-element is eagerly-cascaded.
#[inline]
pub fn is_eager(&self) -> bool {

0 comments on commit c531af9

Please sign in to comment.
You can’t perform that action at this time.