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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.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/HTMLFrameElementBase.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
index 75865b6889054698df58dfc4a1fdf6b7b5a251e5..994e905583fc7a00c3ec21da410e6a48d5a74f2e 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
@@ -36,6 +36,7 @@
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutPart.h"
#include "core/loader/FrameLoader.h"
+#include "core/loader/FrameLoaderClient.h"
#include "core/page/FocusController.h"
#include "core/page/Page.h"
@@ -45,7 +46,7 @@ using namespace HTMLNames;
HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName, Document& document)
: HTMLFrameOwnerElement(tagName, document)
- , m_scrolling(ScrollbarAuto)
+ , m_scrollingMode(ScrollbarAuto)
, m_marginWidth(-1)
, m_marginHeight(-1)
{
@@ -98,6 +99,14 @@ void HTMLFrameElementBase::openURL(bool replaceCurrentItem)
toLocalFrame(contentFrame())->script().executeScriptIfJavaScriptURL(scriptURL);
}
+void HTMLFrameElementBase::frameOwnerPropertiesChanged()
+{
+ // Don't notify about updates if contentFrame() is null, for example when
+ // the subframe hasn't been created yet.
+ if (contentFrame())
+ document().frame()->loader().client()->didChangeFrameOwnerProperties(this);
+}
+
void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == srcdocAttr) {
@@ -120,17 +129,17 @@ void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const Atomi
// FIXME: If we are already attached, this doesn't check for frame name
// conflicts and generate a unique frame name.
} else if (name == marginwidthAttr) {
- m_marginWidth = value.toInt();
+ setMarginWidth(value.toInt());
// FIXME: If we are already attached, this has no effect.
} else if (name == marginheightAttr) {
- m_marginHeight = value.toInt();
+ setMarginHeight(value.toInt());
// FIXME: If we are already attached, this has no effect.
} else if (name == scrollingAttr) {
// Auto and yes both simply mean "allow scrolling." No means "don't allow scrolling."
if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes"))
- m_scrolling = ScrollbarAuto;
+ setScrollingMode(ScrollbarAuto);
else if (equalIgnoringCase(value, "no"))
- m_scrolling = ScrollbarAlwaysOff;
+ setScrollingMode(ScrollbarAlwaysOff);
// FIXME: If we are already attached, this has no effect.
} else if (name == onbeforeunloadAttr) {
// FIXME: should <frame> elements have beforeunload handlers?
@@ -228,4 +237,22 @@ void HTMLFrameElementBase::defaultEventHandler(Event* event)
HTMLFrameOwnerElement::defaultEventHandler(event);
}
+void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode)
+{
+ m_scrollingMode = scrollbarMode;
+ frameOwnerPropertiesChanged();
+}
+
+void HTMLFrameElementBase::setMarginWidth(int marginWidth)
+{
+ m_marginWidth = marginWidth;
+ frameOwnerPropertiesChanged();
+}
+
+void HTMLFrameElementBase::setMarginHeight(int marginHeight)
+{
+ m_marginHeight = marginHeight;
+ frameOwnerPropertiesChanged();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698