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 |