mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #9586 - notriddle:details_ui, r=SimonSapin
Details ui Requires a patch to rust-selectors, and doesn't currently recalculate the styles correctly (which is needed to make actual toggling work correctly). Still trying to figure out what it takes to get style recalc to do what this needs. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9586) <!-- Reviewable:end -->
This commit is contained in:
commit
090da52913
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]
|
||||
|
|
|
@ -164,7 +164,6 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
|
|||
if !stylesheet.is_effective_for_device(device) {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut rules_source_order = self.rules_source_order;
|
||||
|
||||
// Take apart the StyleRule into individual Rules and insert
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue