DOCTYPE scope

Discussion in 'HTML' started by Tim Streater, Aug 7, 2012.

  1. Tim Streater

    Tim Streater Guest

    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?

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Aug 7, 2012
    #1
    1. Advertising

  2. Tim Streater

    Neil Gould Guest

    Tim Streater wrote:
    > 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.

    --
    best regards,

    Neil
     
    Neil Gould, Aug 7, 2012
    #2
    1. Advertising

  3. Tim Streater

    Tim Streater Guest

    In article <jvr3tf$bjt$>,
    "Neil Gould" <> wrote:

    > Tim Streater wrote:
    > > 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.


    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.

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Aug 7, 2012
    #3
  4. Tim Streater

    Neil Gould Guest

    Tim Streater wrote:
    > In article <jvr3tf$bjt$>,
    > "Neil Gould" <> wrote:
    >
    >> Tim Streater wrote:
    >>> 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.

    >
    > 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! ;-)

    --
    best regards,

    Neil
     
    Neil Gould, Aug 7, 2012
    #4
  5. Neil Gould wrote:
    > Tim Streater wrote:
    >> In article <jvr3tf$bjt$>,
    >> "Neil Gould" <> wrote:
    >>
    >>> Tim Streater wrote:
    >>>> 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.

    >>
    >> 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! ;-)
    >


    It is one of the downsides of using frame/iframes

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 7, 2012
    #5
  6. Tim Streater

    Neil Gould Guest

    Jonathan N. Little wrote:
    > Neil Gould wrote:
    >> Tim Streater wrote:
    >>> In article <jvr3tf$bjt$>,
    >>> "Neil Gould" <> wrote:
    >>>
    >>>> Tim Streater wrote:
    >>>>> 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.
    >>>
    >>> 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! ;-)
    >>

    >
    > 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.

    --
    best regards,

    Neil
     
    Neil Gould, Aug 7, 2012
    #6
  7. Tim Streater

    Tim Streater Guest

    In article <jvruse$giq$>,
    "Jonathan N. Little" <> wrote:

    > Neil Gould wrote:
    > > Tim Streater wrote:
    > >> In article <jvr3tf$bjt$>,
    > >> "Neil Gould" <> wrote:
    > >>
    > >>> Tim Streater wrote:
    > >>>> 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.
    > >>
    > >> 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! ;-)

    >
    > 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).

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Aug 7, 2012
    #7
  8. Tim Streater

    Tim Streater Guest

    In article <jvs2re$uin$>,
    "Neil Gould" <> wrote:

    > Jonathan N. Little wrote:
    > > Neil Gould wrote:
    > >> Tim Streater wrote:
    > >>> In article <jvr3tf$bjt$>,
    > >>> "Neil Gould" <> wrote:
    > >>>
    > >>>> Tim Streater wrote:
    > >>>>> 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.
    > >>>
    > >>> 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! ;-)


    > > 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.


    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.

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Aug 7, 2012
    #8
  9. Tim Streater

    Neil Gould Guest

    Tim Streater wrote:
    > In article <jvruse$giq$>,
    > "Jonathan N. Little" <> wrote:
    >
    >> Neil Gould wrote:
    >>> Tim Streater wrote:
    >>>> In article <jvr3tf$bjt$>,
    >>>> "Neil Gould" <> wrote:
    >>>>
    >>>>> Tim Streater wrote:
    >>>>>> 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.
    >>>>
    >>>> 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! ;-)

    >>
    >> 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?
    >

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

    --
    best regards,

    Neil
     
    Neil Gould, Aug 8, 2012
    #9
  10. Tim Streater

    Neil Gould Guest

    Tim Streater wrote:
    > In article <jvs2re$uin$>,
    > "Neil Gould" <> wrote:
    >
    >> Jonathan N. Little wrote:
    >>> Neil Gould wrote:
    >>>> Tim Streater wrote:
    >>>>> In article <jvr3tf$bjt$>,
    >>>>> "Neil Gould" <> wrote:
    >>>>>
    >>>>>> Tim Streater wrote:
    >>>>>>> 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.
    >>>>>
    >>>>> 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! ;-)

    >
    >>> 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.

    >
    > 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.

    --
    best regards,

    Neil
     
    Neil Gould, Aug 8, 2012
    #10
  11. Tim Streater

    dorayme Guest

    In article <jvsbin$g8j$>,
    "Neil Gould" <> wrote:

    > >

    > 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.

    --
    dorayme
     
    dorayme, Aug 8, 2012
    #11
  12. dorayme wrote:
    > In article <jvsbin$g8j$>,
    > "Neil Gould" <> wrote:
    >
    >>>

    >> 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.
    >


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


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 8, 2012
    #12
  13. Tim Streater

    dorayme Guest

    In article <jvsf3h$ekk$>,
    "Jonathan N. Little" <> wrote:

    > dorayme wrote:
    > > In article <jvsbin$g8j$>,
    > > "Neil Gould" <> wrote:
    > >
    > >>>
    > >> 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.
    > >

    >
    > 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.

    --
    dorayme
     
    dorayme, Aug 8, 2012
    #13
  14. Tim Streater

    Tim Streater Guest

    In article <jvsbf4$g5k$>,
    "Neil Gould" <> wrote:

    > Tim Streater wrote:
    > > In article <jvruse$giq$>,
    > > "Jonathan N. Little" <> wrote:
    > >
    > >> Neil Gould wrote:
    > >>> Tim Streater wrote:
    > >>>> In article <jvr3tf$bjt$>,
    > >>>> "Neil Gould" <> wrote:
    > >>>>
    > >>>>> Tim Streater wrote:
    > >>>>>> 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.
    > >>>>
    > >>>> 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! ;-)
    > >>
    > >> 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?
    > >

    > 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 :)

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Aug 8, 2012
    #14
  15. Tim Streater

    Tim Streater Guest

    In article <jvsf3h$ekk$>,
    "Jonathan N. Little" <> wrote:

    > dorayme wrote:
    > > In article <jvsbin$g8j$>,
    > > "Neil Gould" <> wrote:


    > >> 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.


    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?

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Aug 8, 2012
    #15
  16. Tim Streater

    Neil Gould Guest

    dorayme wrote:
    > In article <jvsbin$g8j$>,
    > "Neil Gould" <> wrote:
    >>
    >> 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.
    >

    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.

    --
    best regards,

    Neil
     
    Neil Gould, Aug 8, 2012
    #16
  17. Tim Streater

    Tim Streater Guest

    In article <jvtm6n$7oe$>,
    "Neil Gould" <> wrote:

    > dorayme wrote:
    > > In article <jvsbin$g8j$>,
    > > "Neil Gould" <> wrote:
    > >>
    > >> 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.
    > >

    > 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.

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Aug 8, 2012
    #17
  18. dorayme wrote:
    > In article <jvsf3h$ekk$>,
    > "Jonathan N. Little" <> wrote:
    >
    >> dorayme wrote:
    >>> In article <jvsbin$g8j$>,
    >>> "Neil Gould" <> wrote:
    >>>
    >>>>>
    >>>> 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.
    >>>

    >>
    >> 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.


    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.


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 8, 2012
    #18
  19. Tim Streater

    Hot-Text Guest

    "Tim Streater" <> wrote in message news:...
    > 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>
     
    Hot-Text, Aug 11, 2012
    #19
  20. On Sat, 11 Aug 2012 00:04:02 -0500, Hot-Text wrote:

    > "Tim Streater" <> wrote in message
    > news:...
    >> 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


    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
     
    Denis McMahon, Aug 11, 2012
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Opal
    Replies:
    12
    Views:
    961
    Paul Opal
    Oct 11, 2004
  2. ann
    Replies:
    13
    Views:
    672
    Patricia Shanahan
    Sep 13, 2005
  3. Steven T. Hatton
    Replies:
    9
    Views:
    488
  4. Xah Lee
    Replies:
    0
    Views:
    2,249
    Xah Lee
    Feb 26, 2009
  5. Larry Lindstrom
    Replies:
    19
    Views:
    1,308
    Jonathan N. Little
    Jun 12, 2012
Loading...

Share This Page