Changeset 245086 in webkit
- Timestamp:
- May 8, 2019 6:34:05 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245085 r245086 1 2019-05-08 Chris Dumez <cdumez@apple.com> 2 3 [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &) 4 https://bugs.webkit.org/show_bug.cgi?id=197696 5 <rdar://problem/50586956> 6 7 Reviewed by Simon Fraser. 8 9 Add layout test coverage. 10 11 * fast/events/ios/rotation/orientationchange-event-listener-on.body-expected.txt: Added. 12 * fast/events/ios/rotation/orientationchange-event-listener-on.body.html: Added. 13 1 14 2019-05-08 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r245085 r245086 1 2019-05-08 Chris Dumez <cdumez@apple.com> 2 3 [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &) 4 https://bugs.webkit.org/show_bug.cgi?id=197696 5 <rdar://problem/50586956> 6 7 Reviewed by Simon Fraser. 8 9 Setting the onorientationchange / onresize event handler on the body should set the event handler on the 10 window object, as per the HTML specification. However, calling body.addEventListener() with 'orientationchange' 11 or 'resize' should not set the event listener on the window object, only the body. Blink and Gecko seem to 12 behave as per specification but WebKit had a quirk for the addEventListener case. The quirk's implementation 13 is slightly wrong (because it is unsafe to take a JSLazyEventListener from a body element and add it to the 14 window, given that the JSLazyEventListener keeps a raw pointer to its element) and was causing crashes such 15 as <rdar://problem/24314027>. As a result, this patch simply drops the WebKit quirk, which will align our 16 behavior with other browsers and fix the crashes altogether. 17 18 Test: fast/events/ios/rotation/orientationchange-event-listener-on.body.html 19 20 * dom/Node.cpp: 21 (WebCore::tryAddEventListener): 22 (WebCore::tryRemoveEventListener): 23 1 24 2019-05-08 Ryan Haddad <ryanhaddad@apple.com> 2 25 -
trunk/Source/WebCore/dom/Node.cpp
r244218 r245086 2119 2119 targetNode->document().domWindow()->incrementScrollEventListenersCount(); 2120 2120 2121 // FIXME: Would it be sufficient to special-case this code for <body> and <frameset>?2122 //2123 // This code was added to address <rdar://problem/5846492> Onorientationchange event not working for document.body.2124 // Forward this call to addEventListener() to the window since these are window-only events.2125 if (eventType == eventNames().orientationchangeEvent || eventType == eventNames().resizeEvent)2126 targetNode->document().domWindow()->addEventListener(eventType, WTFMove(listener), options);2127 2128 2121 #if ENABLE(TOUCH_EVENTS) 2129 2122 if (eventNames().isTouchRelatedEventType(targetNode->document(), eventType)) … … 2160 2153 if (targetNode == &targetNode->document() && eventType == eventNames().scrollEvent) 2161 2154 targetNode->document().domWindow()->decrementScrollEventListenersCount(); 2162 2163 // FIXME: Would it be sufficient to special-case this code for <body> and <frameset>? See <rdar://problem/15647823>.2164 // This code was added to address <rdar://problem/5846492> Onorientationchange event not working for document.body.2165 // Forward this call to removeEventListener() to the window since these are window-only events.2166 if (eventType == eventNames().orientationchangeEvent || eventType == eventNames().resizeEvent)2167 targetNode->document().domWindow()->removeEventListener(eventType, listener, options);2168 2155 2169 2156 #if ENABLE(TOUCH_EVENTS)
Note: See TracChangeset
for help on using the changeset viewer.