HTML-page with <object type="image/svg+xml" data="foo.svg"> often is blank
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Dec 2017 19:15:50 +0000 (19:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Dec 2017 19:15:50 +0000 (19:15 +0000)
commitb40fc2f90903b60db01758f163d1afaa271e51f0
tree09a21798d04d8f1ac0f29c3f794bc95def24dd84
parent8c4edf8278453d606788fa776844219ff4dae786
HTML-page with <object type="image/svg+xml" data="foo.svg"> often is blank
https://bugs.webkit.org/show_bug.cgi?id=180524
<rdar://problem/35920554>

Reviewed by Antti Koivisto.

Source/WebCore:

The test case has script that conditionalizes behavior on whether window.innerWidth/Height
are zero during the load event. We didn't force layout in innerWidth/Height, so whether
they would zero depended on whether the parent frame had laid out, which was timing-sensitive.

Fix by triggering enough layout in the parent document so that the FrameView is resized before
fetching its dimensions in innerWidth/Height. This causes our behavior to match Chrome and Firefox.

Test: fast/dom/iframe-innerWidth.html

* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Add some logging that helped me diagnose this.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::innerHeight const):
(WebCore::DOMWindow::innerWidth const):

LayoutTests:

Adjust a test where the new layout is triggering scrollbar creation.

* fast/dom/iframe-inner-size-scaling-expected.txt:
* fast/dom/iframe-inner-size-scaling.html:
* fast/dom/iframe-innerWidth-expected.txt: Added.
* fast/dom/iframe-innerWidth.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/iframe-inner-size-scaling-expected.txt
LayoutTests/fast/dom/iframe-inner-size-scaling.html
LayoutTests/fast/dom/iframe-innerWidth-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/iframe-innerWidth.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/page/DOMWindow.cpp