Summary: | HTMLDocumentParser should hold the HTMLToken using an OwnPtr | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Barth <abarth> | ||||||
Component: | New Bugs | Assignee: | Adam Barth <abarth> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | eric, tonyg, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | 108159 | ||||||||
Bug Blocks: | 107753 | ||||||||
Attachments: |
|
Description
Adam Barth
2013-01-23 17:03:53 PST
Created attachment 184358 [details]
Patch
Comment on attachment 184358 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184358&action=review This ends up being one more malloc for innerHTML. I'm not sure if we'll end up noticing for perf or not. > Source/WebCore/html/parser/HTMLDocumentParser.cpp:341 > if (!isParsingFragment()) We could just grab a const reference to the token at the top of this loop. The token being able to change is a background-parser thing. in your setToken() method that you write you should probably ASSERT that we're not in the middle of a parsing session. I just added an inline helper function to make the code more readable. Created attachment 185174 [details]
Patch for landing
Comment on attachment 185174 [details] Patch for landing Clearing flags on attachment: 185174 Committed r141070: <http://trac.webkit.org/changeset/141070> All reviewed patches have been landed. Closing bug. Comment on attachment 185174 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=185174&action=review > Source/WebCore/html/parser/BackgroundHTMLParser.cpp:157 > + while (m_tokenizer->nextToken(m_input, *m_token.get())) { Should not need the get() call here, because the * operator should work on an OwnPtr. > Source/WebCore/html/parser/HTMLDocumentParser.h:157 > + HTMLToken& token() { return *m_token.get(); } Ditto. Oh, I didn't know that. Thanks! |