mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Issue 7720: Add target selector and update when scrolling to fragment
This commit is contained in:
parent
7807895d58
commit
04f5369577
10 changed files with 105 additions and 59 deletions
|
@ -2324,7 +2324,8 @@ impl<'a> ::selectors::Element for Root<Element> {
|
|||
NonTSPseudoClass::Checked |
|
||||
NonTSPseudoClass::Indeterminate |
|
||||
NonTSPseudoClass::ReadWrite |
|
||||
NonTSPseudoClass::PlaceholderShown =>
|
||||
NonTSPseudoClass::PlaceholderShown |
|
||||
NonTSPseudoClass::Target =>
|
||||
Element::state(self).contains(pseudo_class.state_flag()),
|
||||
}
|
||||
}
|
||||
|
@ -2586,6 +2587,14 @@ impl Element {
|
|||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn target_state(&self) -> bool {
|
||||
self.state.get().contains(IN_TARGET_STATE)
|
||||
}
|
||||
|
||||
pub fn set_target_state(&self, value: bool) {
|
||||
self.set_state(IN_TARGET_STATE, value)
|
||||
}
|
||||
}
|
||||
|
||||
impl Element {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue