Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: third_party/WebKit/LayoutTests/cssom/serialize-attribute-selectors.html

Issue 2646493002: '*' is not a valid attribute selector (Closed)
Patch Set: Adjust serialization test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Attribute selector serialization</title> 2 <title>Attribute selector serialization</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <style id="teststyles"> 5 <style id="teststyles">
6 </style> 6 </style>
7 <script> 7 <script>
8 var escaped_ns_rule = "@namespace ns\\:odd url(ns);"; 8 var escaped_ns_rule = "@namespace ns\\:odd url(ns);";
9 9
10 function assert_selector_serializes_to(source, expected_result) { 10 function assert_selector_serializes_to(source, expected_result) {
11 var style_element = document.getElementById("teststyles"); 11 var style_element = document.getElementById("teststyles");
12 style_element.firstChild.data = source + "{ font-size: 1em; }"; 12 style_element.firstChild.data = source + "{ font-size: 1em; }";
13 var sheet = style_element.sheet; 13 var sheet = style_element.sheet;
14 assert_equals(sheet.cssRules[sheet.cssRules.length - 1].selectorText, ex pected_result); 14 assert_equals(sheet.cssRules[sheet.cssRules.length - 1].selectorText, ex pected_result);
15 } 15 }
16 test(function() { 16 test(function() {
17 assert_selector_serializes_to("[ns\\:foo]", "[ns\\:foo]"); 17 assert_selector_serializes_to("[ns\\:foo]", "[ns\\:foo]");
18 }, document.title+", escaped character in attribute name"); 18 }, document.title+", escaped character in attribute name");
19 test(function() { 19 test(function() {
20 assert_selector_serializes_to("[\\30zonk]", "[\\30 zonk]"); 20 assert_selector_serializes_to("[\\30zonk]", "[\\30 zonk]");
21 }, document.title+", escaped character as code point in attribute name"); 21 }, document.title+", escaped character as code point in attribute name");
22 test(function() { 22 test(function() {
23 assert_selector_serializes_to("[\\*]", "[\\*]"); 23 assert_selector_serializes_to("[\\@]", "[\\@]");
24 }, document.title+", escaped character (*) in attribute"); 24 }, document.title+", escaped character (@) in attribute name");
25 test(function() { 25 test(function() {
26 assert_selector_serializes_to("[*|ns\\:foo]", "[*|ns\\:foo]"); 26 assert_selector_serializes_to("[*|ns\\:foo]", "[*|ns\\:foo]");
27 }, document.title+", escaped character in attribute name with any namespace" ); 27 }, document.title+", escaped character in attribute name with any namespace" );
28 test(function() { 28 test(function() {
29 assert_selector_serializes_to(escaped_ns_rule + "[ns\\:odd|foo]", "[ns\\ :odd|foo]"); 29 assert_selector_serializes_to(escaped_ns_rule + "[ns\\:odd|foo]", "[ns\\ :odd|foo]");
30 }, document.title+", escaped character in attribute prefix"); 30 }, document.title+", escaped character in attribute prefix");
31 test(function() { 31 test(function() {
32 assert_selector_serializes_to(escaped_ns_rule + "[ns\\:odd|odd\\:name]", "[ns\\:odd|odd\\:name]"); 32 assert_selector_serializes_to(escaped_ns_rule + "[ns\\:odd|odd\\:name]", "[ns\\:odd|odd\\:name]");
33 }, document.title+", escaped character in both attribute prefix and name"); 33 }, document.title+", escaped character in both attribute prefix and name");
34 </script> 34 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698