Changeset 198924 in webkit
- Timestamp:
- Mar 31, 2016 3:43:45 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r198917 r198924 1 2016-03-31 Daniel Bates <dabates@apple.com> 2 3 REGRESSION (r195605): ASSERTION FAILED: !NoEventDispatchAssertion::isEventDispatchForbidden() 4 when pressing the back button on a page with a focused subframe 5 https://bugs.webkit.org/show_bug.cgi?id=156033 6 <rdar://problem/25446561> 7 8 Reviewed by Chris Dumez. 9 10 Add a test to ensure that when navigating back from a page with a focused <iframe> f, a DOM 11 blur event is dispatched to f, a DOM focus event is dispatched at the main frame and that 12 an assertion failure does not occur (only applicable in a debug build). 13 14 * fast/history/back-from-page-with-focused-iframe-expected.txt: Added. 15 * fast/history/back-from-page-with-focused-iframe.html: Added. 16 1 17 2016-03-31 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebCore/ChangeLog
r198917 r198924 1 2016-03-31 Daniel Bates <dabates@apple.com> 2 3 REGRESSION (r195605): ASSERTION FAILED: !NoEventDispatchAssertion::isEventDispatchForbidden() 4 when pressing the back button on a page with a focused subframe 5 https://bugs.webkit.org/show_bug.cgi?id=156033 6 <rdar://problem/25446561> 7 8 Reviewed by Chris Dumez. 9 10 Fixes an assertion failure when navigating back, by pressing the browser back button, to 11 the previous page from a page with a focused subframe. 12 13 Following r195605 (https://bugs.webkit.org/show_bug.cgi?id=153449), the responsibility for 14 dispatching a DOM pagehide event moved from CachedFrame to PageCache and we now instantiate 15 a NoEventDispatchAssertion object to enforce the invariant that no additional DOM events are 16 dispatched as part of adding a page to the page cache. When adding a page with a focused 17 subframe to the page cache we focus its main frame, which implicitly defocuses the subframe 18 and dispatches a DOM blur event at it. Therefore an assertion failure occurs when dispatching 19 this DOM blur event (because a NoEventDispatchAssertion object was allocated on the stack). 20 21 Test: fast/history/back-from-page-with-focused-iframe.html 22 23 * history/CachedFrame.cpp: 24 (WebCore::CachedFrame::CachedFrame): Move logic to focus the main frame from here... 25 * history/PageCache.cpp: 26 (WebCore::PageCache::addIfCacheable): to here such that any DOM blur and focus events 27 are dispatched before instantiate the NoEventDispatchAssertion object and enter the page 28 cache. 29 1 30 2016-03-31 Chris Dumez <cdumez@apple.com> 2 31 -
trunk/Source/WebCore/history/CachedFrame.cpp
r196641 r198924 34 34 #include "EventNames.h" 35 35 #include "ExceptionCode.h" 36 #include "FocusController.h"37 36 #include "FrameLoader.h" 38 37 #include "FrameLoaderClient.h" … … 148 147 ASSERT(m_view); 149 148 150 if (frame.page()->focusController().focusedFrame() == &frame)151 frame.page()->focusController().setFocusedFrame(&frame.mainFrame());152 153 149 // Custom scrollbar renderers will get reattached when the document comes out of the page cache 154 150 m_view->detachCustomScrollbars(); -
trunk/Source/WebCore/history/PageCache.cpp
r198476 r198924 38 38 #include "Document.h" 39 39 #include "DocumentLoader.h" 40 #include "FocusController.h" 40 41 #include "FrameLoader.h" 41 42 #include "FrameLoaderClient.h" … … 393 394 setInPageCache(*page, true); 394 395 396 // Focus the main frame, defocusing a focused subframe (if we have one). We do this here, 397 // before the page enters the page cache, while we still can dispatch DOM blur/focus events. 398 if (page->focusController().focusedFrame()) 399 page->focusController().setFocusedFrame(&page->mainFrame()); 400 395 401 // Fire the pagehide event in all frames. 396 402 firePageHideEventRecursively(page->mainFrame());
Note: See TracChangeset
for help on using the changeset viewer.