RESOLVED FIXED 212984
Subframes should not autosize independently
https://bugs.webkit.org/show_bug.cgi?id=212984
Summary Subframes should not autosize independently
Timothy Hatcher
Reported 2020-06-09 12:44:29 PDT
The intrinsicContentsSizeChanged client call should only fire for the main frame.
Attachments
Patch (3.47 KB, patch)
2020-06-09 13:40 PDT, Timothy Hatcher
no flags
Patch (3.33 KB, patch)
2020-06-10 02:04 PDT, Antoine Quint
no flags
Patch (3.29 KB, patch)
2020-06-10 02:06 PDT, Antoine Quint
no flags
Patch (3.67 KB, patch)
2020-06-10 09:23 PDT, Antoine Quint
no flags
Patch (5.14 KB, patch)
2020-06-10 10:15 PDT, Antoine Quint
no flags
Radar WebKit Bug Importer
Comment 1 2020-06-09 12:44:39 PDT
Radar WebKit Bug Importer
Comment 2 2020-06-09 12:45:06 PDT
Timothy Hatcher
Comment 3 2020-06-09 12:57:36 PDT
Timothy Hatcher
Comment 4 2020-06-09 13:40:18 PDT
Tim Horton
Comment 5 2020-06-09 13:49:55 PDT
Comment on attachment 401468 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401468&action=review > Source/WebCore/ChangeLog:10 > + (WebCore::FrameView::autoSizeIfEnabled): Only call the client for the main frame. This seems like we already got wayyyyy too far. Shouldn't we not even propagate the autosizing bit to subframes?
Timothy Hatcher
Comment 6 2020-06-09 14:10:37 PDT
Comment on attachment 401468 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401468&action=review >> Source/WebCore/ChangeLog:10 >> + (WebCore::FrameView::autoSizeIfEnabled): Only call the client for the main frame. > > This seems like we already got wayyyyy too far. Shouldn't we not even propagate the autosizing bit to subframes? The autosize code is called for the normal AutoSizeMode::FixedWidth case too, which is what the subframes are using.
zalan
Comment 7 2020-06-09 14:42:39 PDT
what's the expected subframe behavior with autosizing? How does the mainframe react to a resized subframe?
Timothy Hatcher
Comment 8 2020-06-09 14:46:12 PDT
(In reply to zalan from comment #7) > what's the expected subframe behavior with autosizing? How does the > mainframe react to a resized subframe? We don't use content autosizing for subframes. This client call is only useful for the main frame, the WebKit layer only expects it for the main frame.
Antoine Quint
Comment 9 2020-06-09 15:18:21 PDT
Why not bail out of FrameView::autoSizeIfEnabled() if this FrameView's frame isn't the main frame?
Timothy Hatcher
Comment 10 2020-06-09 15:58:37 PDT
(In reply to Antoine Quint from comment #9) > Why not bail out of FrameView::autoSizeIfEnabled() if this FrameView's frame > isn't the main frame? If that is the best option then, sure. I wasn't comfortable doing that. I just know the client and WebKit isn't expecting to be called for sub-frames. Someone else is free to make that change if that would be better for this code.
Antoine Quint
Comment 11 2020-06-10 02:04:02 PDT
Antoine Quint
Comment 12 2020-06-10 02:06:41 PDT
Simon Fraser (smfr)
Comment 13 2020-06-10 07:56:49 PDT
Comment on attachment 401522 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401522&action=review > Source/WebCore/page/FrameView.cpp:3412 > + if (!frame().isMainFrame()) > + return; Why did we ever get here for the non-main frame? How did m_shouldAutoSize get set on a non-main frame?
zalan
Comment 14 2020-06-10 07:58:47 PDT
(In reply to Simon Fraser (smfr) from comment #13) > Comment on attachment 401522 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=401522&action=review > > > Source/WebCore/page/FrameView.cpp:3412 > > + if (!frame().isMainFrame()) > > + return; > > Why did we ever get here for the non-main frame? How did m_shouldAutoSize > get set on a non-main frame? Yeah, maybe a better fix would be to not let autosize enabled on subframes and assert for mainframe here.
Antoine Quint
Comment 15 2020-06-10 09:23:01 PDT
Simon Fraser (smfr)
Comment 16 2020-06-10 09:53:39 PDT
Comment on attachment 401547 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401547&action=review > Source/WebCore/page/FrameView.cpp:4599 > + if (!frame().isMainFrame()) > + return; This should be ASSERT(frame().isMainFrame()); and you should find who's calling this on subframes and stop them from doing so.
Antoine Quint
Comment 17 2020-06-10 10:15:23 PDT
EWS
Comment 18 2020-06-10 13:37:08 PDT
Committed r262856: <https://trac.webkit.org/changeset/262856> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401551 [details].
Note You need to log in before you can comment on or make changes to this bug.