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 upAdd contentDocument support for HTMLIFrameElement. Fixes #3808. #3953
Conversation
hoppipolla-critic-bot
commented
Nov 10, 2014
|
Critic review: https://critic.hoppipolla.co.uk/r/3144 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
8bd59d7
to
1d85cd5
|
I would be exceedingly surprised if the test suddenly started to work. The fundamental problem identified in #2122 should still be present. |
|
Worth a try, anyways! |
…ntDocument, r=jdm Because of #2122 I cannot write test for this right now because it will be failing randomly due to that iframe issue. However, if it doesn't fail due to that issue a test like this: ```html <html> <head> <meta charset="utf8" /> <script src="harness.js"></script> <title>Iframe contentDocument test.</title> </head> <body> <iframe src="test_iframe_contentDocument_inner.html" id="iframe"></iframe> <script> waitForExplicitFinish(); var timeout = 100; var iframe = document.getElementById('iframe'); function test_contentWindow() { if (!iframe.contentWindow) { // Iframe not loaded yet, try again. // No load event for iframe, insert bug number here. setTimeout(test_contentWindow, timeout); return; } is(iframe.contentDocument.getElementById('test').textContent, 'value'); finish(); } test_contentWindow(); </script> </body> </html> ``` where inner is simply: ```html <html><body><div id="test">value</div></body></html> ``` passes. I have added `SameOrigin` method to the `UrlHelper`. I wanted to reuse it in [`constellation.rs` same_script check](https://github.com/servo/servo/blob/f0184a2d011e12845258a242d2d2f6b8b504a28d/components/compositing/constellation.rs#L625) but I it didn't want to compile saying ``` error: unresolved import `dom::urlhelper::UrlHelper`. Maybe a missing `extern crate dom`? ``` So I didn't include it in this PR for now. There is more discussion about the cross origin iframes in [another issue](#3939). In this PR I just added same origin check.
8d168f3
to
fb8a45c
|
@jdm, there were some failures, can we try again? |
This comment has been minimized.
This comment has been minimized.
Manishearth
commented on fb8a45c
Nov 14, 2014
|
r=jdm |
This comment has been minimized.
This comment has been minimized.
|
saw approval from jdm |
This comment has been minimized.
This comment has been minimized.
|
merging neojski/servo/implement-HTMLIFrameElement.contentDocument = fb8a45c into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
all tests pass: |
This comment has been minimized.
This comment has been minimized.
|
fast-forwarding master to auto = 85a2f0b |
…ntDocument, r=jdm Because of #2122 I cannot write test for this right now because it will be failing randomly due to that iframe issue. However, if it doesn't fail due to that issue a test like this: ```html <html> <head> <meta charset="utf8" /> <script src="harness.js"></script> <title>Iframe contentDocument test.</title> </head> <body> <iframe src="test_iframe_contentDocument_inner.html" id="iframe"></iframe> <script> waitForExplicitFinish(); var timeout = 100; var iframe = document.getElementById('iframe'); function test_contentWindow() { if (!iframe.contentWindow) { // Iframe not loaded yet, try again. // No load event for iframe, insert bug number here. setTimeout(test_contentWindow, timeout); return; } is(iframe.contentDocument.getElementById('test').textContent, 'value'); finish(); } test_contentWindow(); </script> </body> </html> ``` where inner is simply: ```html <html><body><div id="test">value</div></body></html> ``` passes. I have added `SameOrigin` method to the `UrlHelper`. I wanted to reuse it in [`constellation.rs` same_script check](https://github.com/servo/servo/blob/f0184a2d011e12845258a242d2d2f6b8b504a28d/components/compositing/constellation.rs#L625) but I it didn't want to compile saying ``` error: unresolved import `dom::urlhelper::UrlHelper`. Maybe a missing `extern crate dom`? ``` So I didn't include it in this PR for now. There is more discussion about the cross origin iframes in [another issue](#3939). In this PR I just added same origin check.
|
I'm pretty sure we did sth wrong here because I wasn't asked to squash before it got merged and so this silly change has two commits. I'm sorry about that. |
|
I just re-r+d since Josh had already done so, after quickly cross checking. Yeah, you could have squashed; but it's not necessary :) |
neojski commentedNov 10, 2014
Because of #2122 I cannot write test for this right now because it will be failing randomly due to that iframe issue. However, if it doesn't fail due to that issue a test like this:
where inner is simply:
passes.
I have added
SameOriginmethod to theUrlHelper. I wanted to reuse it inconstellation.rssame_script check but I it didn't want to compile sayingSo I didn't include it in this PR for now.
There is more discussion about the cross origin iframes in another issue. In this PR I just added same origin check.