This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20721 - Why not using src attribute with dataURI instead srcdoc ?
Summary: Why not using src attribute with dataURI instead srcdoc ?
Status: CLOSED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-21 07:56 UTC by contributor
Modified: 2013-01-25 08:04 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2013-01-21 07:56:55 UTC
Specification: 
Multipage: http://www.whatwg.org/C#the-iframe-element
Complete: http://www.whatwg.org/c#the-iframe-element

Comment:
Why not using src attribute with dataURI ? It's supported by all browsers  :
<iframe
src="data:text/html;charset=utf-8,%3C%21DOCTYPE%20html%3E%3Chtml%20lang%3D%22e
n%22%3E%3Chead%3E%3Cmeta%20charset%3D%22utf-8%22%2F%3E%3Ctitle%3E%3C%2Ftitle%3
E%3C%2Fhead%3E%3Cbody%3E%3Cp%3Edid%20you%20get%20a%20cover%20picture%20yet%3F%
3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E"></iframe>

Posted from: 192.44.63.161
User agent: Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0
Comment 1 JY Cronier 2013-01-21 08:05:19 UTC
We can replace this:

<iframe seamless sandbox srcdoc="<p>did you get a cover picture yet?"></iframe>

By:


<iframe seamless sandbox src="data:text/html;charset=utf-8,%3C%21DOCTYPE%20html%3E%3Chtml%20lang%3D%22en%22%3E%3Chead%3E%3Cmeta%20charset%3D%22utf-8%22%2F%3E%3Ctitle%3E%3C%2Ftitle%3E%3C%2Fhead%3E%3Cbody%3E%3Cp%3Edid%20you%20get%20a%20cover%20picture%20yet%3F%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E"></iframe>

And it's supported by all browsers :)
Comment 2 Ian 'Hixie' Hickson 2013-01-24 23:49:28 UTC
Does the second of those snippets in comment 1 really seem better to you than the first?

Yes, for now data: URLs are better because they work more. But in 20 years, I think life would be better if we're using the cleaner and easier-to-escape version rather than data: URLs.