mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement cannot navigate
This commit is contained in:
parent
9d70f51356
commit
cb86d451e6
4 changed files with 26 additions and 12 deletions
|
@ -3235,6 +3235,18 @@ impl Element {
|
|||
let root = node.GetRootNode();
|
||||
root.is::<Document>()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#cannot-navigate
|
||||
pub fn cannot_navigate(&self) -> bool {
|
||||
let document = document_from_node(self);
|
||||
|
||||
// Step 1.
|
||||
!document.is_fully_active() ||
|
||||
(
|
||||
// Step 2.
|
||||
!self.is::<HTMLAnchorElement>() && !self.is_connected()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl Element {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue