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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 190953009: Use new is*Element() helper functions in page/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/core/page/DragController.cpp ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index f32a579c0cb86dbe09e7a2250c02e1d1e726b4f3..affd2aacc371ceef2c1abbdbdeeace3082883880 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -264,7 +264,7 @@ static inline bool shouldRefetchEventTarget(const MouseEventWithHitTestResults&
Node* targetNode = mev.targetNode();
if (!targetNode || !targetNode->parentNode())
return true;
- return targetNode->isShadowRoot() && toShadowRoot(targetNode)->host()->hasTagName(inputTag);
+ return targetNode->isShadowRoot() && isHTMLInputElement(*toShadowRoot(targetNode)->host());
}
EventHandler::EventHandler(LocalFrame* frame)
@@ -1019,7 +1019,7 @@ static LocalFrame* subframeForHitTestResult(const MouseEventWithHitTestResults&
static bool isSubmitImage(Node* node)
{
- return node && node->hasTagName(inputTag) && toHTMLInputElement(node)->isImageButton();
+ return isHTMLInputElement(node) && toHTMLInputElement(node)->isImageButton();
}
// Returns true if the node's editable block is not current focused for editing
@@ -1747,7 +1747,7 @@ static bool targetIsFrame(Node* target, LocalFrame*& frame)
if (!target)
return false;
- if (!target->hasTagName(frameTag) && !target->hasTagName(iframeTag))
+ if (!isHTMLFrameElement(*target) && !isHTMLIFrameElement(*target))
return false;
frame = toHTMLFrameElementBase(target)->contentFrame();
@@ -1921,7 +1921,7 @@ static inline SVGElementInstance* instanceAssociatedWithShadowTreeElement(Node*
return 0;
Element* shadowTreeParentElement = shadowRoot->host();
- if (!shadowTreeParentElement || !shadowTreeParentElement->hasTagName(useTag))
+ if (!isSVGUseElement(shadowTreeParentElement))
return 0;
return toSVGUseElement(shadowTreeParentElement)->instanceForShadowTreeElement(referenceNode);
« no previous file with comments | « Source/core/page/DragController.cpp ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698