Chromium Code Reviews| 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)); |