Changeset 156252 in webkit
- Timestamp:
- Sep 22, 2013 4:19:14 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r156244 r156252 1 2013-09-22 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-22 Darin Adler <darin@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r156251 r156252 1 2013-09-22 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-22 Sam Weinig <sam@webkit.org> 2 25 -
trunk/Source/WebCore/dom/Document.cpp
r156231 r156252 441 441 , m_markers(adoptPtr(new DocumentMarkerController)) 442 442 , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired) 443 , m_resetHiddenFocusElementTimer(this, &Document::resetHiddenFocusElementTimer) 443 444 , m_cssTarget(0) 444 445 , m_processingLoadEvent(false) … … 1829 1830 if (m_hoveredElement && !m_hoveredElement->renderer()) 1830 1831 frameView.frame().eventHandler().dispatchFakeMouseMoveEventSoon(); 1832 1833 // Style change may reset the focus, e.g. display: none, visibility: hidden. 1834 resetHiddenFocusElementSoon(); 1831 1835 } 1832 1836 … … 1867 1871 if (frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout())) 1868 1872 frameView->layout(); 1873 1874 // Active focus element's isFocusable() state may change after Layout. e.g. width: 0px or height: 0px. 1875 resetHiddenFocusElementSoon(); 1869 1876 } 1870 1877 … … 4691 4698 } 4692 4699 4700 void Document::resetHiddenFocusElementSoon() 4701 { 4702 if (!m_resetHiddenFocusElementTimer.isActive() && m_focusedElement) 4703 m_resetHiddenFocusElementTimer.startOneShot(0); 4704 } 4705 4693 4706 void Document::updateFocusAppearanceTimerFired(Timer<Document>*) 4694 4707 { … … 4700 4713 if (element->isFocusable()) 4701 4714 element->updateFocusAppearance(m_updateFocusAppearanceRestoresSelection); 4715 } 4716 4717 void Document::resetHiddenFocusElementTimer(Timer<Document>*) 4718 { 4719 if (view() && view()->needsLayout()) 4720 return; 4721 4722 if (m_focusedElement && !m_focusedElement->isFocusable()) 4723 setFocusedElement(0); 4702 4724 } 4703 4725 -
trunk/Source/WebCore/dom/Document.h
r156234 r156252 920 920 void updateFocusAppearanceSoon(bool restorePreviousSelection); 921 921 void cancelFocusAppearanceUpdate(); 922 922 923 void resetHiddenFocusElementSoon(); 924 923 925 // Extension for manipulating canvas drawing contexts for use in CSS 924 926 CanvasRenderingContext* getCSSCanvasContext(const String& type, const String& name, int width, int height); … … 1227 1229 void updateBaseURL(); 1228 1230 1231 void resetHiddenFocusElementTimer(Timer<Document>*); 1232 1229 1233 void buildAccessKeyMap(TreeScope* root); 1230 1234 … … 1378 1382 1379 1383 Timer<Document> m_updateFocusAppearanceTimer; 1384 Timer<Document> m_resetHiddenFocusElementTimer; 1380 1385 1381 1386 Element* m_cssTarget;
Note: See TracChangeset
for help on using the changeset viewer.