Bug 111528 - View Source does not show trailing truncated tags
Summary: View Source does not show trailing truncated tags
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2013-03-05 23:34 PST by David Benjamin
Modified: 2013-03-06 22:10 PST (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description David Benjamin 2013-03-05 23:34:32 PST
This is pretty minor, but if you view source on a file like:

Blah blah

The "<b" gets lost in View Source (tested in Chrome). I didn't look too closely at the details, but it seems this comes from View Source being based on the HTML tokenizer. If you get an EOF in the "tag name state", no token is emitted for the truncated tag and instead it goes straight to emitting an EOF token.

Comment 1 Eric Seidel (no email) 2013-03-06 11:02:29 PST
I think we could add a test for this with "failing" expectations and close this.  I don't think we plan to change this behavior anytime soon. :)  There are strong advantages to using the real HTML parser for view source.  I guess in this case we could special case EOF and check if there were any dropped chars from the last token.
Comment 2 Adam Barth 2013-03-06 14:35:50 PST
Maybe the SourceTracker can help us get any leftover source from an incomplete last token?
Comment 3 Henri Sivonen 2013-03-06 22:10:49 PST
FWIW, using a real HTML parser for View Source doesn't mean that you have to drop a trailing partial tag on the floor in the source view. See Gecko. :-)