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

Unified Diff: Source/core/html/HTMLFrameOwnerElement.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/html/HTMLFrameOwnerElement.h ('k') | Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFrameOwnerElement.cpp
diff --git a/Source/core/html/HTMLFrameOwnerElement.cpp b/Source/core/html/HTMLFrameOwnerElement.cpp
index c5e86452bda6fdf90a35d11a7361475580564615..688bb4d1f3e58e2cb6b141dd7de08000337287e8 100644
--- a/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -109,6 +109,9 @@ HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum
, m_contentFrame(nullptr)
, m_widget(nullptr)
, m_sandboxFlags(SandboxNone)
+ , m_scrollingMode(ScrollbarAuto)
+ , m_marginWidth(-1)
+ , m_marginHeight(-1)
{
}
@@ -191,11 +194,46 @@ void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags)
document().frame()->loader().client()->didChangeSandboxFlags(contentFrame(), flags);
}
+void HTMLFrameOwnerElement::setScrollingMode(ScrollbarMode scrollbarMode)
+{
+ m_scrollingMode = scrollbarMode;
+ if (isPluginElement())
+ return;
+
+ frameOwnerPropertiesChanged();
+}
+
+void HTMLFrameOwnerElement::setMarginWidth(int marginWidth)
+{
+ m_marginWidth = marginWidth;
+ if (isPluginElement())
+ return;
+
+ frameOwnerPropertiesChanged();
+}
+
+void HTMLFrameOwnerElement::setMarginHeight(int marginHeight)
+{
+ m_marginHeight = marginHeight;
+ if (isPluginElement())
+ return;
+
+ frameOwnerPropertiesChanged();
+}
+
bool HTMLFrameOwnerElement::isKeyboardFocusable() const
{
return m_contentFrame && HTMLElement::isKeyboardFocusable();
}
+void HTMLFrameOwnerElement::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(contentFrame(), m_scrollingMode, m_marginWidth, m_marginHeight);
+}
+
void HTMLFrameOwnerElement::dispatchLoad()
{
dispatchEvent(Event::create(EventTypeNames::load));
« no previous file with comments | « Source/core/html/HTMLFrameOwnerElement.h ('k') | Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698