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); |