aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-24 19:53:48 -0500
committerGitHub <noreply@github.com>2017-05-24 19:53:48 -0500
commit1f323f8848e47b01779de5145dd21d0f74ed16ca (patch)
treee6255957ec4d4055f033d7f039cf1c6adc3563ad /components/script/dom
parente457d22f81ac0f45c4dc96867162f276de7bd291 (diff)
parentf12af6c8d606f63fbba32e1dc3580f38604da24a (diff)
downloadservo-1f323f8848e47b01779de5145dd21d0f74ed16ca.tar.gz
servo-1f323f8848e47b01779de5145dd21d0f74ed16ca.zip
Auto merge of #17032 - jryans:stylo-visited, r=emilio
Stylo: visited pseudo-class support Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1328509 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17032) <!-- Reviewable:end -->
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