mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
fe74e70a2d
commit
509a450cff
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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)};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue