mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +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.
|
/// 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.
|
/// The list of eager pseudos.
|
||||||
pub const EAGER_PSEUDOS: [PseudoElement; EAGER_PSEUDO_COUNT] = [
|
pub const EAGER_PSEUDOS: [PseudoElement; EAGER_PSEUDO_COUNT] = [
|
||||||
PseudoElement::Before,
|
PseudoElement::Before,
|
||||||
PseudoElement::After,
|
PseudoElement::After,
|
||||||
|
PseudoElement::FirstLine,
|
||||||
|
PseudoElement::FirstLetter,
|
||||||
];
|
];
|
||||||
|
|
||||||
impl PseudoElement {
|
impl PseudoElement {
|
||||||
|
@ -458,7 +460,7 @@ impl PseudoElement {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_eager(&self) -> bool {
|
pub fn is_eager(&self) -> bool {
|
||||||
matches!(*self,
|
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
|
/// Gets the flags associated to this pseudo-element, or 0 if it's an
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub enum PseudoElement {
|
||||||
% endfor
|
% endfor
|
||||||
}
|
}
|
||||||
|
|
||||||
<% EAGER_PSEUDOS = ["Before", "After"] %>
|
<% EAGER_PSEUDOS = ["Before", "After", "FirstLine", "FirstLetter"] %>
|
||||||
|
|
||||||
/// The number of eager pseudo-elements.
|
/// The number of eager pseudo-elements.
|
||||||
pub const EAGER_PSEUDO_COUNT: usize = ${len(EAGER_PSEUDOS)};
|
pub const EAGER_PSEUDO_COUNT: usize = ${len(EAGER_PSEUDOS)};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue