Bug 40200 - "Fix" fast/dom/stripNullFromTextNodes.html in HTML5 parser
Summary: "Fix" fast/dom/stripNullFromTextNodes.html in HTML5 parser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks: 39259
  Show dependency treegraph
 
Reported: 2010-06-04 20:59 PDT by Adam Barth
Modified: 2010-06-07 11:51 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.72 KB, patch)
2010-06-04 21:00 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
original reduction (42 bytes, text/html)
2010-06-05 10:26 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2010-06-04 20:59:16 PDT
"Fix" fast/dom/stripNullFromTextNodes.html in HTML5 parser
Comment 1 Adam Barth 2010-06-04 21:00:51 PDT
Created attachment 57958 [details]
Patch
Comment 2 Eric Seidel (no email) 2010-06-04 22:08:19 PDT
Comment on attachment 57958 [details]
Patch

I guess we don't have any way to check in results for a test like this, eh?  We could with the html5lib tests.

Please consider adding a test with checked in results.
Comment 3 Alexey Proskuryakov 2010-06-05 09:59:49 PDT
So, neither WebKit nor shipping versions of Gecko turn nulls into U+FFFD, but HTML5 requires that. Could it be a bug in the spec? What does IE do?
Comment 4 Alexey Proskuryakov 2010-06-05 10:06:39 PDT
For some context: HTML5 offline storage parser also had the requirement to turn nulls into U+FFFD, which was dropped based on our feedback.

U+FFFD is generally used to signal decoding errors, which a null definitely doesn't cause.
Comment 5 Adam Barth 2010-06-05 10:19:57 PDT
I believe swallows the nulls, but I haven't tested recently.  We should file a bug with the HTML5 WG.
Comment 6 Alexey Proskuryakov 2010-06-05 10:24:38 PDT
I tested in more detail, and it seems to be trickier:
- WebKit passes stripNullFromTextNodes.html, as it strips nulls from text node content;
- so does IE 7;
- Firefox 3.6.3 actually fails the test, and inserts U+FFFD;
- but Firefox passes an original reduction for rdar://4702420, which I incorrectly assumed to be the same: <div>\0</div>

So, Firefox seems to drop the null if it's the only character in a text node (?!)
Comment 7 Alexey Proskuryakov 2010-06-05 10:26:22 PDT
Created attachment 57967 [details]
original reduction
Comment 8 Adam Barth 2010-06-07 11:51:41 PDT
Comment on attachment 57958 [details]
Patch

Clearing flags on attachment: 57958

Committed r60791: <http://trac.webkit.org/changeset/60791>
Comment 9 Adam Barth 2010-06-07 11:51:48 PDT
All reviewed patches have been landed.  Closing bug.