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

Unified Diff: Source/core/html/HTMLBodyElement.cpp

Issue 1319863006: (blink) Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address nits Created 5 years, 3 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/frame/LocalFrame.cpp ('k') | Source/core/html/HTMLFrameElementBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLBodyElement.cpp
diff --git a/Source/core/html/HTMLBodyElement.cpp b/Source/core/html/HTMLBodyElement.cpp
index add8f16a6bb66d79e151ba983d2a664a053642a0..64f599f3be1ff19bb607a4fa27e8eb86bada0f7c 100644
--- a/Source/core/html/HTMLBodyElement.cpp
+++ b/Source/core/html/HTMLBodyElement.cpp
@@ -159,16 +159,14 @@ void HTMLBodyElement::didNotifySubtreeInsertionsToDocument()
// FIXME: It's surprising this is web compatible since it means a
// marginwidth and marginheight attribute can magically appear on the <body>
// of all documents embedded through <iframe> or <frame>.
- HTMLFrameOwnerElement* ownerElement = document().ownerElement();
- if (!isHTMLFrameElementBase(ownerElement))
- return;
- HTMLFrameElementBase& ownerFrameElement = toHTMLFrameElementBase(*ownerElement);
- int marginWidth = ownerFrameElement.marginWidth();
- int marginHeight = ownerFrameElement.marginHeight();
- if (marginWidth != -1)
- setIntegralAttribute(marginwidthAttr, marginWidth);
- if (marginHeight != -1)
- setIntegralAttribute(marginheightAttr, marginHeight);
+ if (document().frame() && document().frame()->owner()) {
+ int marginWidth = document().frame()->owner()->marginWidth();
+ int marginHeight = document().frame()->owner()->marginHeight();
+ if (marginWidth != -1)
+ setIntegralAttribute(marginwidthAttr, marginWidth);
+ if (marginHeight != -1)
+ setIntegralAttribute(marginheightAttr, marginHeight);
+ }
}
bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/html/HTMLFrameElementBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698