Title: [117956] trunk
- Revision
- 117956
- Author
- kl...@webkit.org
- Date
- 2012-05-22 05:06:24 -0700 (Tue, 22 May 2012)
Log Message
DOM Attr objects pointing to "style" attribute should force reification when read.
<http://webkit.org/b/87076>
Reviewed by Antti Koivisto.
Source/WebCore:
Make sure that the "style" attribute is reserialized as needed when it gets retrieved
through an Attr object. This fixes a bug where updating an element's inline style
through the CSSOM API, and then retrieving the style attribute through an Attr node
that was previously created by element.getAttributeNode() would return the old style
attribute value.
Test: fast/dom/attr-style-too-lazy.html
* dom/Attr.cpp:
(WebCore::Attr::value):
LayoutTests:
* fast/dom/attr-style-too-lazy-expected.txt: Added.
* fast/dom/attr-style-too-lazy.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (117955 => 117956)
--- trunk/LayoutTests/ChangeLog 2012-05-22 11:59:09 UTC (rev 117955)
+++ trunk/LayoutTests/ChangeLog 2012-05-22 12:06:24 UTC (rev 117956)
@@ -1,3 +1,13 @@
+2012-05-22 Andreas Kling <kl...@webkit.org>
+
+ DOM Attr objects pointing to "style" attribute should force reification when read.
+ <http://webkit.org/b/87076>
+
+ Reviewed by Antti Koivisto.
+
+ * fast/dom/attr-style-too-lazy-expected.txt: Added.
+ * fast/dom/attr-style-too-lazy.html: Added.
+
2012-05-22 Dominik Röttsches <dominik.rottsc...@intel.com>
[EFL][DRT] Structure test_expectations.txt into meaningful sections
Added: trunk/LayoutTests/fast/dom/attr-style-too-lazy-expected.txt (0 => 117956)
--- trunk/LayoutTests/fast/dom/attr-style-too-lazy-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/dom/attr-style-too-lazy-expected.txt 2012-05-22 12:06:24 UTC (rev 117956)
@@ -0,0 +1,11 @@
+This test verifies that acquiring the 'style' attribute via a DOM Attr node still works correctly after the inline style has been modified through the CSSOM API.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS styleAttr.value is 'background-color: white; '
+PASS styleAttr.value is 'background-color: green; '
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/dom/attr-style-too-lazy.html (0 => 117956)
--- trunk/LayoutTests/fast/dom/attr-style-too-lazy.html (rev 0)
+++ trunk/LayoutTests/fast/dom/attr-style-too-lazy.html 2012-05-22 12:06:24 UTC (rev 117956)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("This test verifies that acquiring the 'style' attribute via a DOM Attr node still works correctly after the inline style has been modified through the CSSOM API.");
+
+var e = document.createElement("span");
+e.setAttribute("style", "background-color: white; ");
+var styleAttr = e.getAttributeNode("style");
+shouldBe("styleAttr.value", "'background-color: white; '");
+e.style.backgroundColor = 'green';
+shouldBe("styleAttr.value", "'background-color: green; '");
+
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (117955 => 117956)
--- trunk/Source/WebCore/ChangeLog 2012-05-22 11:59:09 UTC (rev 117955)
+++ trunk/Source/WebCore/ChangeLog 2012-05-22 12:06:24 UTC (rev 117956)
@@ -1,3 +1,21 @@
+2012-05-22 Andreas Kling <kl...@webkit.org>
+
+ DOM Attr objects pointing to "style" attribute should force reification when read.
+ <http://webkit.org/b/87076>
+
+ Reviewed by Antti Koivisto.
+
+ Make sure that the "style" attribute is reserialized as needed when it gets retrieved
+ through an Attr object. This fixes a bug where updating an element's inline style
+ through the CSSOM API, and then retrieving the style attribute through an Attr node
+ that was previously created by element.getAttributeNode() would return the old style
+ attribute value.
+
+ Test: fast/dom/attr-style-too-lazy.html
+
+ * dom/Attr.cpp:
+ (WebCore::Attr::value):
+
2012-05-22 Ilya Tikhonovsky <loi...@chromium.org>
Web Inspector: HeapProfiler: upstream retainedSize calculation.
Modified: trunk/Source/WebCore/dom/Attr.cpp (117955 => 117956)
--- trunk/Source/WebCore/dom/Attr.cpp 2012-05-22 11:59:09 UTC (rev 117955)
+++ trunk/Source/WebCore/dom/Attr.cpp 2012-05-22 12:06:24 UTC (rev 117956)
@@ -203,7 +203,7 @@
const AtomicString& Attr::value() const
{
if (m_element)
- return m_element->getAttributeItem(qualifiedName())->value();
+ return m_element->getAttribute(qualifiedName());
return m_standaloneValue;
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes