aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/element.rs32
1 files changed, 17 insertions, 15 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 0dc3db0ebe5..d7f3b89ba2f 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -87,8 +87,9 @@ use ref_filter_map::ref_filter_map;
use script_layout_interface::message::ReflowQueryType;
use script_thread::Runnable;
use selectors::attr::{AttrSelectorOperation, NamespaceConstraint};
-use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode, matches_selector_list};
+use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode};
use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS};
+use selectors::matching::{RelevantLinkStatus, matches_selector_list};
use servo_atoms::Atom;
use std::ascii::AsciiExt;
use std::borrow::Cow;
@@ -2429,6 +2430,7 @@ impl<'a> ::selectors::Element for Root<Element> {
fn match_non_ts_pseudo_class<F>(&self,
pseudo_class: &NonTSPseudoClass,
_: &mut MatchingContext,
+ _: &RelevantLinkStatus,
_: &mut F)
-> bool
where F: FnMut(&Self, ElementSelectorFlags),
@@ -2478,6 +2480,20 @@ impl<'a> ::selectors::Element for Root<Element> {
}
}
+ fn is_link(&self) -> bool {
+ // FIXME: This is HTML only.
+ let node = self.upcast::<Node>();
+ match node.type_id() {
+ // https://html.spec.whatwg.org/multipage/#selector-link
+ NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) |
+ NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAreaElement)) |
+ NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLinkElement)) => {
+ self.has_attribute(&local_name!("href"))
+ },
+ _ => false,
+ }
+ }
+
fn get_id(&self) -> Option<Atom> {
self.id_attribute.borrow().clone()
}
@@ -2592,20 +2608,6 @@ impl Element {
}
}
- fn is_link(&self) -> bool {
- // FIXME: This is HTML only.
- let node = self.upcast::<Node>();
- match node.type_id() {
- // https://html.spec.whatwg.org/multipage/#selector-link
- NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) |
- NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAreaElement)) |
- NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLinkElement)) => {
- self.has_attribute(&local_name!("href"))
- },
- _ => false,
- }
- }
-
/// Please call this method *only* for real click events
///
/// https://html.spec.whatwg.org/multipage/#run-authentic-click-activation-steps