Bug 1369187: style: Add first-line and first-letter to the set of eager pseudo styles. r=bholley

MozReview-Commit-ID: DmpX0nA2DOw
This commit is contained in:
Emilio Cobos Álvarez 2017-05-31 16:59:43 +02:00
parent fe74e70a2d
commit 509a450cff
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 5 additions and 3 deletions

View file

@ -176,12 +176,14 @@ pub enum PseudoElement {
/// The number of eager pseudo-elements.
pub const EAGER_PSEUDO_COUNT: usize = 2;
pub const EAGER_PSEUDO_COUNT: usize = 4;
/// The list of eager pseudos.
pub const EAGER_PSEUDOS: [PseudoElement; EAGER_PSEUDO_COUNT] = [
PseudoElement::Before,
PseudoElement::After,
PseudoElement::FirstLine,
PseudoElement::FirstLetter,
];
impl PseudoElement {
@ -458,7 +460,7 @@ impl PseudoElement {
#[inline]
pub fn is_eager(&self) -> bool {
matches!(*self,
PseudoElement::Before | PseudoElement::After)
PseudoElement::Before | PseudoElement::After | PseudoElement::FirstLine | PseudoElement::FirstLetter)
}
/// Gets the flags associated to this pseudo-element, or 0 if it's an

View file

@ -11,7 +11,7 @@ pub enum PseudoElement {
% endfor
}
<% EAGER_PSEUDOS = ["Before", "After"] %>
<% EAGER_PSEUDOS = ["Before", "After", "FirstLine", "FirstLetter"] %>
/// The number of eager pseudo-elements.
pub const EAGER_PSEUDO_COUNT: usize = ${len(EAGER_PSEUDOS)};