Chromium Code Reviews| 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 eb81d639c4de017fbb4adf4c46265078a85c0f43..8250eb7b71c38d06d1ee24fbb9f961dd0df4b247 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
| @@ -38,6 +38,7 @@ |
| #include "core/loader/FrameLoaderClient.h" |
| #include "core/page/FocusController.h" |
| #include "core/page/Page.h" |
| +#include "wtf/Optional.h" |
|
bokan
2016/11/21 16:11:36
Remove.
|
| namespace blink { |
| @@ -117,8 +118,9 @@ void HTMLFrameElementBase::openURL(bool replaceCurrentItem) { |
| void HTMLFrameElementBase::frameOwnerPropertiesChanged() { |
| // Don't notify about updates if contentFrame() is null, for example when |
| // the subframe hasn't been created yet. |
| - if (contentFrame()) |
| + if (contentFrame()) { |
|
bokan
2016/11/21 16:11:36
Nit: no braces.
|
| document().frame()->loader().client()->didChangeFrameOwnerProperties(this); |
| + } |
| } |
| void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, |
| @@ -141,16 +143,10 @@ void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, |
| m_frameName = value; |
| } else if (name == nameAttr) { |
| m_frameName = value; |
| - // FIXME: If we are already attached, this doesn't actually change the |
| - // frame's name. |
| - // FIXME: If we are already attached, this doesn't check for frame name |
| - // conflicts and generate a unique frame name. |
| } else if (name == marginwidthAttr) { |
| setMarginWidth(value.toInt()); |
| - // FIXME: If we are already attached, this has no effect. |
| } else if (name == marginheightAttr) { |
| 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." |
| @@ -158,7 +154,6 @@ void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, |
| setScrollingMode(ScrollbarAuto); |
| else if (equalIgnoringCase(value, "no")) |
| setScrollingMode(ScrollbarAlwaysOff); |
| - // FIXME: If we are already attached, this has no effect. |
| } else if (name == onbeforeunloadAttr) { |
| // FIXME: should <frame> elements have beforeunload handlers? |
| setAttributeEventListener( |
| @@ -253,16 +248,37 @@ void HTMLFrameElementBase::defaultEventHandler(Event* event) { |
| } |
| void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) { |
| + if (m_scrollingMode == scrollbarMode) |
| + return; |
| + |
| + if (contentDocument()) { |
| + contentDocument()->didChangeFrameOwnerProperties( |
| + m_marginWidth, m_marginHeight, scrollbarMode); |
| + } |
| m_scrollingMode = scrollbarMode; |
| frameOwnerPropertiesChanged(); |
| } |
| void HTMLFrameElementBase::setMarginWidth(int marginWidth) { |
| + if (m_marginWidth == marginWidth) |
| + return; |
| + |
| + if (contentDocument()) { |
| + contentDocument()->didChangeFrameOwnerProperties( |
| + marginWidth, m_marginHeight, m_scrollingMode); |
| + } |
| m_marginWidth = marginWidth; |
| frameOwnerPropertiesChanged(); |
| } |
| void HTMLFrameElementBase::setMarginHeight(int marginHeight) { |
| + if (m_marginHeight == marginHeight) |
| + return; |
| + |
| + if (contentDocument()) { |
| + contentDocument()->didChangeFrameOwnerProperties( |
| + m_marginWidth, marginHeight, m_scrollingMode); |
| + } |
| m_marginHeight = marginHeight; |
| frameOwnerPropertiesChanged(); |
| } |