Changeset 145340 in webkit
- Timestamp:
- Mar 10, 2013 11:13:05 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r145338 r145340 1 2013-03-10 Matt Falkenhagen <falken@chromium.org> 2 3 Implement inert subtrees needed for modal <dialog> 4 https://bugs.webkit.org/show_bug.cgi?id=110952 5 6 Reviewed by Hajime Morrita. 7 8 * fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events-expected.txt: Added. 9 * fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events.html: Added. 10 * fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events-expected.txt: Added. 11 * fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html: Added. 12 * fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events-expected.txt: Added. 13 * fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.html: Added. 14 1 15 2013-03-10 Glenn Adams <glenn@skynav.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r145338 r145340 1 2013-03-10 Matt Falkenhagen <falken@chromium.org> 2 3 Implement inert subtrees needed for modal <dialog> 4 https://bugs.webkit.org/show_bug.cgi?id=110952 5 6 Reviewed by Hajime Morrita. 7 8 This changes Node::disabled() to return true when a modal dialog is 9 open and the node is not in the dialog. 10 11 Reusing disabled for inertness is useful because then event 12 targeting and focus control automatically have the desired behavior: 13 inert nodes are skipped over. 14 15 Tests: fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events.html 16 fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html 17 fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.html 18 19 * dom/Document.h: 20 (WebCore::Document::activeModalDialog): Returns the topmost element in the top layer. 21 Since now the only elements in the top layer are modal dialogs, it is the active modal dialog. 22 * dom/Node.cpp: 23 (WebCore): 24 (WebCore::Node::isInert): As per the spec, a node that is not an ancestor or descendant of the modal dialog is inert. 25 (WebCore::Node::disabled): Return false when inert. 26 * dom/Node.h: 27 * html/HTMLFormControlElement.cpp: 28 (WebCore::HTMLFormControlElement::disabled): Fall back to the superclass so inert is taken into account. 29 1 30 2013-03-10 Glenn Adams <glenn@skynav.com> 2 31 -
trunk/Source/WebCore/dom/Document.h
r145126 r145340 1180 1180 void removeFromTopLayer(Element*); 1181 1181 const Vector<RefPtr<Element> >& topLayerElements() const { return m_topLayerElements; } 1182 Element* activeModalDialog() const { return !m_topLayerElements.isEmpty() ? m_topLayerElements.last().get() : 0; } 1182 1183 #endif 1183 1184 -
trunk/Source/WebCore/dom/Node.cpp
r145296 r145340 903 903 } 904 904 905 #if ENABLE(DIALOG_ELEMENT) 906 bool Node::isInert() const 907 { 908 Element* dialog = document()->activeModalDialog(); 909 return dialog && !containsIncludingShadowDOM(dialog) && !dialog->containsIncludingShadowDOM(this); 910 } 911 #endif 912 905 913 unsigned Node::nodeIndex() const 906 914 { … … 2447 2455 bool Node::disabled() const 2448 2456 { 2457 #if ENABLE(DIALOG_ELEMENT) 2458 if (isInert()) 2459 return true; 2460 #endif 2449 2461 return false; 2450 2462 } -
trunk/Source/WebCore/dom/Node.h
r145021 r145340 415 415 virtual Node* focusDelegate(); 416 416 417 #if ENABLE(DIALOG_ELEMENT) 418 bool isInert() const; 419 #endif 420 417 421 enum UserSelectAllTreatment { 418 422 UserSelectAllDoesNotAffectEditability, -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r144949 r145340 282 282 if (m_ancestorDisabledState == AncestorDisabledStateUnknown) 283 283 updateAncestorDisabledState(); 284 return m_ancestorDisabledState == AncestorDisabledStateDisabled; 284 if (m_ancestorDisabledState == AncestorDisabledStateDisabled) 285 return true; 286 return HTMLElement::disabled(); 285 287 } 286 288
Note: See TracChangeset
for help on using the changeset viewer.