NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 518 - Allow <frameset> to override the 'in body' mode in certain cases for compatibility with IE and pages that rely on IE's behaviour.
Allow <frameset> to override the 'in body' mode in certain cases for compatib...
Status: NEW
Product: Validator.nu
Classification: Unclassified
Component: HTML parser
HEAD
All All
: P2 normal
Assigned To: Nobody
http://svn.whatwg.org/webapps/source?...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-27 14:17 CEST by Henri Sivonen
Modified: 2009-11-23 17:17 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henri Sivonen 2009-05-27 14:17:22 CEST
Index: source
===================================================================
--- source	(revision 2702)
+++ source	(revision 2703)
@@ -54901,13 +54901,16 @@
   markup, for historical reasons.</p>
 
 
-  <h5>The scripting state</h5>
+  <h5>Other parsing state flags</h5>
 
   <p>The <dfn>scripting flag</dfn> is set to "enabled" if the <span
   title="concept-n-script">scripting was enabled</span> for the
   <code>Document</code> with which the parser is associated when the
   parser was created, and "disabled" otherwise.</p>
 
+  <p>The <dfn>frameset-ok flag</dfn> is set to "ok" when the parser is
+  created. It is set to "not ok" after certain tokens are seen.</p>
+
 
   <h4><dfn>Tokenization</dfn></h4>
 
@@ -56734,7 +56737,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -56920,7 +56923,7 @@
     data given in the comment token.</p>
    </dd>
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -56993,7 +56996,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -57071,7 +57074,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -57280,7 +57283,7 @@
 
    </dd>
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dt>A comment token</dt>
@@ -57323,7 +57326,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -57427,6 +57430,11 @@
     <p><span title="insert a character">Insert the token's
     character</span> into the <span>current node</span>.</p>
 
+    <p>If the token is not one of U+0009 CHARACTER TABULATION, U+000A
+    LINE FEED (LF), U+000C FORM FEED (FF), <!--U+000D CARRIAGE RETURN
+    (CR),--> or U+0020 SPACE, then set the <span>frameset-ok
+    flag</span> to "not ok".</p>
+
    </dd>
 
    <dt>A comment token</dt>
@@ -57476,6 +57484,40 @@
 
    </dd>
 
+   <dt>A start tag whose tag name is "frameset"</dt>
+   <dd>
+
+    <p><span>Parse error</span>.</p>
+
+    <p>If the second element on the <span>stack of open
+    elements</span> is not a <code>body</code> element, or, if the
+    <span>stack of open elements</span> has only one node on it,
+    then ignore the token. (<span>fragment case</span>)</p>
+
+    <p>If the <span>frameset-ok flag</span> is set to "not ok", ignore
+    the token.</p>
+
+    <p>Otherwise, run the following steps:</p>
+
+    <ol>
+
+     <li><p>Remove the second element on the <span>stack of open
+     elements</span> from its parent node, if it has one.</p></li>
+
+     <li><p>Pop all the nodes from the bottom of the <span>stack of
+     open elements</span>, from the <span>current node</span> up to
+     the root <code>html</code> element.</p>
+
+     <li><p><span>Insert an HTML element</span> for the
+     token.</p></li>
+
+     <li><p>Switch the <span>insertion mode</span> to "<span
+     title="insertion mode: in frameset">in frameset</span>".</p>
+
+    </ol>
+
+   </dd>
+
    <dt>An end-of-file token</dt>
    <dd>
 
@@ -57592,6 +57634,8 @@
     one. (Newlines at the start of <code>pre</code> blocks are
     ignored as an authoring convenience.)</p>
 
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
    </dd>
 
    <!-- as normal, but interacts with the form element pointer -->
@@ -57623,6 +57667,8 @@
 
     <ol>
 
+     <li><p>Set the <span>frameset-ok flag</span> to "not ok".</p></li>
+
      <li><p>Initialize <var title="">node</var> to be the <span>current
      node</span> (the bottommost node of the stack).</p></li>
 
@@ -57673,6 +57719,8 @@
 
     <ol>
 
+     <li><p>Set the <span>frameset-ok flag</span> to "not ok".</p></li>
+
      <li><p>Initialize <var title="">node</var> to be the <span>current
      node</span> (the bottommost node of the stack).</p></li>
 
@@ -58164,6 +58212,8 @@
     <p>Insert a marker at the end of the <span>list of active
     formatting elements</span>.</p>
 
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
    </dd>
 
    <dt>A start tag token whose tag name is one of: "applet",
