mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Style input-text pseudo with user-agent CSS
This commit is contained in:
parent
83f687a7be
commit
8500f3c8b8
5 changed files with 18 additions and 19 deletions
|
@ -21,6 +21,7 @@ pub enum PseudoElement {
|
|||
Selection,
|
||||
DetailsSummary,
|
||||
DetailsContent,
|
||||
ServoInputText,
|
||||
}
|
||||
|
||||
impl ToCss for PseudoElement {
|
||||
|
@ -32,6 +33,7 @@ impl ToCss for PseudoElement {
|
|||
Selection => "::selection",
|
||||
DetailsSummary => "::-servo-details-summary",
|
||||
DetailsContent => "::-servo-details-content",
|
||||
ServoInputText => "::-servo-input-text",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +56,8 @@ impl PseudoElement {
|
|||
PseudoElement::After |
|
||||
PseudoElement::Selection => PseudoElementCascadeType::Eager,
|
||||
PseudoElement::DetailsSummary => PseudoElementCascadeType::Lazy,
|
||||
PseudoElement::DetailsContent => PseudoElementCascadeType::Precomputed,
|
||||
PseudoElement::DetailsContent |
|
||||
PseudoElement::ServoInputText => PseudoElementCascadeType::Precomputed,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -201,6 +204,12 @@ impl SelectorImpl for ServoSelectorImpl {
|
|||
}
|
||||
DetailsContent
|
||||
},
|
||||
"-servo-input-text" => {
|
||||
if !context.in_user_agent_stylesheet {
|
||||
return Err(())
|
||||
}
|
||||
ServoInputText
|
||||
},
|
||||
_ => return Err(())
|
||||
};
|
||||
|
||||
|
@ -222,6 +231,7 @@ impl ServoSelectorImpl {
|
|||
fun(PseudoElement::DetailsContent);
|
||||
fun(PseudoElement::DetailsSummary);
|
||||
fun(PseudoElement::Selection);
|
||||
fun(PseudoElement::ServoInputText);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue