DOCTYPE scope

T

Tim Streater

Suppose I have a document with a given DOCTYPE. Does that also apply to
the content of any iframe I may have within the document - which may in
any case have its own DOCTYPE?
 
N

Neil Gould

Tim said:
Suppose I have a document with a given DOCTYPE. Does that also apply
to the content of any iframe I may have within the document - which
may in any case have its own DOCTYPE?
No. The contents in the iframe should have their own declaration, and should
validate on their own through testing.
 
T

Tim Streater

Neil Gould said:
No. The contents in the iframe should have their own declaration, and should
validate on their own through testing.

Thanks. But I'm more concerned about the rendering than the validation,
in the various cases, in particular as I don't generate the HTML in the
iframe and have no control over it.
 
N

Neil Gould

Tim said:
Thanks. But I'm more concerned about the rendering than the
validation, in the various cases, in particular as I don't generate
the HTML in the iframe and have no control over it.
If you have no control over the HTML, you also have no control over how it
will render. So, you can quit worrying, now! ;-)
 
J

Jonathan N. Little

Neil said:
If you have no control over the HTML, you also have no control over how it
will render. So, you can quit worrying, now! ;-)

It is one of the downsides of using frame/iframes
 
N

Neil Gould

Jonathan said:
It is one of the downsides of using frame/iframes
Frames and iframes are both fine. The downside is using content that you
have no control over on your site.
 
T

Tim Streater

Jonathan N. Little said:
It is one of the downsides of using frame/iframes

So if my doc has a nice DOCTYPE, but I have to put someone else's HTML
inside the iframe within my doc, and their HTML doesn't have any
DOCTYPE, then the iframe content is rendered in quirks mode?

(I don't really mind one way or the other, but I wanted to know).
 
T

Tim Streater

Neil Gould said:
Frames and iframes are both fine. The downside is using content that you
have no control over on your site.

It's not a site; it's an *application*, specifically an email client. If
I receive an html email, I just shove it in an iframe and let Safari
worry about it.

I had hoped to be able to use a sandboxed iframe, but it prevents <a>
links from working, so I have to do my own sanitising.
 
N

Neil Gould

Tim said:
So if my doc has a nice DOCTYPE, but I have to put someone else's HTML
inside the iframe within my doc, and their HTML doesn't have any
DOCTYPE, then the iframe content is rendered in quirks mode?
Most likely. It seems that you are asking whether content in frames /
iframes inherit the DOCTYPE of your page. No... it doesn't.
 
N

Neil Gould

Tim said:
It's not a site; it's an *application*, specifically an email client.
If I receive an html email, I just shove it in an iframe and let
Safari worry about it.
Sites can be seen as "applications" too, so that is a distinction without a
difference.
 
D

dorayme

Sites can be seen as "applications" too, so that is a distinction without a
difference.[/QUOTE]

Don't worry about this, Tim is probably concerned to develop an email
program and he has a good reason to say it is an app and that is very
different to him making a webpage.

His question has been largely answered. Unless he can control the
content of the iframe, it will do what it wants, it is not obvious how
he could even inject styles into it.
 
J

Jonathan N. Little

dorayme said:
Sites can be seen as "applications" too, so that is a distinction without a
difference.

Don't worry about this, Tim is probably concerned to develop an email
program and he has a good reason to say it is an app and that is very
different to him making a webpage.

His question has been largely answered. Unless he can control the
content of the iframe, it will do what it wants, it is not obvious how
he could even inject styles into it.
[/QUOTE]

Scraping. Ignoring the ethics of using someone else's content. He does
have permission to use the content, right?
 
D

dorayme

Jonathan N. Little said:
Scraping. Ignoring the ethics of using someone else's content. He does
have permission to use the content, right?

Who is scraping? Anyway, I am sure you are misunderstanding. Read
Tim's reply that hints about his purpose. It is a quite honourable one.

When someone sends you an email, for example, a real estate agent with
properties for sale, it is almost certainly an HTML one. It needs to
be rendered on your computer, either in the email read-window or in a
browser that fires up or you can have fire up. If someone is making an
email program or concerned with how to handle such when receiving,
questions of permission are hardly relevant.
 
T

Tim Streater

Neil Gould said:
Most likely. It seems that you are asking whether content in frames /
iframes inherit the DOCTYPE of your page. No... it doesn't.

Right - that's clear enough - thanks :)
 
T

Tim Streater

Jonathan N. Little said:
dorayme said:
In fact I process the html before dumping it in the iframe, as follows:

1) Remove any scripts I can see

2) Check all links to see if they are obviously phishing and insert a
tip about each one (I recall that dorayme helped on that one)

3) Outlook lies in its <meta>, claiming the charset to be ISO-8859-1
when it in fact is utf-8

4) fix up pointers to inline images

5) Ensure that all links have a target of '_blank' and that no href is
empty.
Scraping. Ignoring the ethics of using someone else's content. He does
have permission to use the content, right?

I have and need just as much permission as you needed in order to quote
dorayme's post.

What is scraping?
 
N

Neil Gould

dorayme said:
Don't worry about this, Tim is probably concerned to develop an email
program and he has a good reason to say it is an app and that is very
different to him making a webpage.
I understood Tim's implication. However, many sites are interactive in some
way, and their HTML is often generated by underlying code in some
programming or scripting language, so they are an application.
 
T

Tim Streater

Neil Gould said:
I understood Tim's implication. However, many sites are interactive in some
way, and their HTML is often generated by underlying code in some
programming or scripting language, so they are an application.

True. I suppose what I meant was, that in my case I use Safari,
JavaScript, a *local* instance of apache, PHP and SQLite as *components*
of an app that you double-click to start in the traditional way. Your
Internet connection is only actually needed when fetching or sending
mail.
 
J

Jonathan N. Little

dorayme said:
Who is scraping? Anyway, I am sure you are misunderstanding. Read
Tim's reply that hints about his purpose. It is a quite honourable one.

s/who/what/

scraping is using server side scripting to get remote page content so
that is can be parsed, manipulated, reformatted, and included with your
servers' page. CURL for PHP is one popular way. I am sure you have
stumbled across those scrapped eBay auction listing sites.
When someone sends you an email, for example, a real estate agent with
properties for sale, it is almost certainly an HTML one. It needs to
be rendered on your computer, either in the email read-window or in a
browser that fires up or you can have fire up. If someone is making an
email program or concerned with how to handle such when receiving,
questions of permission are hardly relevant.

For email clients, like TB will block remote content be default for
security reasons. Iframe injection trojans. But with web mail...T think
that is how so many now are getting nailed, your web browser is much
more relaxed with JavaScript and frames enabled by default. But this is
not what I was addressing. I was giving one example of how to use remote
content and have control over the format without frames/iframes.
 
H

Hot-Text

Tim Streater said:
Suppose I have a document with a given DOCTYPE. Does that also apply to
the content of any iframe I may have within the document - which may in
any case have its own DOCTYPE?

No it have not it own DOCTYPE

For Iframe is HTML a Transitional Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
because it's have HTML with the Iframe..

For frameset is HTML a frameset Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN"
"http://www.w3.org/TR/REC-html40/frameset.dtd">
because it's have not HTML with the frameset,

But you can add JavaScript, and <style type="text/css">
to frameset it will work...
And in <noframeset>you can put a HTML Body</noframeset>
 
D

Denis McMahon

No it have not it own DOCTYPE

Yes, the content of an iframe can have it's own DOCTYPE.

An iframe can contain content from another server that you have no
control over. If your document is html4 transitional, and loads an iframe,
the content of a document loaded in the iframe might be html4 strict,
html4 frameset, xhtml1.*, html 5, or anything else that has a valid
doctype as long as it's served with the right doctype for what it
contains.

Rgds

Denis McMahon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top