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

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 comments + static_cast for enum conversion 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
Index: Source/core/html/HTMLBodyElement.cpp
diff --git a/Source/core/html/HTMLBodyElement.cpp b/Source/core/html/HTMLBodyElement.cpp
index add8f16a6bb66d79e151ba983d2a664a053642a0..7118e76cf0f55b353ff7a1e0b7788e259e2d8aee 100644
--- a/Source/core/html/HTMLBodyElement.cpp
+++ b/Source/core/html/HTMLBodyElement.cpp
@@ -159,12 +159,20 @@ 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>.
+ int marginWidth = -1;
+ int marginHeight = -1;
+
HTMLFrameOwnerElement* ownerElement = document().ownerElement();
- if (!isHTMLFrameElementBase(ownerElement))
- return;
- HTMLFrameElementBase& ownerFrameElement = toHTMLFrameElementBase(*ownerElement);
- int marginWidth = ownerFrameElement.marginWidth();
- int marginHeight = ownerFrameElement.marginHeight();
+ if (isHTMLFrameElementBase(ownerElement)) {
+ HTMLFrameElementBase& ownerFrameElement = toHTMLFrameElementBase(*ownerElement);
+ marginWidth = ownerFrameElement.marginWidth();
+ marginHeight = ownerFrameElement.marginHeight();
+ } else if (!ownerElement && document().frame()->owner()) {
alexmos 2015/09/02 21:37:05 Same here, is it possible to use document().frame(
lazyboy 2015/09/15 01:40:32 Done.
+ // Our owner is a RemoteBridgeFrameOwner, not a FrameOwnerElement.
+ marginWidth = document().frame()->owner()->marginWidth();
+ marginHeight = document().frame()->owner()->marginHeight();
+ }
+
if (marginWidth != -1)
setIntegralAttribute(marginwidthAttr, marginWidth);
if (marginHeight != -1)

Powered by Google App Engine
This is Rietveld 408576698