Closed Bug 1361641 Opened 7 years ago Closed 7 years ago

use srcdoc attr for iframes instead of data: in mochitests under dom/

Categories

(Core :: DOM: Security, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

(Whiteboard: [domsecurity-active])

Attachments

(4 files)

Convert the mochitests in dom to use srcdoc attributes, so once we turn off security.data_uri.inherit_security_context, those iframes will still have the same principal with parent document.

This bug will change lots of tests, I'd like to get opinion from smaug first, 
Smaug, do you think it's easier if I make it a giant patch with all the modicafications, or you like to review the fix one by one?

Thanks
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [domsecurity-active]
Also there are some tests that use <object data="data:text/html..."></object>, however <object> doesn't have srcdoc attributes, any suggestion to fix this?
for <object> new files are probably needed.

I guess giant patch is ok for all the trivial changes, but if there is anything not to trivial, those could be put to separate patch?
(In reply to Olli Pettay [:smaug] from comment #2)
> for <object> new files are probably needed.
> 
> I guess giant patch is ok for all the trivial changes, but if there is
> anything not to trivial, those could be put to separate patch?
Okay, for the big patch I'll just change to srcdoc. 
Thanks
Hi smaug
The patches are ready for review, when you have time can you help to review these ?

Thanks
Flags: needinfo?(bugs)
Flags: needinfo?(bugs)
Comment on attachment 8864456 [details] [diff] [review]
Part 3: move data: URIs in <object> to seperate file.

Review of attachment 8864456 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/test/mochitest.ini
@@ +228,5 @@
>    intersectionobserver_cross_domain_iframe.html
>    intersectionobserver_window.html
> +  object_bug353334.html
> +  embed_bug455472.html
> +  object_bug455472.html

I am not sure the naming convention here, should it be "object_bug455472.html" or "bug455472_object.html"

Let me know if I am not doing it right.
Comment on attachment 8864453 [details] [diff] [review]
Part 1: convert mochitest plain tests in dom to use srcdoc

I think converting the test for bug 593174 is ok.
That was the only one requiring some thought.
Attachment #8864453 - Flags: review?(bugs) → review+
Attachment #8864454 - Flags: review?(bugs) → review+
Attachment #8864456 - Flags: review?(bugs) → review+
Attachment #8865277 - Flags: review?(bugs) → review+
Hi Smaug
Thanks for your review, can you check my comment 10 to see if I did it right?

Thanks
not sure we have too strict naming convention.
Often non-test files are named
file_<testname>, but I think in this case using object_ or embed_ is ok
Pushed by yhuang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/652e823f5301
Part 1: convert mochitest plain tests in dom to use srcdoc. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/73eba85671f7
Part 2: convert mochitest plain tests in editor/ to use srcdoc. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/ef29d70c9398
Part 3: move data: URIs in <object> to seperate file. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/b3b34b80fc13
Part 4: move data: URIs in test_bug431701.html to seperate files. r=smaug
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: