Title: [134196] trunk
Revision
134196
Author
[email protected]
Date
2012-11-12 01:15:13 -0800 (Mon, 12 Nov 2012)

Log Message

Don't update style when attaching in HTMLMeterElement
https://bugs.webkit.org/show_bug.cgi?id=101714

Reviewed by Hajime Morita.

Source/WebCore:

HTMLMeterElement was updating style when it's being attached. However, updating style when attaching
can cause style-update prevention. The similar thing has already happened in Bug 100507.

Since we have already set the default value in creating ShadowDOM subtree, we don't need to update style actually.

Test: fast/dom/HTMLMeterElement/meter-bar-set-value.html

* html/HTMLMeterElement.cpp:
* html/HTMLMeterElement.h:
(HTMLMeterElement): Removed attach(). We don't need it.

LayoutTests:

* fast/dom/HTMLMeterElement/meter-bar-set-value-expected.html: Added.
* fast/dom/HTMLMeterElement/meter-bar-set-value.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (134195 => 134196)


--- trunk/LayoutTests/ChangeLog	2012-11-12 08:37:32 UTC (rev 134195)
+++ trunk/LayoutTests/ChangeLog	2012-11-12 09:15:13 UTC (rev 134196)
@@ -1,3 +1,13 @@
+2012-11-12  Shinya Kawanaka  <[email protected]>
+
+        Don't update style when attaching in HTMLMeterElement
+        https://bugs.webkit.org/show_bug.cgi?id=101714
+
+        Reviewed by Hajime Morita.
+
+        * fast/dom/HTMLMeterElement/meter-bar-set-value-expected.html: Added.
+        * fast/dom/HTMLMeterElement/meter-bar-set-value.html: Added.
+
 2012-11-11  Michael Pruett  <[email protected]>
 
         Fix assertion failure in JSObject::tryGetIndexQuickly()

Added: trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-bar-set-value-expected.html (0 => 134196)


--- trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-bar-set-value-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-bar-set-value-expected.html	2012-11-12 09:15:13 UTC (rev 134196)
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+<head>
+<style>
+meter {
+    -webkit-appearance: none;
+    border: solid red;
+}
+</style>
+</head>
+<body>
+    <meter max="100" value="50"></progress>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-bar-set-value.html (0 => 134196)


--- trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-bar-set-value.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-bar-set-value.html	2012-11-12 09:15:13 UTC (rev 134196)
@@ -0,0 +1,24 @@
+<!doctype html>
+<html>
+<head>
+<style>
+meter {
+    -webkit-appearance: none;
+}
+</style>
+<script type="text/_javascript_">
+function runTest() {
+    bad = document.createElement("meter");
+    bad.id="bad";
+    bad.max=100;
+    bad.setAttribute("value",10);
+    bad.setAttribute("style", "border:solid red");
+    document.getElementsByTagName('body')[0].appendChild(bad);
+    document.body.offsetLeft;
+    document.getElementById('bad').value = 50;
+}
+</script>
+</head>
+<body _onload_="runTest();">
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (134195 => 134196)


--- trunk/Source/WebCore/ChangeLog	2012-11-12 08:37:32 UTC (rev 134195)
+++ trunk/Source/WebCore/ChangeLog	2012-11-12 09:15:13 UTC (rev 134196)
@@ -1,3 +1,21 @@
+2012-11-12  Shinya Kawanaka  <[email protected]>
+
+        Don't update style when attaching in HTMLMeterElement
+        https://bugs.webkit.org/show_bug.cgi?id=101714
+
+        Reviewed by Hajime Morita.
+
+        HTMLMeterElement was updating style when it's being attached. However, updating style when attaching
+        can cause style-update prevention. The similar thing has already happened in Bug 100507.
+
+        Since we have already set the default value in creating ShadowDOM subtree, we don't need to update style actually.
+
+        Test: fast/dom/HTMLMeterElement/meter-bar-set-value.html
+
+        * html/HTMLMeterElement.cpp:
+        * html/HTMLMeterElement.h:
+        (HTMLMeterElement): Removed attach(). We don't need it.
+
 2012-11-09  Ryosuke Niwa  <[email protected]>
 
         Multiple Layout Tests (e.g. fast/repaint/japanese-rl-selection-clear.html) is failing after r133840.

Modified: trunk/Source/WebCore/html/HTMLMeterElement.cpp (134195 => 134196)


--- trunk/Source/WebCore/html/HTMLMeterElement.cpp	2012-11-12 08:37:32 UTC (rev 134195)
+++ trunk/Source/WebCore/html/HTMLMeterElement.cpp	2012-11-12 09:15:13 UTC (rev 134196)
@@ -85,12 +85,6 @@
         LabelableElement::parseAttribute(attribute);
 }
 
-void HTMLMeterElement::attach()
-{
-    m_value->setWidthPercentage(valueRatio()*100);
-    LabelableElement::attach();
-}
-
 double HTMLMeterElement::min() const
 {
     return parseToDoubleForNumberType(getAttribute(minAttr), 0);

Modified: trunk/Source/WebCore/html/HTMLMeterElement.h (134195 => 134196)


--- trunk/Source/WebCore/html/HTMLMeterElement.h	2012-11-12 08:37:32 UTC (rev 134195)
+++ trunk/Source/WebCore/html/HTMLMeterElement.h	2012-11-12 09:15:13 UTC (rev 134196)
@@ -81,8 +81,6 @@
     virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
     virtual void parseAttribute(const Attribute&) OVERRIDE;
 
-    virtual void attach() OVERRIDE;
-
     void didElementStateChange();
     void createShadowSubtree();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to