Title: [205861] trunk
Revision
205861
Author
[email protected]
Date
2016-09-13 10:05:39 -0700 (Tue, 13 Sep 2016)

Log Message

Input type object and the associated render can go out of sync.
https://bugs.webkit.org/show_bug.cgi?id=161871
<rdar://problem/28178094>

Reviewed by Antti Koivisto.

Source/WebCore:

Bail out when we've got a mismatched renderer.

Test: fast/forms/assert-on-input-type-change.html

* html/ImageInputType.cpp:
(WebCore::ImageInputType::altAttributeChanged):

LayoutTests:

* fast/forms/assert-on-input-type-change-expected.txt: Added.
* fast/forms/assert-on-input-type-change.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (205860 => 205861)


--- trunk/LayoutTests/ChangeLog	2016-09-13 16:13:38 UTC (rev 205860)
+++ trunk/LayoutTests/ChangeLog	2016-09-13 17:05:39 UTC (rev 205861)
@@ -1,3 +1,14 @@
+2016-09-12  Zalan Bujtas  <[email protected]>
+
+        Input type object and the associated render can go out of sync.
+        https://bugs.webkit.org/show_bug.cgi?id=161871
+        <rdar://problem/28178094>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/forms/assert-on-input-type-change-expected.txt: Added.
+        * fast/forms/assert-on-input-type-change.html: Added.
+
 2016-09-13  Chris Dumez  <[email protected]>
 
         Drop support for <isindex>

Added: trunk/LayoutTests/fast/forms/assert-on-input-type-change-expected.txt (0 => 205861)


--- trunk/LayoutTests/fast/forms/assert-on-input-type-change-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/assert-on-input-type-change-expected.txt	2016-09-13 17:05:39 UTC (rev 205861)
@@ -0,0 +1 @@
+PASS if no assert in debug. 

Added: trunk/LayoutTests/fast/forms/assert-on-input-type-change.html (0 => 205861)


--- trunk/LayoutTests/fast/forms/assert-on-input-type-change.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/assert-on-input-type-change.html	2016-09-13 17:05:39 UTC (rev 205861)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we manage input type change properly.</title>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+function runTest() {
+    var item = document.getElementById("foobar");
+    item.type = 'image';
+    item.alt="foobar";
+}
+</script>
+<body _onload_="runTest();">
+PASS if no assert in debug.
+<input id=foobar type="text">
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (205860 => 205861)


--- trunk/Source/WebCore/ChangeLog	2016-09-13 16:13:38 UTC (rev 205860)
+++ trunk/Source/WebCore/ChangeLog	2016-09-13 17:05:39 UTC (rev 205861)
@@ -1,3 +1,18 @@
+2016-09-12  Zalan Bujtas  <[email protected]>
+
+        Input type object and the associated render can go out of sync.
+        https://bugs.webkit.org/show_bug.cgi?id=161871
+        <rdar://problem/28178094>
+
+        Reviewed by Antti Koivisto.
+
+        Bail out when we've got a mismatched renderer.
+
+        Test: fast/forms/assert-on-input-type-change.html
+
+        * html/ImageInputType.cpp:
+        (WebCore::ImageInputType::altAttributeChanged):
+
 2016-09-13  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Get rid of DataObjectGtk::forClipboard and cleanup pasteboard code

Modified: trunk/Source/WebCore/html/ImageInputType.cpp (205860 => 205861)


--- trunk/Source/WebCore/html/ImageInputType.cpp	2016-09-13 16:13:38 UTC (rev 205860)
+++ trunk/Source/WebCore/html/ImageInputType.cpp	2016-09-13 17:05:39 UTC (rev 205861)
@@ -109,6 +109,9 @@
 
 void ImageInputType::altAttributeChanged()
 {
+    if (!is<RenderImage>(element().renderer()))
+        return;
+
     auto* renderer = downcast<RenderImage>(element().renderer());
     if (!renderer)
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to