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

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

Issue 1307013004: Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_unittests compile fix Created 5 years, 1 month 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: third_party/WebKit/Source/core/html/HTMLBodyElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLBodyElement.cpp b/third_party/WebKit/Source/core/html/HTMLBodyElement.cpp
index add8f16a6bb66d79e151ba983d2a664a053642a0..64f599f3be1ff19bb607a4fa27e8eb86bada0f7c 100644
--- a/third_party/WebKit/Source/core/html/HTMLBodyElement.cpp
+++ b/third_party/WebKit/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 | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/html/HTMLFrameElementBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698