Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: Source/WebCore/dom/Node.cpp

Issue 12703032: Revert 146744 "Refactoring: Pull Node::disabled() and Node::isIn..." (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1453/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/dom/Node.h ('k') | Source/WebCore/rendering/RenderThemeMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Node.cpp
===================================================================
--- Source/WebCore/dom/Node.cpp (revision 146891)
+++ Source/WebCore/dom/Node.cpp (working copy)
@@ -903,6 +903,14 @@
return this;
}
+#if ENABLE(DIALOG_ELEMENT)
+bool Node::isInert() const
+{
+ Element* dialog = document()->activeModalDialog();
+ return dialog && !containsIncludingShadowDOM(dialog) && !dialog->containsIncludingShadowDOM(this);
+}
+#endif
+
unsigned Node::nodeIndex() const
{
Node *_tempNode = previousSibling();
@@ -2310,7 +2318,7 @@
if (!hasEventTargetData())
return;
- if (isElementNode() && toElement(this)->disabled() && event->isMouseEvent())
+ if (disabled() && event->isMouseEvent())
return;
fireEventListeners(event);
@@ -2450,6 +2458,15 @@
dispatchScopedEvent(Event::create(eventNames().inputEvent, true, false));
}
+bool Node::disabled() const
+{
+#if ENABLE(DIALOG_ELEMENT)
+ if (isInert())
+ return true;
+#endif
+ return false;
+}
+
void Node::defaultEventHandler(Event* event)
{
if (event->target() != this)
@@ -2509,14 +2526,14 @@
bool Node::willRespondToMouseMoveEvents()
{
- if (isElementNode() && toElement(this)->disabled())
+ if (disabled())
return false;
return hasEventListeners(eventNames().mousemoveEvent) || hasEventListeners(eventNames().mouseoverEvent) || hasEventListeners(eventNames().mouseoutEvent);
}
bool Node::willRespondToMouseClickEvents()
{
- if (isElementNode() && toElement(this)->disabled())
+ if (disabled())
return false;
return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListeners(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent) || hasEventListeners(eventNames().clickEvent) || hasEventListeners(eventNames().DOMActivateEvent);
}
@@ -2524,7 +2541,7 @@
bool Node::willRespondToTouchEvents()
{
#if ENABLE(TOUCH_EVENTS)
- if (isElementNode() && toElement(this)->disabled())
+ if (disabled())
return false;
return hasEventListeners(eventNames().touchstartEvent) || hasEventListeners(eventNames().touchmoveEvent) || hasEventListeners(eventNames().touchcancelEvent) || hasEventListeners(eventNames().touchendEvent);
#else
« no previous file with comments | « Source/WebCore/dom/Node.h ('k') | Source/WebCore/rendering/RenderThemeMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698