RESOLVED FIXED 166735
Give RenderObject a Page& getter.
https://bugs.webkit.org/show_bug.cgi?id=166735
Summary Give RenderObject a Page& getter.
Andreas Kling
Reported 2017-01-05 11:41:55 PST
Now that we're getting better at felling render trees, it seems like we can make some promises about there always being a Page while a tree is standing. Having a Page& RenderObject::page() will get rid of a ton of sketchy branches.
Attachments
Patch for EWS (54.66 KB, patch)
2017-01-05 11:44 PST, Andreas Kling
no flags
Patch II for EWS (74.73 KB, patch)
2017-01-05 12:34 PST, Andreas Kling
no flags
Patch (77.00 KB, patch)
2017-01-05 13:14 PST, Andreas Kling
no flags
Patch (70.55 KB, patch)
2017-01-05 13:23 PST, Andreas Kling
darin: review+
Patch for landing (71.55 KB, patch)
2017-01-06 05:30 PST, Andreas Kling
no flags
Andreas Kling
Comment 1 2017-01-05 11:44:48 PST
Created attachment 298118 [details] Patch for EWS
Andreas Kling
Comment 2 2017-01-05 12:34:16 PST
Created attachment 298123 [details] Patch II for EWS
Andreas Kling
Comment 3 2017-01-05 13:14:24 PST
Andreas Kling
Comment 4 2017-01-05 13:23:35 PST
Darin Adler
Comment 5 2017-01-05 23:45:37 PST
Comment on attachment 298128 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=298128&action=review Almost enough to make me think I don’t need to keep moving things from Page to MainFrame. > Source/WebCore/rendering/RenderLayerCompositor.cpp:4145 > +Page& RenderLayerCompositor::page() const > +{ > + return m_renderView.page(); > +} Can this be inlined, or would that require adding more includes? > Source/WebCore/rendering/RenderObject.cpp:146 > RenderTheme& RenderObject::theme() const > { > - ASSERT(document().page()); > - return document().page()->theme(); > + return page().theme(); > } Can this be inlined, or would that require adding more includes? > Source/WebCore/rendering/RenderObject.h:1013 > + ASSERT(frame().page()); I would love it if we added a brief comment here explaining why this is guaranteed to be non-null. > Source/WebCore/rendering/RenderTheme.cpp:789 > + return o.page().focusController().isActive(); How about the word object instead of "o"?
Andreas Kling
Comment 6 2017-01-06 05:29:44 PST
(In reply to comment #5) > Comment on attachment 298128 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=298128&action=review > > Almost enough to make me think I don’t need to keep moving things from Page > to MainFrame. Almost! > > Source/WebCore/rendering/RenderLayerCompositor.cpp:4145 > > +Page& RenderLayerCompositor::page() const > > +{ > > + return m_renderView.page(); > > +} > > Can this be inlined, or would that require adding more includes? Yeah, include cycle problem. We can solve it but I don't think it's important. > > Source/WebCore/rendering/RenderObject.cpp:146 > > RenderTheme& RenderObject::theme() const > > { > > - ASSERT(document().page()); > > - return document().page()->theme(); > > + return page().theme(); > > } > > Can this be inlined, or would that require adding more includes? Same here. > > Source/WebCore/rendering/RenderObject.h:1013 > > + ASSERT(frame().page()); > > I would love it if we added a brief comment here explaining why this is > guaranteed to be non-null. Ok, I will add a comment here, and a longer comment in Frame::willDetachPage().
Andreas Kling
Comment 7 2017-01-06 05:30:07 PST
Created attachment 298197 [details] Patch for landing
WebKit Commit Bot
Comment 8 2017-01-06 06:06:28 PST
Comment on attachment 298197 [details] Patch for landing Clearing flags on attachment: 298197 Committed r210436: <http://trac.webkit.org/changeset/210436>
WebKit Commit Bot
Comment 9 2017-01-06 06:06:32 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.