Title: [145614] branches/safari-536.30-branch

Diff

Modified: branches/safari-536.30-branch/LayoutTests/ChangeLog (145613 => 145614)


--- branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-12 23:43:47 UTC (rev 145613)
+++ branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-12 23:45:34 UTC (rev 145614)
@@ -1,5 +1,19 @@
 2013-03-12  Lucas Forschler  <[email protected]>
 
+        Merge r132983
+
+    2012-10-30  Kent Tamura  <[email protected]>
+
+            Delaying 'change' and 'input' event dispatching during HTMLInputElement::setValue
+            https://bugs.webkit.org/show_bug.cgi?id=100772
+
+            Reviewed by Abhishek Arya.
+
+            * fast/forms/range/range-type-change-onchange-expected.txt: Added.
+            * fast/forms/range/range-type-change-onchange.html: Added.
+
+2013-03-12  Lucas Forschler  <[email protected]>
+
         Merge r131315
 
     2012-10-15  Jay Civelli  <[email protected]>

Copied: branches/safari-536.30-branch/LayoutTests/fast/forms/range/range-type-change-onchange-expected.txt (from rev 132983, trunk/LayoutTests/fast/forms/range/range-type-change-onchange-expected.txt) (0 => 145614)


--- branches/safari-536.30-branch/LayoutTests/fast/forms/range/range-type-change-onchange-expected.txt	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/fast/forms/range/range-type-change-onchange-expected.txt	2013-03-12 23:45:34 UTC (rev 145614)
@@ -0,0 +1,10 @@
+Check if no problem happens by type change in onchange handler.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS unless crash
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: branches/safari-536.30-branch/LayoutTests/fast/forms/range/range-type-change-onchange.html (from rev 132983, trunk/LayoutTests/fast/forms/range/range-type-change-onchange.html) (0 => 145614)


--- branches/safari-536.30-branch/LayoutTests/fast/forms/range/range-type-change-onchange.html	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/fast/forms/range/range-type-change-onchange.html	2013-03-12 23:45:34 UTC (rev 145614)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+
+<input id="range1" type="range" _onchange_="updateType(this)" autofocus>
+<script>
+description('Check if no problem happens by type change in onchange handler.');
+
+function updateType(input) {
+    input.type = 'text';
+    setTimeout(finish, 0);
+}
+
+function finish() {
+    testPassed('unless crash');
+    finishJSTest();
+}
+
+jsTestIsAsync = true;
+eventSender.keyDown('upArrow');
+</script>
+<script src=""
+</body>

Modified: branches/safari-536.30-branch/Source/WebCore/ChangeLog (145613 => 145614)


--- branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-12 23:43:47 UTC (rev 145613)
+++ branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-12 23:45:34 UTC (rev 145614)
@@ -1,5 +1,30 @@
 2013-03-12  Lucas Forschler  <[email protected]>
 
+        Merge r132983
+
+    2012-10-30  Kent Tamura  <[email protected]>
+
+            Delaying 'change' and 'input' event dispatching during HTMLInputElement::setValue
+            https://bugs.webkit.org/show_bug.cgi?id=100772
+
+            Reviewed by Abhishek Arya.
+
+            'change' and 'input' events are asynchronous and not
+            cancelable. We can use ScopedEvent.
+
+            Test: fast/forms/range/range-type-change-onchange.html
+
+            * dom/Node.cpp:
+            (WebCore::Node::dispatchChangeEvent): Use dispatchScopedEvent.
+            (WebCore::Node::dispatchInputEvent): Ditto.
+            * html/HTMLInputElement.cpp:
+            (WebCore::HTMLInputElement::setValue):
+            Make a scope to delay event dispatching.
+            * html/RangeInputType.cpp:
+            (WebCore::RangeInputType::handleKeydownEvent): Ditto.
+
+2013-03-12  Lucas Forschler  <[email protected]>
+
         Merge r132462
 
     2012-10-25  Alexander Pavlov  <[email protected]>

Modified: branches/safari-536.30-branch/Source/WebCore/dom/Node.cpp (145613 => 145614)


--- branches/safari-536.30-branch/Source/WebCore/dom/Node.cpp	2013-03-12 23:43:47 UTC (rev 145613)
+++ branches/safari-536.30-branch/Source/WebCore/dom/Node.cpp	2013-03-12 23:45:34 UTC (rev 145614)
@@ -2840,12 +2840,12 @@
 
 void Node::dispatchChangeEvent()
 {
-    dispatchEvent(Event::create(eventNames().changeEvent, true, false));
+    dispatchScopedEvent(Event::create(eventNames().changeEvent, true, false));
 }
 
 void Node::dispatchInputEvent()
 {
-    dispatchEvent(Event::create(eventNames().inputEvent, true, false));
+    dispatchScopedEvent(Event::create(eventNames().inputEvent, true, false));
 }
 
 bool Node::disabled() const

Modified: branches/safari-536.30-branch/Source/WebCore/html/HTMLInputElement.cpp (145613 => 145614)


--- branches/safari-536.30-branch/Source/WebCore/html/HTMLInputElement.cpp	2013-03-12 23:43:47 UTC (rev 145613)
+++ branches/safari-536.30-branch/Source/WebCore/html/HTMLInputElement.cpp	2013-03-12 23:45:34 UTC (rev 145614)
@@ -50,6 +50,7 @@
 #include "NumberInputType.h"
 #include "RenderTextControlSingleLine.h"
 #include "RenderTheme.h"
+#include "ScopedEventQueue.h"
 #include "SearchInputType.h"
 #include "ShadowRoot.h"
 #include "ScriptEventListener.h"
@@ -1042,6 +1043,7 @@
         return;
 
     RefPtr<HTMLInputElement> protector(this);
+    EventQueueScope scope;
     String sanitizedValue = sanitizeValue(value);
     bool valueChanged = sanitizedValue != this->value();
 

Modified: branches/safari-536.30-branch/Source/WebCore/html/RangeInputType.cpp (145613 => 145614)


--- branches/safari-536.30-branch/Source/WebCore/html/RangeInputType.cpp	2013-03-12 23:43:47 UTC (rev 145613)
+++ branches/safari-536.30-branch/Source/WebCore/html/RangeInputType.cpp	2013-03-12 23:45:34 UTC (rev 145614)
@@ -41,6 +41,7 @@
 #include "MouseEvent.h"
 #include "PlatformMouseEvent.h"
 #include "RenderSlider.h"
+#include "ScopedEventQueue.h"
 #include "ShadowRoot.h"
 #include "ShadowTree.h"
 #include "SliderThumbElement.h"
@@ -223,6 +224,7 @@
     newValue = StepRange(element()).clampValue(newValue);
 
     if (newValue != current) {
+        EventQueueScope scope;
         ExceptionCode ec;
         TextFieldEventBehavior eventBehavior = DispatchChangeEvent;
         setValueAsNumber(newValue, eventBehavior, ec);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to