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

Unified Diff: Source/web/WebFrameImpl.cpp

Issue 200723002: Use new is*Element() helper functions more in web/ 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
Index: Source/web/WebFrameImpl.cpp
diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp
index 3676b6fc189921e3255116f5e2e68e73b7437e22..db19a034edb73777e9cc6d8f09200a97c6ede680 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -2226,7 +2226,7 @@ WebFrameImpl* WebFrameImpl::fromFrame(LocalFrame* frame)
WebFrameImpl* WebFrameImpl::fromFrameOwnerElement(Element* element)
{
// FIXME: Why do we check specifically for <iframe> and <frame> here? Why can't we get the WebFrameImpl from an <object> element, for example.
- if (!element || !element->isFrameOwnerElement() || (!element->hasTagName(HTMLNames::iframeTag) && !element->hasTagName(HTMLNames::frameTag)))
+ if (!element || !element->isFrameOwnerElement() || (!isHTMLIFrameElement(*element) && !isHTMLFrameElement(*element)))
return 0;
return fromFrame(toHTMLFrameOwnerElement(element)->contentFrame());
}
@@ -2264,7 +2264,8 @@ void WebFrameImpl::setFindEndstateFocusAndSelection()
Node* node = m_activeMatch->firstNode();
if (node && node->isInShadowTree()) {
Node* host = node->deprecatedShadowAncestorNode();
adamk 2014/03/14 20:49:12 This could be changed to: if (node) { if (Node*
Inactive 2014/03/14 21:07:17 Done.
- if (host->hasTagName(HTMLNames::inputTag) || host->hasTagName(HTMLNames::textareaTag))
+ ASSERT(host);
+ if (isHTMLInputElement(*host) || isHTMLTextAreaElement(*host))
node = host;
}
for (; node; node = node->parentNode()) {

Powered by Google App Engine
This is Rietveld 408576698