mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Get the fundamentals of the HTMLDetailsElement rendering stuff working.
Still need to implement the style invalidation. Part of #9395
This commit is contained in:
parent
e551ea7322
commit
9d9c5398a8
13 changed files with 294 additions and 27 deletions
|
@ -26,6 +26,8 @@ pub trait SelectorImplExt : SelectorImpl + Sized {
|
|||
pub enum PseudoElement {
|
||||
Before,
|
||||
After,
|
||||
DetailsSummary,
|
||||
DetailsContent,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, HeapSizeOf, Hash)]
|
||||
|
@ -97,12 +99,22 @@ impl SelectorImpl for ServoSelectorImpl {
|
|||
Ok(pseudo_class)
|
||||
}
|
||||
|
||||
fn parse_pseudo_element(_context: &ParserContext,
|
||||
fn parse_pseudo_element(context: &ParserContext,
|
||||
name: &str) -> Result<PseudoElement, ()> {
|
||||
use self::PseudoElement::*;
|
||||
let pseudo_element = match_ignore_ascii_case! { name,
|
||||
"before" => Before,
|
||||
"after" => After,
|
||||
"-servo-details-summary" => if context.in_user_agent_stylesheet {
|
||||
DetailsSummary
|
||||
} else {
|
||||
return Err(())
|
||||
},
|
||||
"-servo-details-content" => if context.in_user_agent_stylesheet {
|
||||
DetailsContent
|
||||
} else {
|
||||
return Err(())
|
||||
},
|
||||
_ => return Err(())
|
||||
};
|
||||
|
||||
|
@ -122,6 +134,8 @@ impl SelectorImplExt for ServoSelectorImpl {
|
|||
where F: FnMut(PseudoElement) {
|
||||
fun(PseudoElement::Before);
|
||||
fun(PseudoElement::After);
|
||||
fun(PseudoElement::DetailsContent);
|
||||
fun(PseudoElement::DetailsSummary);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue