Title: [106839] trunk
- Revision
- 106839
- Author
- [email protected]
- Date
- 2012-02-06 13:05:22 -0800 (Mon, 06 Feb 2012)
Log Message
Wheel event handler count not updated when adding handlers to the window
https://bugs.webkit.org/show_bug.cgi?id=77895
Reviewed by Dan Bernstein.
Source/WebCore:
Test: fast/events/wheelevent-handler-count.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
Update the wheel event count.
* testing/Internals.cpp:
(WebCore::Internals::wheelEventHandlerCount):
* testing/Internals.h:
* testing/Internals.idl:
Add wheelEventHandlerCount to window.internals.
LayoutTests:
* fast/events/wheelevent-handler-count-expected.txt: Added.
* fast/events/wheelevent-handler-count.html: Added.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (106838 => 106839)
--- trunk/LayoutTests/ChangeLog 2012-02-06 21:01:28 UTC (rev 106838)
+++ trunk/LayoutTests/ChangeLog 2012-02-06 21:05:22 UTC (rev 106839)
@@ -1,3 +1,13 @@
+2012-02-06 Anders Carlsson <[email protected]>
+
+ Wheel event handler count not updated when adding handlers to the window
+ https://bugs.webkit.org/show_bug.cgi?id=77895
+
+ Reviewed by Dan Bernstein.
+
+ * fast/events/wheelevent-handler-count-expected.txt: Added.
+ * fast/events/wheelevent-handler-count.html: Added.
+
2012-02-05 Gustavo Noronha Silva <[email protected]>
[GTK] Insta-crash when closing browser with inspector window opened
Modified: trunk/Source/WebCore/ChangeLog (106838 => 106839)
--- trunk/Source/WebCore/ChangeLog 2012-02-06 21:01:28 UTC (rev 106838)
+++ trunk/Source/WebCore/ChangeLog 2012-02-06 21:05:22 UTC (rev 106839)
@@ -1,3 +1,23 @@
+2012-02-06 Anders Carlsson <[email protected]>
+
+ Wheel event handler count not updated when adding handlers to the window
+ https://bugs.webkit.org/show_bug.cgi?id=77895
+
+ Reviewed by Dan Bernstein.
+
+ Test: fast/events/wheelevent-handler-count.html
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+ (WebCore::DOMWindow::removeEventListener):
+ Update the wheel event count.
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::wheelEventHandlerCount):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+ Add wheelEventHandlerCount to window.internals.
+
2012-02-06 Matthew Delaney <[email protected]>
toDataURL() uses stale data after putImageData()
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (106838 => 106839)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2012-02-06 21:01:28 UTC (rev 106838)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2012-02-06 21:05:22 UTC (rev 106839)
@@ -1550,8 +1550,11 @@
if (!EventTarget::addEventListener(eventType, listener, useCapture))
return false;
- if (Document* document = this->document())
+ if (Document* document = this->document()) {
document->addListenerTypeIfNeeded(eventType);
+ if (eventType == eventNames().mousewheelEvent)
+ document->didAddWheelEventHandler();
+ }
if (eventType == eventNames().unloadEvent)
addUnloadEventListener(this);
@@ -1572,6 +1575,11 @@
if (!EventTarget::removeEventListener(eventType, listener, useCapture))
return false;
+ if (Document* document = this->document()) {
+ if (eventType == eventNames().mousewheelEvent)
+ document->didRemoveWheelEventHandler();
+ }
+
if (eventType == eventNames().unloadEvent)
removeUnloadEventListener(this);
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
Modified: trunk/Source/WebCore/testing/Internals.cpp (106838 => 106839)
--- trunk/Source/WebCore/testing/Internals.cpp 2012-02-06 21:01:28 UTC (rev 106838)
+++ trunk/Source/WebCore/testing/Internals.cpp 2012-02-06 21:05:22 UTC (rev 106839)
@@ -542,5 +542,15 @@
return false;
#endif
}
-
+
+unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionCode& ec)
+{
+ if (!document) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ return document->wheelEventHandlerCount();
}
+
+}
Modified: trunk/Source/WebCore/testing/Internals.h (106838 => 106839)
--- trunk/Source/WebCore/testing/Internals.h 2012-02-06 21:01:28 UTC (rev 106838)
+++ trunk/Source/WebCore/testing/Internals.h 2012-02-06 21:05:22 UTC (rev 106839)
@@ -105,6 +105,8 @@
void setShouldDisplayTrackKind(Document*, const String& kind, bool, ExceptionCode&);
bool shouldDisplayTrackKind(Document*, const String& kind, ExceptionCode&);
+ unsigned wheelEventHandlerCount(Document*, ExceptionCode&);
+
static const char* internalsId;
InternalSettings* settings() const { return m_settings.get(); }
Modified: trunk/Source/WebCore/testing/Internals.idl (106838 => 106839)
--- trunk/Source/WebCore/testing/Internals.idl 2012-02-06 21:01:28 UTC (rev 106838)
+++ trunk/Source/WebCore/testing/Internals.idl 2012-02-06 21:05:22 UTC (rev 106839)
@@ -79,6 +79,8 @@
#endif
attribute [Custom] Array userPreferredLanguages;
+ unsigned long wheelEventHandlerCount(in Document document) raises (DOMException);
+
readonly attribute InternalSettings settings;
};
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes