[whatwg] Undefined action parsing HTML fragment with <select> context

Ian Hickson ian at hixie.ch
Sun Jul 21 09:11:52 PDT 2013


On Sun, 21 Jul 2013, Nolan Waite wrote:
>
> Hello! I am confused about parsing an HTML fragment when the context is 
> a "select" element. 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#parsing-html-fragments 
> step 4.6 instructs me to "reset the parser's insertion mode 
> appropriately". I head over to 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#parsing-html-fragments 
> but I see a problem in step 4.
> 
> In step 4.1 I let ancestor = node. At this point, I have:
> 
> - stack of open elements =
>     - <html>
> - last = true
> - node = the context element, a "select" element
> - ancestor = the context element, a "select" element
> 
> In step 4.2 ancestor is not the first node in the stack of open elements 
> (the context "select" element is not and has never been on the stack), 
> so I continue to step 4.3.
> 
> Now I am to "let ancestor be the node before ancestor in the stack of 
> open elements". There is no such node! At this point, ancestor is not on 
> the stack of open elements, so there is no node "before" it.
> 
> I assume the intention is to effectively jump to the step labeled *done* 
> if ancestor is the context element? That makes sense to me.

Oops. Fixed.

Your other bug (about whether <math> and <svg> are supposed to get foster 
parented) is also valid, but harder to fix, so I added it to the queue 
but haven't fixed it yet. (The short answer is yes, they're supposed to be 
foster parented.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list