@@ -58178,6 +58228,8 @@
     <p>Insert a marker at the end of the <span>list of active
     formatting elements</span>.</p>
 
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
    </dd>
 
    <dt>An end tag token whose tag name is one of: "applet", "button",
@@ -58210,16 +58262,6 @@
 
    </dd>
 
-   <dt>A start tag whose tag name is "xmp"</dt>
-   <dd>
-
-    <p><span>Reconstruct the active formatting elements</span>, if
-    any.</p>
-
-    <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
-
-   </dd>
-
    <dt>A start tag whose tag name is "table"</dt>
    <dd>
 
@@ -58230,6 +58272,8 @@
 
     <p><span>Insert an HTML element</span> for the token.</p>
 
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
     <p>Switch the <span>insertion mode</span> to "<span
     title="insertion mode: in table">in table</span>".</p>
 
@@ -58249,6 +58293,10 @@
     <p><span title="acknowledge self-closing flag">Acknowledge the
     token's <i>self-closing flag</i></span>, if it is set.</p>
 
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p> <!--
+    shouldn't really do it for <area>, <basefont>, <bgsound>, and
+    <spacer> -->
+
    </dd>
 
    <dt>A start tag whose tag name is one of: "param", "source"</dt>
@@ -58278,6 +58326,8 @@
     <p><span title="acknowledge self-closing flag">Acknowledge the
     token's <i>self-closing flag</i></span>, if it is set.</p>
 
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
    </dd>
 
    <dt>A start tag whose tag name is "image"</dt>
@@ -58383,6 +58433,9 @@
      <li><p>Let the <span>original insertion mode</span> be the
      current <span>insertion mode</span>.</p>
 
+     <li><p>Set the <span>frameset-ok flag</span> to "not
+     ok".</p></li>
+
      <li><p>Switch the <span>insertion mode</span> to "<span
      title="insertion mode: in CDATA/RCDATA">in
      CDATA/RCDATA</span>".</p></li>
@@ -58391,10 +58444,33 @@
 
    </dd>
 
-   <dt>A start tag whose tag name is one of: "iframe", "noembed"</dt>
+   <dt>A start tag whose tag name is "xmp"</dt>
+   <dd>
+
+    <p><span>Reconstruct the active formatting elements</span>, if
+    any.</p>
+
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
+    <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
+
+   </dd>
+
+   <dt>A start tag whose tag name is "iframe"</dt>
+   <dd>
+
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
+    <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
+
+   </dd>
+
+   <dt>A start tag whose tag name is "noembed"</dt>
    <dt>A start tag whose tag name is "noscript", if the <span>scripting flag</span> is enabled</dt>
    <dd>
+
     <p>Follow the <span>generic CDATA element parsing algorithm</span>.</p>
+
    </dd>
 
    <dt>A start tag whose tag name is "select"</dt>
@@ -58405,6 +58481,8 @@
 
     <p><span>Insert an HTML element</span> for the token.</p>
 
+    <p>Set the <span>frameset-ok flag</span> to "not ok".</p>
+
     <p>If the <span>insertion mode</span> is one of <span
     title="insertion mode: in table">in table</span>", "<span
     title="insertion mode: in caption">in caption</span>", "<span
@@ -58532,8 +58610,8 @@
 -->
 
    <dt>A start <!--or end--> tag whose tag name is one of: "caption",
-   "col", "colgroup", "frame", "frameset", "head", "tbody", "td",
-   "tfoot", "th", "thead", "tr"</dt>
+   "col", "colgroup", "frame", "head", "tbody", "td", "tfoot", "th",
+   "thead", "tr"</dt>
    <!--<dt>An end tag whose tag name is one of: "area", "base",
    "basefont", "bgsound", "command", "embed", "eventsource", "hr",
    "iframe", "image", "img", "input", "isindex", "link", "meta",
@@ -58755,7 +58833,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -59017,7 +59095,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -59766,7 +59844,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -59832,7 +59910,7 @@
 
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -59934,7 +60012,7 @@
   <!-- due to rules in the "in frameset" mode, this can't be entered in the fragment case -->
   <dl class="switch">
 
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dd>
@@ -60008,7 +60086,7 @@
    </dd>
 
    <dt>A DOCTYPE token</dt>
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dt>A start tag whose tag name is "html"</dt>
@@ -60048,7 +60126,7 @@
    </dd>
 
    <dt>A DOCTYPE token</dt>
-   <dt>A character token that is one of one of U+0009 CHARACTER
+   <dt>A character token that is one of U+0009 CHARACTER
    TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
    <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE</dt>
    <dt>A start tag whose tag name is "html"</dt>