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

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

Issue 110173005: Don't dispatch a 'click' event for mousedown/mouseup across form controls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix a test Created 7 years 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/core/dom/Node.h ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 732655e8f2eede7a2e3e5bd54ad32bbe9644484f..abea9efac4e4575ab753b4659de30b15875035a5 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -995,20 +995,20 @@ bool Node::containsIncludingHostElements(const Node& node) const
return false;
}
-Node* Node::commonAncestorOverShadowBoundary(const Node& other)
+Node* Node::commonAncestor(const Node& other, Node* (*parent)(const Node&))
{
if (this == other)
return this;
if (document() != other.document())
return 0;
int thisDepth = 0;
- for (Node* node = this; node; node = node->parentOrShadowHostNode()) {
+ for (Node* node = this; node; node = parent(*node)) {
if (node == &other)
return node;
thisDepth++;
}
int otherDepth = 0;
- for (const Node* node = &other; node; node = node->parentOrShadowHostNode()) {
+ for (const Node* node = &other; node; node = parent(*node)) {
if (node == this)
return this;
otherDepth++;
@@ -1017,16 +1017,16 @@ Node* Node::commonAncestorOverShadowBoundary(const Node& other)
const Node* otherIterator = &other;
if (thisDepth > otherDepth) {
for (int i = thisDepth; i > otherDepth; --i)
- thisIterator = thisIterator->parentOrShadowHostNode();
+ thisIterator = parent(*thisIterator);
} else if (otherDepth > thisDepth) {
for (int i = otherDepth; i > thisDepth; --i)
- otherIterator = otherIterator->parentOrShadowHostNode();
+ otherIterator = parent(*otherIterator);
}
while (thisIterator) {
if (thisIterator == otherIterator)
return thisIterator;
- thisIterator = thisIterator->parentOrShadowHostNode();
- otherIterator = otherIterator->parentOrShadowHostNode();
+ thisIterator = parent(*thisIterator);
+ otherIterator = parent(*otherIterator);
}
ASSERT(!otherIterator);
return 0;
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698