Changeset 156185 in webkit
- Timestamp:
- Sep 20, 2013 12:06:52 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r156179 r156185 1 2013-09-20 Arunprasad Rajkumar <ararunprasad@gmail.com> 2 3 Hiding a focused element should unfocus it and fire a blur event 4 https://bugs.webkit.org/show_bug.cgi?id=29241 5 6 Reviewed by Darin Adler. 7 8 * fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt: Added. 9 * fast/dom/HTMLDocument/active-element-gets-unfocusable.html: Added. 10 11 LayoutTest reused from https://chromium.googlesource.com/chromium/blink/+/c58f636fd18fc27944c42e27d6a92a36867c57e1 12 with little modification. 13 1 14 2013-09-20 Alexey Proskuryakov <ap@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r156183 r156185 1 2013-09-20 Arunprasad Rajkumar <ararunprasad@gmail.com> 2 3 Hiding a focused element should unfocus it and fire a blur event 4 https://bugs.webkit.org/show_bug.cgi?id=29241 5 6 Reviewed by Darin Adler. 7 8 Test: fast/dom/HTMLDocument/active-element-gets-unfocusable.html 9 10 We check whether the current focus element is really focusable after 11 the style recalculation and layout change. If it is not focusable then schedule a 12 timer to reset it asynchronously. 13 14 * dom/Document.cpp: 15 (WebCore::Document::Document): 16 (WebCore::Document::recalcStyle): Check isFocusable() on the focus element after 17 style recalculation. 18 (WebCore::Document::updateLayout): Check isFocusable() on the focus element after 19 layout. 20 (WebCore::Document::resetHiddenFocusElementSoon): 21 (WebCore::Document::resetHiddenFocusElementTimer): 22 * dom/Document.h: 23 1 24 2013-09-20 Alexey Proskuryakov <ap@apple.com> 2 25 -
trunk/Source/WebCore/dom/Document.cpp
r156038 r156185 440 440 , m_markers(adoptPtr(new DocumentMarkerController)) 441 441 , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired) 442 , m_resetHiddenFocusElementTimer(this, &Document::resetHiddenFocusElementTimer) 442 443 , m_cssTarget(0) 443 444 , m_processingLoadEvent(false) … … 1828 1829 if (m_hoveredElement && !m_hoveredElement->renderer()) 1829 1830 frameView.frame().eventHandler().dispatchFakeMouseMoveEventSoon(); 1831 1832 // Style change may reset the focus, e.g. display: none, visibility: hidden. 1833 resetHiddenFocusElementSoon(); 1830 1834 } 1831 1835 … … 1866 1870 if (frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout())) 1867 1871 frameView->layout(); 1872 1873 // Active focus element's isFocusable() state may change after Layout. e.g. width: 0px or height: 0px. 1874 resetHiddenFocusElementSoon(); 1868 1875 } 1869 1876 … … 4687 4694 } 4688 4695 4696 void Document::resetHiddenFocusElementSoon() 4697 { 4698 if (!m_resetHiddenFocusElementTimer.isActive() && m_focusedElement && !m_focusedElement->isFocusable()) 4699 m_resetHiddenFocusElementTimer.startOneShot(0); 4700 } 4701 4689 4702 void Document::updateFocusAppearanceTimerFired(Timer<Document>*) 4690 4703 { … … 4696 4709 if (element->isFocusable()) 4697 4710 element->updateFocusAppearance(m_updateFocusAppearanceRestoresSelection); 4711 } 4712 4713 void Document::resetHiddenFocusElementTimer(Timer<Document>*) 4714 { 4715 if (m_focusedElement && !m_focusedElement->isFocusable()) 4716 setFocusedElement(0); 4698 4717 } 4699 4718 -
trunk/Source/WebCore/dom/Document.h
r155955 r156185 919 919 void updateFocusAppearanceSoon(bool restorePreviousSelection); 920 920 void cancelFocusAppearanceUpdate(); 921 921 922 void resetHiddenFocusElementSoon(); 923 922 924 // Extension for manipulating canvas drawing contexts for use in CSS 923 925 CanvasRenderingContext* getCSSCanvasContext(const String& type, const String& name, int width, int height); … … 1226 1228 void updateBaseURL(); 1227 1229 1230 void resetHiddenFocusElementTimer(Timer<Document>*); 1231 1228 1232 void buildAccessKeyMap(TreeScope* root); 1229 1233 … … 1377 1381 1378 1382 Timer<Document> m_updateFocusAppearanceTimer; 1383 Timer<Document> m_resetHiddenFocusElementTimer; 1379 1384 1380 1385 Element* m_cssTarget;
Note: See TracChangeset
for help on using the changeset viewer.