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 cebcc0b20d7aba39bb64b8c0c9697deed0f4a954..8e9757fc9e54137bca41afe801c7c45c4abd4b67 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp |
| @@ -221,6 +221,13 @@ void HTMLFrameOwnerElement::disposeWidgetSoon(Widget* widget) { |
| widget->dispose(); |
| } |
| +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(this); |
| +} |
| + |
| void HTMLFrameOwnerElement::dispatchLoad() { |
| dispatchScopedEvent(Event::create(EventTypeNames::load)); |
| } |
| @@ -243,6 +250,16 @@ void HTMLFrameOwnerElement::setWidget(Widget* widget) { |
| if (widget == m_widget) |
| return; |
| + Document* doc = contentDocument(); |
|
dcheng
2016/12/15 21:35:04
I feel like setWidget() is a less typical choice t
esprehn
2016/12/15 21:45:56
Since we already have all of this machinery, and s
|
| + if (doc && doc->frame()) { |
|
dcheng
2016/12/15 21:35:04
I don't think it's possible to have a contentDocum
erikchen
2016/12/16 20:56:12
This happens on creation. Attached a partial stack
|
| + bool isDisplayNone = this->isDisplayNone(); |
| + bool willBeDisplayNone = !widget; |
| + if (isDisplayNone != willBeDisplayNone) { |
| + doc->willChangeFrameOwnerProperties(marginWidth(), marginHeight(), |
| + scrollingMode(), willBeDisplayNone); |
| + } |
| + } |
| + |
| if (m_widget) { |
| if (m_widget->parent()) |
| moveWidgetToParentSoon(m_widget.get(), 0); |
| @@ -250,6 +267,7 @@ void HTMLFrameOwnerElement::setWidget(Widget* widget) { |
| } |
| m_widget = widget; |
| + frameOwnerPropertiesChanged(); |
| LayoutPart* layoutPart = toLayoutPart(layoutObject()); |
| LayoutPartItem layoutPartItem = LayoutPartItem(layoutPart); |