Bug 190341 - Have DOMWindowProperty get is frame from its associated DOMWindow
Summary: Have DOMWindowProperty get is frame from its associated DOMWindow
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-07 15:10 PDT by Chris Dumez
Modified: 2018-10-08 10:17 PDT (History)
7 users (show)

See Also:


Attachments
Patch (107.13 KB, patch)
2018-10-07 15:12 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (109.18 KB, patch)
2018-10-07 15:53 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-10-07 15:10:53 PDT
Have DOMWindowProperty get is frame from its associated DOMWindow, instead of having its own m_frame that can potentially get out-of-sync.
Comment 1 Chris Dumez 2018-10-07 15:12:32 PDT
Created attachment 351745 [details]
Patch
Comment 2 Chris Dumez 2018-10-07 15:53:33 PDT
Created attachment 351747 [details]
Patch
Comment 3 Alex Christensen 2018-10-08 09:40:13 PDT
Comment on attachment 351747 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=351747&action=review

> Source/WebCore/page/DOMWindow.cpp:686
> -Screen* DOMWindow::screen() const
> +Screen* DOMWindow::screen()

Does this change really introduce mutating the DOMWindow when we access its screen?  Same for other const removals.  I see no good reason for them.
Comment 4 Chris Dumez 2018-10-08 09:41:27 PDT
(In reply to Alex Christensen from comment #3)
> Comment on attachment 351747 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=351747&action=review
> 
> > Source/WebCore/page/DOMWindow.cpp:686
> > -Screen* DOMWindow::screen() const
> > +Screen* DOMWindow::screen()
> 
> Does this change really introduce mutating the DOMWindow when we access its
> screen?  Same for other const removals.  I see no good reason for them.

I needed to drop the const for correctness because the DOMWindow passes itself to the DOMWindowProperties when constructing them as a DOMWindow&.
Comment 5 Chris Dumez 2018-10-08 09:55:31 PDT
(In reply to Chris Dumez from comment #4)
> (In reply to Alex Christensen from comment #3)
> > Comment on attachment 351747 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=351747&action=review
> > 
> > > Source/WebCore/page/DOMWindow.cpp:686
> > > -Screen* DOMWindow::screen() const
> > > +Screen* DOMWindow::screen()
> > 
> > Does this change really introduce mutating the DOMWindow when we access its
> > screen?  Same for other const removals.  I see no good reason for them.
> 
> I needed to drop the const for correctness because the DOMWindow passes
> itself to the DOMWindowProperties when constructing them as a DOMWindow&.

The only reason they were const before is because the DOMWindow was passing its frame to the DOMWindowProperties when constructing them and the frame() getter is marked const.
Comment 6 Chris Dumez 2018-10-08 10:12:45 PDT
Comment on attachment 351747 [details]
Patch

Clearing flags on attachment: 351747

Committed r236917: <https://trac.webkit.org/changeset/236917>
Comment 7 Chris Dumez 2018-10-08 10:12:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-10-08 10:14:10 PDT
<rdar://problem/45091778>