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

Unified Diff: LayoutTests/fast/css/style-sharing-with-descendant-selectors.html

Issue 29633003: Avoid style sharing with mis-matched descendant selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
Index: LayoutTests/fast/css/style-sharing-with-descendant-selectors.html
diff --git a/LayoutTests/fast/css/style-sharing-with-descendant-selectors.html b/LayoutTests/fast/css/style-sharing-with-descendant-selectors.html
new file mode 100644
index 0000000000000000000000000000000000000000..01b0ff9872772b5893d34cf15fd2e10f80835069
--- /dev/null
+++ b/LayoutTests/fast/css/style-sharing-with-descendant-selectors.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<style>
+div { color: green; }
+div.red span { color: red; }
+</style>
+<script>
+onload = function() {
+ var className = 'red';
+ div1.classList.add(className);
+ div1.classList.remove(className);
+ div2.classList.add(className);
+}
+</script>
+<body>
+<p>This test ensures we don't improperly share styles for elements that match different descendant selectors.</p>
+<div id="div1"><b><span>This line should be green.</span></b></div>
+<div id="div2"><b><span>This line should be red.</span></b></div>

Powered by Google App Engine
This is Rietveld 408576698