Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCheck that an iframe is in a document with a browsing context before processing src #13965
Conversation
highfive
commented
Oct 28, 2016
highfive
commented
Oct 28, 2016
|
cc @Ms2ger |
| @@ -771,6 +771,20 @@ impl Node { | |||
| self.owner_doc().is_html_document() | |||
| } | |||
|
|
|||
| // https://dom.spec.whatwg.org/#in-a-document-tree | |||
| pub fn is_in_a_document_tree(&self) -> bool { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Oct 31, 2016
Author
Member
The problem is that is_in_doc returns true if the node is in a document fragment.
| } | ||
|
|
||
| pub fn is_in_a_document_tree_with_a_browsing_context(&self) -> bool { | ||
| self.inclusive_ancestors().last() |
This comment has been minimized.
This comment has been minimized.
Ms2ger
Oct 31, 2016
Contributor
This can be self.is_in_doc() && self.owner_doc().browsing_context().is_some()
This comment has been minimized.
This comment has been minimized.
|
@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 |
| @@ -768,7 +768,11 @@ impl Node { | |||
| } | |||
|
|
|||
| pub fn is_in_html_doc(&self) -> bool { | |||
| self.owner_doc().is_html_document() | |||
| self.is_in_doc() && self.owner_doc().is_html_document() | |||
This comment has been minimized.
This comment has been minimized.
Ms2ger
Nov 3, 2016
Contributor
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.
This comment has been minimized.
This comment has been minimized.
75845b2
to
5ea60c0
|
r=me if you squash all commits |
5ea60c0
to
330953a
|
@Ms2ger thanks! @bors-servo r=Ms2ger |
|
|
…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 |
…processing src.
330953a
to
1803a58
|
Rebased to unstick homu. |
|
@bors-servo r=Ms2ger |
|
|
…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 -->
|
|
asajeffrey commentedOct 28, 2016
•
edited by larsbergstrom
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