title: Understanding rules for parsing tokens in foreign content
body: <p>I have a question it is related to the stage of executing instructions in the condition. I do not quite understand what each instruction means and when it is executed. Examples with the help of UA would be very helpful in this case.</p>
  
  <p>Here is a piece from <a href="https://w3c.github.io/html/syntax.html#the-rules-for-parsing-tokens-in-foreign-content" rel="nofollow noreferrer">specification</a>:</p>
  
  <blockquote>
    <ul>
    <li><strong>A start tag one of the following: b, big, blockquote, body, br, center, code, dd, div "dl", "dt", "em",
    "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "menu", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"</strong></li>
    <li><p><strong>A start tag name is "font", if the token has any attributes named "color", "face", or "size"</strong></p>
    
    <p>Parse error.</p>
    
    <p>If the parser was originally created for the HTML fragment parsing
    algorithm, then act as described in the "any other start tag" entry
    below. (fragment case)</p>
    
    <p>Otherwise:</p>
    
    <p>Pop an element from the stack of open elements, and then keep popping
    more elements from the stack of open elements until the current node
    is a MathML text integration point, an HTML integration point, or an
    element in the HTML namespace.</p>
    
    <p>Then, reprocess the token.</p></li>
    </ul>
  </blockquote>
  
  <p>To avoid misunderstandings, I named instructions what is written in the usual typeface in my quote. In the specification there are similar places, but it is difficult for me to correctly interpret them because it is not clear at what points there are differences.</p>
  
  <p>Look at "Parse Error" - the link leads to the chapter of errors, there is no specific error. How to take this moment?</p>
  
  <p>Next quote:</p>
  
  <blockquote>
    <p>If the parser was originally created for the HTML fragment parsing algorithm, then act as described in the "any other start tag" entry below. (fragment case)</p>
  </blockquote>
  
  <p>Does this quote refer to "Parse Error" or is it entirely different?</p>
  
  <p>Next we see the inscription "Othewise" - which tells us that all these instructions can not be executed together.
  But despite this question the same, quote:</p>
  
  <blockquote>
    <p>Pop an element from the stack of open elements, and then keep popping
    more elements from the stack of open elements until the current node
    is a MathML text integration point, an HTML integration point, or an
    element in the HTML namespace.</p>
    
    <p>Then, reprocess the token.</p>
  </blockquote>
  
  <p>Does this quote refer to "Parse Error" or is it entirely different?</p>
  
  <p>Let's sum up: There are only 2 execution instructions, one of which is executed under the condition <code>parser was originally created for the HTML fragment parsing algorithm</code> and the other instruction is executed if the previous instruction does not pass the test. And all this in general is "Parse Error".</p>
  
  <p>But despite this, even if I correctly said everything, please give me examples with this or that fulfillment of the condition, and even understanding of the instructions themselves makes me difficult.</p>
  
  <hr>
  
  <p><strong>Update 1</strong></p>
  
  <p>I think the question needs to be supplemented so that you can make the most of it.</p>
  
  <p>As you might have noticed, we are sitting in the chapter parsing in foreign content. As you can understand this chapter is intended when we analyze content in foreign content, and foreign content is all that is in the nodes svg or math.</p>
  
  <p>So let's say we are sitting in the node svg and in this svg we put any tag from the list that calls parse error. Just try writing like this: <code>&lt;svg&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/svg&gt;</code> - the result will not keep you waiting, you'll see that <code>&lt;p&gt;Hello&lt;/p&gt;</code> will pop out of the svg node and stand after it: <code>&lt;svg&gt;&lt;/svg&gt;&lt;p&gt;Hello&lt;/p&gt;</code>. And what point does this behavior describe? Correctly! Second! And then the question arises, and how to reproduce all the same thing with the first item?</p>
  
  <p>How to describe the behavior for an item:</p>
  
  <blockquote>
    <p>If the parser was originally created for the HTML fragment parsing algorithm, then act as described in the "any other start tag" entry below. (fragment case)</p>
  </blockquote>