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

Unified Diff: Source/core/html/HTMLFrameSetElement.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/HTMLFrameElement.cpp ('k') | Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFrameSetElement.cpp
diff --git a/Source/core/html/HTMLFrameSetElement.cpp b/Source/core/html/HTMLFrameSetElement.cpp
index 7bee506aa19129237a81bbbcc7ab44a94332cc33..8392d4fa3ef314ed6932a0821a58fad4c530b6b3 100644
--- a/Source/core/html/HTMLFrameSetElement.cpp
+++ b/Source/core/html/HTMLFrameSetElement.cpp
@@ -168,21 +168,17 @@ void HTMLFrameSetElement::attach(const AttachContext& context)
{
// Inherit default settings from parent frameset
// FIXME: This is not dynamic.
- for (ContainerNode* node = parentNode(); node; node = node->parentNode()) {
- if (isHTMLFrameSetElement(*node)) {
- HTMLFrameSetElement& frameset = toHTMLFrameSetElement(*node);
- if (!m_frameborderSet)
- m_frameborder = frameset.hasFrameBorder();
- if (m_frameborder) {
- if (!m_borderSet)
- m_border = frameset.border();
- if (!m_borderColorSet)
- m_borderColorSet = frameset.hasBorderColor();
- }
- if (!m_noresize)
- m_noresize = frameset.noResize();
- break;
+ if (HTMLFrameSetElement* frameset = Traversal<HTMLFrameSetElement>::firstAncestor(*this)) {
+ if (!m_frameborderSet)
+ m_frameborder = frameset->hasFrameBorder();
+ if (m_frameborder) {
+ if (!m_borderSet)
+ m_border = frameset->border();
+ if (!m_borderColorSet)
+ m_borderColorSet = frameset->hasBorderColor();
}
+ if (!m_noresize)
+ m_noresize = frameset->noResize();
}
HTMLElement::attach(context);
« no previous file with comments | « Source/core/html/HTMLFrameElement.cpp ('k') | Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698