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/core/html/HTMLFrameElement.cpp

Issue 201293002: Add Traversal<*Element>::firstAncestor() API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add firstAncestorOrSelf() 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/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLFrameSetElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFrameElement.cpp
diff --git a/Source/core/html/HTMLFrameElement.cpp b/Source/core/html/HTMLFrameElement.cpp
index b5bb3665069e11b028d97c2fb3fb21dae9f246cf..e12efe382bd66bdbfc99e671e346135f8e7e8005 100644
--- a/Source/core/html/HTMLFrameElement.cpp
+++ b/Source/core/html/HTMLFrameElement.cpp
@@ -56,15 +56,6 @@ RenderObject* HTMLFrameElement::createRenderer(RenderStyle*)
return new RenderFrame(this);
}
-static inline HTMLFrameSetElement* containingFrameSetElement(Node* node)
-{
- while ((node = node->parentNode())) {
- if (isHTMLFrameSetElement(*node))
- return toHTMLFrameSetElement(node);
- }
- return 0;
-}
-
bool HTMLFrameElement::noResize() const
{
return hasAttribute(noresizeAttr);
@@ -74,7 +65,7 @@ void HTMLFrameElement::attach(const AttachContext& context)
{
HTMLFrameElementBase::attach(context);
- if (HTMLFrameSetElement* frameSetElement = containingFrameSetElement(this)) {
+ if (HTMLFrameSetElement* frameSetElement = Traversal<HTMLFrameSetElement>::firstAncestor(*this)) {
if (!m_frameBorderSet)
m_frameBorder = frameSetElement->hasFrameBorder();
}
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLFrameSetElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698