New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window should own Location, Document shouldn't #18578
Window should own Location, Document shouldn't #18578
Conversation
@bors-servo r+ Looks good. |
📌 Commit 211b008 has been approved by |
components/script/dom/document.rs
Outdated
@@ -3438,7 +3436,7 @@ impl DocumentMethods for Document { | |||
|
|||
// https://html.spec.whatwg.org/multipage/#dom-document-location | |||
fn GetLocation(&self) -> Option<Root<Location>> { | |||
self.browsing_context().map(|_| self.location.or_init(|| Location::new(&self.window))) | |||
self.browsing_context().map(|_| self.window.Location()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the document needs to be checked whether it's fully active, instead of checking whether there's a browsing context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@bors-servo r- |
211b008
to
3d00b0e
Compare
📌 Commit 3d00b0e has been approved by |
…jang Window should own Location, Document shouldn't <!-- Please describe your changes on the following line: --> Document shouldn't own location, Window should. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18438 - [X] These changes do not require tests because it's an intermittent <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18578) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Document shouldn't own location, Window should.
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is