<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18473</bug_id>
          
          <creation_ts>2012-08-02 18:52:07 +0000</creation_ts>
          <short_desc>Spec causes continuous loop</short_desc>
          <delta_ts>2012-10-08 21:29:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ian &apos;Hixie&apos; Hickson">ian</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>mridul</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71771</commentid>
    <comment_count>0</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-02 18:52:07 +0000</bug_when>
    <thetext>(cloning bug to WHATWG component so I can investigate whether the suggested clarification is worth it)

+++ This bug was initially created as a clone of Bug #18367 +++

Consider the stack of open elements to be :
html, body, form, table, tbody

(form being present is irrelevant to this imo).

The current insertion mode is IN TABLE BODY as expected.

When the next token being consumed is end tag p, then the parser will go into an infinite loop.

IN TABLE BODY will delegate to IN TABLE, which will delegate to IN BODY with foster parenting enabled.
The end tag p will cause a &apos;act as if&apos; start token for p (since there is no P in button scope) - which will go through same flow to end in IN BODY with foster parenting enabled.
The resulting insertion of p tag due to then token will get foster parent&apos;ed - and so, on return, reconsumption of end tag p will essentially cause the same loop to be repeated indefinitely.

Looks like even when foster parent&apos;ed, the node to be inserted must be pushed
to open elements stack - might be good to clarify this since we figured it out
via trial and error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75631</commentid>
    <comment_count>1</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-10-08 21:29:51 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7441.
Check-in comment: Try to clarify the foster parenting logic...
http://html5.org/tools/web-apps-tracker?from=7440&amp;to=7441</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>