Summary: | Fix handling of bytes received from the network while in document.write | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Barth <abarth> | ||||||||||||
Component: | New Bugs | Assignee: | Adam Barth <abarth> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | eric | ||||||||||||
Priority: | P2 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | Other | ||||||||||||||
OS: | OS X 10.5 | ||||||||||||||
Bug Depends on: | |||||||||||||||
Bug Blocks: | 39259 | ||||||||||||||
Attachments: |
|
Description
Adam Barth
2010-06-09 00:48:25 PDT
Created attachment 58220 [details]
Patch
Comment on attachment 58220 [details]
Patch
WebCore/html/HTML5Tokenizer.cpp:126
+ // We don't want to consume any more of the input stream now. Do
This is confusing. I think you mean:
"We were just passed data off the network in a nested call to write(). We append this data to the end, but we don't process it until we unwind to a less nested write()." or similar.
WebCore/ChangeLog:18
+ tokenizer.
You should explain here how you also fixed the close() stuff to be more sane.
WebCore/html/HTML5Tokenizer.h:111
+ m_inputStream->m_last = &m_afterInsertionPoint;
This line is not clear to me.
WebCore/html/HTML5Tokenizer.h:117
+ if (m_inputStream->m_last == &m_afterInsertionPoint)
This is also not clear.
I think InsertionPointRecord needs more explanation. And the ChangeLog needs to explain the close() stuff. I assume you ran all the tests?
Created attachment 58223 [details]
Patch
Attachment 58223 [details] did not build on mac: Build output: http://webkit-commit-queue.appspot.com/results/3198078 Comment on attachment 58223 [details]
Patch
r- due to mac build break.
Tricky, it appears the problem is the \ at the end of the line here "// /\"
Created attachment 58251 [details]
Patch
Comment on attachment 58251 [details]
Patch
WebCore/html/HTML5Tokenizer.h:126
+ if (m_inputStream->m_last == &m_inputStream->m_current)
You're right that this would be cleaner if this code was moved onto InputStream itself. I don't really have good naming suggestions for you. :(
I think my biggest gripe is that this m_last == check doesn't have a comment to explain what it's doing. I'm still confused by both of the save and restore logic, even after some sleep. :) Yes, I know what it does, but the code isn't easy to read.
Created attachment 58307 [details]
Patch
Created attachment 58310 [details]
Patch
Comment on attachment 58310 [details]
Patch
The names "splitInto" and "mergeFrom" aren't very clear to me. BUt the code looks good. Thanks.
Comment on attachment 58310 [details] Patch Clearing flags on attachment: 58310 Committed r60926: <http://trac.webkit.org/changeset/60926> All reviewed patches have been landed. Closing bug. |