This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10314 - "in cell" (secondary) insertion mode shows strange behavior for e.g. <table><tr><td><svg><td></td><td>, <table><tr><td><svg><tbody></tbody>
Summary: "in cell" (secondary) insertion mode shows strange behavior for e.g. <table><...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-08 04:02 UTC by contributor
Modified: 2010-10-04 14:49 UTC (History)
8 users (show)

See Also:


Attachments

Description contributor 2010-08-08 04:02:29 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#parsing-main-intd

Comment:
"in cell" (secondary) insertion mode shows strange behavior for e.g.
<table><tr><td><svg><td></td><td>, <table><tr><td><svg><tbody></tbody>

Posted from: 121.102.72.35
Comment 1 Ian 'Hixie' Hickson 2010-09-10 19:20:08 UTC
I assume you mean <table><tr><td><svg><desc><td>?

I guess the solution is to make it clear that "reprocess the current token" means that we should first check the rule in the "in foreign content" section that resets the insertion mode, before then rerunning the token through the entire system from the top?

There is also the problem with <table><tr><td><svg><td><desc><td>. Not sure how to handle that one, unless we start checking for namespaces when looking at tag names. Any suggestions?

We could probably solve both problems by making <svg> scoping for table scope, but then we'd have to add a bunch of error-handling logic in the table modes.

Or maybe the real problem is that the secondary mode can be anything but "in body". Should we give up with the secondary mode idea, and just reset the insertion mode when exiting foreign lands, and always defer to the in-body mode from foreign lands when appropriate?
Comment 2 Ian 'Hixie' Hickson 2010-09-27 09:13:07 UTC
Cases that would not be solved by the proposal above:

  <foo><svg></foo>

  <svg><em><desc></em>

Maybe these aren't problems? It's a bigger issue if the implied end tags cause such problems... are there any that could trigger something like this if we always defer to "in body"?
Comment 3 Ian 'Hixie' Hickson 2010-09-27 09:17:04 UTC
<svg><body><desc></html>
<p><svg><desc><form>

Maybe we should always defer to "in body" _and_ make the foreign lands scoping.
Comment 4 Ian 'Hixie' Hickson 2010-09-27 09:19:16 UTC
Hm, <foreignObject> is already scoping. Maybe I should make all the other exits scoping as well, rather than make the entrances scoping.
Comment 5 Ian 'Hixie' Hickson 2010-09-27 23:45:07 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Ok, I've tried to address this. This is a pretty big change in how foreign lands are built, it gets rid of the secondary insertion mode, etc. See the check-in comment below.
Comment 6 contributor 2010-09-27 23:45:25 UTC
Checked in as WHATWG revision r5521.
Check-in comment: Parser foreign lands: Get rid of secondary insertion mode, always use 'in body', scope HTML in foreign lands so that we won't try to close elements cross-namespace (e.g. <svg><p><desc><form> won't imply a </p> that closes the <p>...; <td> won't close all the SVG if the SVG is in a cell).
http://html5.org/tools/web-apps-tracker?from=5520&to=5521
Comment 7 contributor 2010-09-27 23:54:24 UTC
Checked in as WHATWG revision r5522.
Check-in comment: Parser foreign lands: Oops, I missed one of the ways that scoping happens.
http://html5.org/tools/web-apps-tracker?from=5521&to=5522
Comment 8 Eric Seidel 2010-09-27 23:57:32 UTC
https://bugs.webkit.org/show_bug.cgi?id=46676 is the WebKit bug for applying these spec changes.

Thanks you Hixie.