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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/setting-style-attribute-update-inline-style.html

Issue 1384973004: Forward assigning to style on HTMLElement, SVGElement and CSSStyleRule to style.cssText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: third_party/WebKit/LayoutTests/fast/css/setting-style-attribute-update-inline-style.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/setting-style-attribute-update-inline-style.html b/third_party/WebKit/LayoutTests/fast/css/setting-style-attribute-update-inline-style.html
new file mode 100644
index 0000000000000000000000000000000000000000..df422533fa212ae16c077b0558fb224aaa184e33
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/setting-style-attribute-update-inline-style.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>
+body {
+ font-size: 16px;
+}
+</style>
+
+<div id="div0" style="background-color: red"></div>
+<div id="div1" style="background-color: red"></div>
+<div id="div2" style="background-color: red"></div>
+<div id="div3"></div>
+<svg id="svg0" style="background-color: red"></svg>
+
+<script>
+div0.style = '';
+div1.style = 'color:green';
+div2.style = 'color:green; font-size:30px';
+div3.style = 'color:green';
+
+document.styleSheets[0].cssRules[0].style = 'font-size:30px';
+
+svg0.style = '';
+
+test(function() {
+ assert_equals(div0.style.backgroundColor, "");
+
+ assert_equals(div1.style.backgroundColor, "");
+ assert_equals(div1.style.color, "green");
+
+ assert_equals(div2.style.backgroundColor, "");
+ assert_equals(div2.style.color, "green");
+ assert_equals(div2.style.fontSize, "30px");
+
+ assert_equals(div3.style.color, "green");
+
+}, 'Assigning to HTMLElement.style updates the style declaration');
+
+test(function() {
+ assert_equals(svg0.style.backgroundColor, "");
+}, 'Assigning to SVGElement.style updates the style declaration');
+
+test(function() {
+ assert_equals(document.styleSheets[0].cssRules[0].style.cssText, "font-size: 30px;");
+}, 'Assigning to CSSStyleRule.style updates the style declaration');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698