aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-03 14:03:19 -0500
committerGitHub <noreply@github.com>2016-11-03 14:03:19 -0500
commit4984a83f675484a752e305f2d592f6d9e774c4fb (patch)
tree07f4fe15e08998c6f4e47e6b33ba87a9ec88a327 /components/script/dom/node.rs
parent05f4512433c108d00b7bac3a50243aefea7f153c (diff)
parent1803a585e5eb388830efac7e80d582f2fa4eb652 (diff)
downloadservo-4984a83f675484a752e305f2d592f6d9e774c4fb.tar.gz
servo-4984a83f675484a752e305f2d592f6d9e774c4fb.zip
Auto merge of #13965 - asajeffrey:script-iframe-check-document-browsing-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 -->
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 4ec6c878ad5..824cb671240 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -771,6 +771,10 @@ impl Node {
self.owner_doc().is_html_document()
}
+ pub fn is_in_doc_with_browsing_context(&self) -> bool {
+ self.is_in_doc() && self.owner_doc().browsing_context().is_some()
+ }
+
pub fn children(&self) -> NodeSiblingIterator {
NodeSiblingIterator {
current: self.GetFirstChild(),