mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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
This commit is contained in:
parent
7161fff1b8
commit
c531af96ae
3 changed files with 15 additions and 1 deletions
|
@ -87,6 +87,12 @@ impl PseudoElement {
|
||||||
*self == PseudoElement::FirstLetter
|
*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.
|
/// Whether this pseudo-element is ::-moz-fieldset-content.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_fieldset_content(&self) -> bool {
|
pub fn is_fieldset_content(&self) -> bool {
|
||||||
|
|
|
@ -827,7 +827,7 @@ pub trait MatchMethods : TElement {
|
||||||
return StyleDifference::new(RestyleDamage::empty(), StyleChange::Unchanged)
|
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
|
// 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
|
// we're not switching from a "cares" to a "doesn't care" state
|
||||||
// or vice versa.
|
// or vice versa.
|
||||||
|
|
|
@ -42,6 +42,8 @@ pub enum PseudoElement {
|
||||||
Selection,
|
Selection,
|
||||||
// If/when :first-letter is added, update is_first_letter accordingly.
|
// 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
|
// If/when ::first-letter, ::first-line, or ::placeholder are added, adjust
|
||||||
// our property_restriction implementation to do property filtering for
|
// our property_restriction implementation to do property filtering for
|
||||||
// them. Also, make sure the UA sheet has the !important rules some of the
|
// them. Also, make sure the UA sheet has the !important rules some of the
|
||||||
|
@ -125,6 +127,12 @@ impl PseudoElement {
|
||||||
false
|
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.
|
/// Whether this pseudo-element is eagerly-cascaded.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_eager(&self) -> bool {
|
pub fn is_eager(&self) -> bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue