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 13293 - Undefined behavior for EOF in foreign content mode
Summary: Undefined behavior for EOF in foreign content mode
Status: CLOSED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-19 04:06 UTC by James Simonsen
Modified: 2011-08-04 05:00 UTC (History)
4 users (show)

See Also:


Attachments

Description James Simonsen 2011-07-19 04:06:14 UTC
Given the document:

<svg>

The spec does not define how to handle the EOF while in foreign content mode. Presumably, we should stop parsing, possibly with parse errors.
Comment 1 Aryeh Gregor 2011-07-19 23:50:35 UTC
I'm not so familiar with the HTML parsing algorithm, but as I read it, an EOF token is never emitted in foreign content.  Specifically, at

http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tree-construction

it says

"As each token is emitted from the tokenizer, the user agent must follow the appropriate steps from the following list:"

The step "If the token is an end-of-file token" says

"Process the token according to the rules given in the section corresponding to the current insertion mode in HTML content."

So it looks to me like you first do tokenization, then decide the insertion mode (foreign vs. HTML) based on the current token, and EOF is always processed in HTML insertion mode.  If some elements are still open, this will be a parse error, per the rules of the HTML insertion mode.  Are you reading it differently?
Comment 2 James Simonsen 2011-07-20 00:03:55 UTC
Indeed. I hadn't noticed the spec has changed a lot here. "In foreign content" used to be an insertion mode like the others.
Comment 3 Michael[tm] Smith 2011-08-04 05:00:44 UTC
mass-moved component to LC1