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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.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: sync + fix html_viewer compile Created 5 years, 2 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: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index c5e86452bda6fdf90a35d11a7361475580564615..688bb4d1f3e58e2cb6b141dd7de08000337287e8 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/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)
dcheng 2015/10/08 06:43:15 Can you help me understand why we moved this from
lazyboy 2015/10/08 17:57:40 The scrollingMode() getter is in FrameOwner super
+{
+ 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));

Powered by Google App Engine
This is Rietveld 408576698