Check that an iframe is in a document with a browsing context before processing src#13965
Conversation
|
cc @Ms2ger |
components/script/dom/node.rs
Outdated
| } | ||
|
|
||
| // https://dom.spec.whatwg.org/#in-a-document-tree | ||
| pub fn is_in_a_document_tree(&self) -> bool { |
There was a problem hiding this comment.
This duplicates is_in_doc() very slowly; please remove.
There was a problem hiding this comment.
The problem is that is_in_doc returns true if the node is in a document fragment.
components/script/dom/node.rs
Outdated
| } | ||
|
|
||
| pub fn is_in_a_document_tree_with_a_browsing_context(&self) -> bool { | ||
| self.inclusive_ancestors().last() |
There was a problem hiding this comment.
This can be self.is_in_doc() && self.owner_doc().browsing_context().is_some()
|
@Ms2ger should I fix |
That sounds like a pretty serious bug. Are you sure? CC @nox. |
That doesn't sound true to me. Where did you find that? |
|
OK, I'll go and check. |
|
Unsurprisingly, you are both right. Hmm. I could have sworn I was getting an error because of this. Oh well, I'll fix this. |
|
I remember what the issue was! It's that |
components/script/dom/node.rs
Outdated
|
|
||
| pub fn is_in_html_doc(&self) -> bool { | ||
| self.owner_doc().is_html_document() | ||
| self.is_in_doc() && self.owner_doc().is_html_document() |
There was a problem hiding this comment.
Unfortunately this needs to return true if is_in_doc() is false. Maybe you should just inline it into its only caller, to avoid confusion.
75845b2 to
5ea60c0
Compare
|
r=me if you squash all commits |
5ea60c0 to
330953a
Compare
|
@Ms2ger thanks! @bors-servo r=Ms2ger |
|
📌 Commit 330953a has been approved by |
…ng-context, r=Ms2ger Check that an iframe is in a document with a browsing context before processing src <!-- Please describe your changes on the following line: --> Check that an iframe is in a document with a browsing context before processing src. --- <!-- 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 #13964. - [X] These changes do not require tests because this is already tested by https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/old-tests/submission/Opera/script_scheduling/034.html <!-- 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/13965) <!-- Reviewable:end -->
|
@bors-servo clean force retry |
330953a to
1803a58
Compare
|
Rebased to unstick homu. |
|
@bors-servo r=Ms2ger |
|
📌 Commit 1803a58 has been approved by |
|
⌛ Testing commit 1803a58 with merge 4984a83... |
…ng-context, r=Ms2ger Check that an iframe is in a document with a browsing context before processing src <!-- Please describe your changes on the following line: --> Check that an iframe is in a document with a browsing context before processing src. --- <!-- 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 #13964. - [X] These changes do not require tests because this is already tested by https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/old-tests/submission/Opera/script_scheduling/034.html <!-- 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/13965) <!-- Reviewable:end -->
|
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
Check that an iframe is in a document with a browsing context before processing src.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is