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

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

Issue 2645563002: Serialize type and attribute selectors as identifiers (Closed)
Patch Set: weird -> escaped; add "serialize character as code point" 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/cssom/serialize-namespaced-type-selectors.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/cssom/serialize-attribute-selectors.html
diff --git a/third_party/WebKit/LayoutTests/cssom/serialize-attribute-selectors.html b/third_party/WebKit/LayoutTests/cssom/serialize-attribute-selectors.html
new file mode 100644
index 0000000000000000000000000000000000000000..34aaba20b65cf91895e8c82a51a8cd605420c95b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/cssom/serialize-attribute-selectors.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Attribute selector serialization</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style id="teststyles">
+</style>
+<script>
+ var escaped_ns_rule = "@namespace ns\\:odd url(ns);";
+
+ function assert_selector_serializes_to(source, expected_result) {
+ var style_element = document.getElementById("teststyles");
+ style_element.firstChild.data = source + "{ font-size: 1em; }";
+ var sheet = style_element.sheet;
+ assert_equals(sheet.cssRules[sheet.cssRules.length - 1].selectorText, expected_result);
+ }
+ test(function() {
+ assert_selector_serializes_to("[ns\\:foo]", "[ns\\:foo]");
+ }, document.title+", escaped character in attribute name");
+ test(function() {
+ assert_selector_serializes_to("[\\30zonk]", "[\\30 zonk]");
+ }, document.title+", escaped character as code point in attribute name");
+ test(function() {
+ assert_selector_serializes_to("[\\*]", "[\\*]");
+ }, document.title+", escaped character (*) in attribute");
+ test(function() {
+ assert_selector_serializes_to("[*|ns\\:foo]", "[*|ns\\:foo]");
+ }, document.title+", escaped character in attribute name with any namespace");
+ test(function() {
+ assert_selector_serializes_to(escaped_ns_rule + "[ns\\:odd|foo]", "[ns\\:odd|foo]");
+ }, document.title+", escaped character in attribute prefix");
+ test(function() {
+ assert_selector_serializes_to(escaped_ns_rule + "[ns\\:odd|odd\\:name]", "[ns\\:odd|odd\\:name]");
+ }, document.title+", escaped character in both attribute prefix and name");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/cssom/serialize-namespaced-type-selectors.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698