Changeset 48257 in webkit
- Timestamp:
- Sep 10, 2009 10:03:51 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r48256 r48257 1 2009-09-10 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Fixes issue where focused elements did not get blur and focus events when the window was blurred and focused. 6 https://bugs.webkit.org/show_bug.cgi?id=27105 7 8 * fast/events/blur-focus-window-should-blur-focus-element-expected.txt: Added. 9 * fast/events/blur-focus-window-should-blur-focus-element.html: Added. 10 * fast/events/resources/blur-focus-window-should-blur-focus-element.js: Added. 11 (divElement.onfocus.divElement.onblur.window.onfocus.window.onblur.innerDiv.onfocus.innerDiv.onblur.iframe.onfocus.iframe.onblur): 12 (testNextEvent): 13 * fast/events/resources/tabindex-focus-blur-all.js: 14 (test): 15 * fast/events/tabindex-focus-blur-all-expected.txt: 16 1 17 2009-09-10 Adam Barth <abarth@webkit.org> 2 18 -
trunk/LayoutTests/fast/events/resources/tabindex-focus-blur-all.js
r48106 r48257 50 50 homeBase[0].focus(); 51 51 52 var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 3 35 / 335";52 var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatched, and should be 329 / 329 "; 53 53 resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED</span><br>" : "<span style='color:red'>FAILED</span><br>"; 54 54 resultSummary += "Total of "+failedTestCount+" focus test(s) failed."; -
trunk/LayoutTests/fast/events/tabindex-focus-blur-all-expected.txt
r48106 r48257 1 329 focus / 329 blur events dispatched, and should be 3 35 / 335PASSED1 329 focus / 329 blur events dispatched, and should be 329 / 329 PASSED 2 2 Total of 0 focus test(s) failed. PASSED -
trunk/WebCore/ChangeLog
r48255 r48257 1 2009-09-10 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Fixes issue where focused elements did not get blur and focus events when the window was blurred and focused. 6 https://bugs.webkit.org/show_bug.cgi?id=27105 7 8 Test: fast/events/blur-focus-window-should-blur-focus-element.html 9 10 * page/FocusController.cpp: 11 (WebCore::dispatchEventsOnWindowAndFocusedNode): 12 (WebCore::FocusController::setFocused): 13 (WebCore::FocusController::setActive): 14 1 15 2009-09-10 Adam Roben <aroben@apple.com> 2 16 -
trunk/WebCore/page/FocusController.cpp
r48106 r48257 56 56 using namespace HTMLNames; 57 57 58 static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool focused) 59 { 60 // If we have a focused node we should dispatch blur on it before we blur the window. 61 // If we have a focused node we should dispatch focus on it after we focus the window. 62 // https://bugs.webkit.org/show_bug.cgi?id=27105 63 if (!focused && document->focusedNode()) 64 document->focusedNode()->dispatchBlurEvent(); 65 document->dispatchWindowEvent(focused ? eventNames().focusEvent : eventNames().blurEvent, false, false); 66 if (focused && document->focusedNode()) 67 document->focusedNode()->dispatchFocusEvent(); 68 } 69 58 70 FocusController::FocusController(Page* page) 59 71 : m_page(page) … … 101 113 if (m_focusedFrame && m_focusedFrame->view()) { 102 114 m_focusedFrame->selection()->setFocused(focused); 103 m_focusedFrame->document()->dispatchWindowEvent(focused ? eventNames().focusEvent : eventNames().blurEvent, false, false);115 dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), focused); 104 116 } 105 117 } … … 344 356 345 357 if (m_focusedFrame && isFocused()) 346 m_focusedFrame->document()->dispatchWindowEvent(active ? eventNames().focusEvent : eventNames().blurEvent, false, false);358 dispatchEventsOnWindowAndFocusedNode(m_focusedFrame->document(), active); 347 359 } 348 360
Note: See TracChangeset
for help on using the changeset viewer.