Changeset 145524 in webkit
- Timestamp:
- Mar 12, 2013 4:38:57 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r145520 r145524 1 2013-03-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r145514. 4 http://trac.webkit.org/changeset/145514 5 https://bugs.webkit.org/show_bug.cgi?id=112134 6 7 breaks Mac build (Requested by falken on #webkit). 8 9 * dom/Element.cpp: 10 * dom/Element.h: 11 * dom/EventDispatcher.cpp: 12 (WebCore::EventDispatcher::dispatchSimulatedClick): 13 * dom/GestureEvent.cpp: 14 (WebCore::GestureEventDispatchMediator::dispatchEvent): 15 * dom/MouseEvent.cpp: 16 (WebCore::MouseEventDispatchMediator::dispatchEvent): 17 * dom/Node.cpp: 18 (WebCore): 19 (WebCore::Node::isInert): 20 (WebCore::Node::handleLocalEvents): 21 (WebCore::Node::disabled): 22 (WebCore::Node::willRespondToMouseMoveEvents): 23 (WebCore::Node::willRespondToMouseClickEvents): 24 (WebCore::Node::willRespondToTouchEvents): 25 * dom/Node.h: 26 (Node): 27 1 28 2013-03-12 Andrey Lushnikov <lushnikov@chromium.org> 2 29 -
trunk/Source/WebCore/dom/Element.cpp
r145514 r145524 1153 1153 } 1154 1154 1155 bool Element::disabled() const1156 {1157 #if ENABLE(DIALOG_ELEMENT)1158 // FIXME: disabled and inert are separate concepts in the spec, but now we treat them as the same.1159 // For example, an inert, non-disabled form control should not be grayed out.1160 if (isInert())1161 return true;1162 #endif1163 return false;1164 }1165 1166 #if ENABLE(DIALOG_ELEMENT)1167 bool Element::isInert() const1168 {1169 Element* dialog = document()->activeModalDialog();1170 return dialog && !containsIncludingShadowDOM(dialog) && !dialog->containsIncludingShadowDOM(this);1171 }1172 #endif1173 1174 1155 Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertionPoint) 1175 1156 { -
trunk/Source/WebCore/dom/Element.h
r145514 r145524 547 547 virtual void dispatchFormControlChangeEvent() { } 548 548 549 // Used for disabled form elements; if true, prevents mouse events from being dispatched550 // to event listeners, and prevents DOMActivate events from being sent at all.551 virtual bool disabled() const;552 553 #if ENABLE(DIALOG_ELEMENT)554 bool isInert() const;555 #endif556 557 549 #if ENABLE(SVG) 558 550 virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const; -
trunk/Source/WebCore/dom/EventDispatcher.cpp
r145514 r145524 80 80 void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent, SimulatedClickMouseEventOptions mouseEventOptions, SimulatedClickVisualOptions visualOptions) 81 81 { 82 if (node-> isElementNode() && toElement(node)->disabled())82 if (node->disabled()) 83 83 return; 84 84 -
trunk/Source/WebCore/dom/GestureEvent.cpp
r145514 r145524 30 30 #include "GestureEvent.h" 31 31 32 #include "Element.h"33 32 #include <wtf/text/AtomicString.h> 34 33 … … 121 120 bool GestureEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const 122 121 { 123 if (dispatcher->node()-> isElementNode() && toElement(dispatcher->node())->disabled())122 if (dispatcher->node()->disabled()) 124 123 return true; 125 124 -
trunk/Source/WebCore/dom/MouseEvent.cpp
r145514 r145524 301 301 } 302 302 303 if (dispatcher->node()-> isElementNode() && toElement(dispatcher->node())->disabled()) // Don't even send DOM events for disabled controls..303 if (dispatcher->node()->disabled()) // Don't even send DOM events for disabled controls.. 304 304 return false; 305 305 -
trunk/Source/WebCore/dom/Node.cpp
r145514 r145524 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 { … … 2305 2313 return; 2306 2314 2307 if ( isElementNode() && toElement(this)->disabled() && event->isMouseEvent())2315 if (disabled() && event->isMouseEvent()) 2308 2316 return; 2309 2317 … … 2443 2451 { 2444 2452 dispatchScopedEvent(Event::create(eventNames().inputEvent, true, false)); 2453 } 2454 2455 bool Node::disabled() const 2456 { 2457 #if ENABLE(DIALOG_ELEMENT) 2458 if (isInert()) 2459 return true; 2460 #endif 2461 return false; 2445 2462 } 2446 2463 … … 2504 2521 bool Node::willRespondToMouseMoveEvents() 2505 2522 { 2506 if ( isElementNode() && toElement(this)->disabled())2523 if (disabled()) 2507 2524 return false; 2508 2525 return hasEventListeners(eventNames().mousemoveEvent) || hasEventListeners(eventNames().mouseoverEvent) || hasEventListeners(eventNames().mouseoutEvent); … … 2511 2528 bool Node::willRespondToMouseClickEvents() 2512 2529 { 2513 if ( isElementNode() && toElement(this)->disabled())2530 if (disabled()) 2514 2531 return false; 2515 2532 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListeners(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent) || hasEventListeners(eventNames().clickEvent) || hasEventListeners(eventNames().DOMActivateEvent); … … 2519 2536 { 2520 2537 #if ENABLE(TOUCH_EVENTS) 2521 if ( isElementNode() && toElement(this)->disabled())2538 if (disabled()) 2522 2539 return false; 2523 2540 return hasEventListeners(eventNames().touchstartEvent) || hasEventListeners(eventNames().touchmoveEvent) || hasEventListeners(eventNames().touchcancelEvent) || hasEventListeners(eventNames().touchendEvent); -
trunk/Source/WebCore/dom/Node.h
r145514 r145524 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, … … 660 664 virtual void defaultEventHandler(Event*); 661 665 666 // Used for disabled form elements; if true, prevents mouse events from being dispatched 667 // to event listeners, and prevents DOMActivate events from being sent at all. 668 virtual bool disabled() const; 669 662 670 using TreeShared<Node>::ref; 663 671 using TreeShared<Node>::deref;
Note: See TracChangeset
for help on using the changeset viewer.