Auto merge of #16915 - servo:attr-selectors, r=nox,emilio

Shrink selectors::Component, implement attr selector (in)case-sensitivity

* https://bugzilla.mozilla.org/show_bug.cgi?id=1364148
* https://bugzilla.mozilla.org/show_bug.cgi?id=1364162
* https://bugzilla.mozilla.org/show_bug.cgi?id=1363531
* Fixes #3322

<!-- 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/16915)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-18 18:45:20 -05:00 committed by GitHub
commit 640b16634f
30 changed files with 963 additions and 841 deletions

View file

@ -6,6 +6,7 @@ use cssparser::{self, Parser as CssParser, SourcePosition, SourceLocation};
use html5ever::{Namespace as NsAtom};
use media_queries::CSSErrorReporterTest;
use parking_lot::RwLock;
use selectors::attr::*;
use selectors::parser::*;
use servo_atoms::Atom;
use servo_url::ServoUrl;
@ -97,14 +98,14 @@ fn test_parse_stylesheet() {
name: local_name!("input"),
lower_name: local_name!("input"),
}),
Component::AttrEqual(AttrSelector {
name: local_name!("type"),
lower_name: local_name!("type"),
namespace: NamespaceConstraint::Specific(Namespace {
prefix: None,
url: ns!()
}),
}, "hidden".to_owned(), CaseSensitivity::CaseInsensitive)
Component::AttributeInNoNamespace {
local_name: local_name!("type"),
local_name_lower: local_name!("type"),
operator: AttrSelectorOperator::Equal,
value: "hidden".to_owned(),
case_sensitivity: ParsedCaseSensitivity::AsciiCaseInsensitive,
never_matches: false,
}
]),
(0 << 20) + (1 << 10) + (1 << 0)
),

View file

@ -1,5 +0,0 @@
[css3-selectors-lang-024.htm]
type: testharness
[A lang|= value will match a lang attribute value regardless of case differences.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[css3-selectors-lang-035.htm]
type: testharness
[A lang|= value will match a lang attribute value regardless of case differences in the script tag.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[css3-selectors-lang-044.htm]
type: testharness
[A lang= value will match a lang attribute value regardless of case differences.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[css3-selectors-lang-055.htm]
type: testharness
[A lang= value will match a lang attribute value regardless of case differences in the script tag.]
expected: FAIL

View file

@ -1,3 +0,0 @@
[li-type-supported-xhtml.xhtml]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[li-type-supported.html]
type: reftest
expected: FAIL