Title: [141228] trunk
Revision
141228
Author
[email protected]
Date
2013-01-29 23:28:38 -0800 (Tue, 29 Jan 2013)

Log Message

Renderer is recreated unexpectedly after detach in HTMLInputElement
https://bugs.webkit.org/show_bug.cgi?id=108150

Reviewed by Kent Tamura.

Source/WebCore:

After r140659, destoryShadowSubtree() may update style in removeChild(). It causes
attaching HTMLInputElement before creating shadowsubtree in HTMLInputElement::updateType().

For safe, destroyShadowSubtree() should be done before detach().

Test: fast/forms/number/number-change-type-on-focus-2.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):

LayoutTests:

* fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2.html: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (141227 => 141228)


--- trunk/LayoutTests/ChangeLog	2013-01-30 06:31:08 UTC (rev 141227)
+++ trunk/LayoutTests/ChangeLog	2013-01-30 07:28:38 UTC (rev 141228)
@@ -1,3 +1,13 @@
+2013-01-29  Shinya Kawanaka  <[email protected]>
+
+        Renderer is recreated unexpectedly after detach in HTMLInputElement
+        https://bugs.webkit.org/show_bug.cgi?id=108150
+
+        Reviewed by Kent Tamura.
+
+        * fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2.html: Added.
+        * fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2-expected.txt: Added.
+
 2013-01-29  Gyuyoung Kim  <[email protected]>
 
         Unreviewed. EFL Gradening.

Added: trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2-expected.txt (0 => 141228)


--- trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2-expected.txt	2013-01-30 07:28:38 UTC (rev 141228)
@@ -0,0 +1,7 @@
+ASSERT should not be triggered when type is changed in focus event.
+
+PASS unless crash.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2.html (0 => 141228)


--- trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-change-type-on-focus-2.html	2013-01-30 07:28:38 UTC (rev 141228)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html><body contenteditable="true">
+<script src=""
+
+<p>ASSERT should not be triggered when type is changed in focus event.</p>
+
+<div id="container">
+    <input id="input" type="time" style="margin-top: 1000px;">
+</div>
+<pre id="console"></pre>
+
+<script>
+jsTestIsAsync = true;
+
+input.addEventListener('focus', function() {
+    input.type = 'text;'
+});
+
+setTimeout(function() {
+    eventSender.keyDown('\t');
+    eventSender.keyDown('\t');
+    setTimeout(function() {
+        container.innerHTML = 'PASS unless crash.';
+        finishJSTest();
+    }, 0);
+}, 0);
+</script>
+<script src=""
+</body></html>

Modified: trunk/Source/WebCore/ChangeLog (141227 => 141228)


--- trunk/Source/WebCore/ChangeLog	2013-01-30 06:31:08 UTC (rev 141227)
+++ trunk/Source/WebCore/ChangeLog	2013-01-30 07:28:38 UTC (rev 141228)
@@ -1,3 +1,20 @@
+2013-01-29  Shinya Kawanaka  <[email protected]>
+
+        Renderer is recreated unexpectedly after detach in HTMLInputElement
+        https://bugs.webkit.org/show_bug.cgi?id=108150
+
+        Reviewed by Kent Tamura.
+
+        After r140659, destoryShadowSubtree() may update style in removeChild(). It causes
+        attaching HTMLInputElement before creating shadowsubtree in HTMLInputElement::updateType().
+
+        For safe, destroyShadowSubtree() should be done before detach().
+
+        Test: fast/forms/number/number-change-type-on-focus-2.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::updateType):
+
 2013-01-29  James Robinson  <[email protected]>
 
         Scrollbar and scroll corner composited layers positioned incorrectly

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (141227 => 141228)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2013-01-30 06:31:08 UTC (rev 141227)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2013-01-30 07:28:38 UTC (rev 141228)
@@ -476,15 +476,16 @@
 
     removeFromRadioButtonGroup();
 
-    bool wasAttached = attached();
-    if (wasAttached)
-        detach();
-
     bool didStoreValue = m_inputType->storesValueSeparateFromAttribute();
     bool neededSuspensionCallback = needsSuspensionCallback();
     bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttributes();
 
     m_inputType->destroyShadowSubtree();
+
+    bool wasAttached = attached();
+    if (wasAttached)
+        detach();
+
     m_inputType = newType.release();
     m_inputType->createShadowSubtree();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to