Bug 107368 - Add a helper function for getting strings from tokens (and make it 8-bit aware)
Summary: Add a helper function for getting strings from tokens (and make it 8-bit aware)
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks: 106127
  Show dependency treegraph
 
Reported: 2013-01-19 02:56 PST by Eric Seidel (no email)
Modified: 2013-02-13 21:35 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.52 KB, patch)
2013-01-19 02:58 PST, Eric Seidel (no email)
abarth: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2013-01-19 02:56:36 PST
Add a helper function for getting strings from tokens (and make it 8-bit aware)
Comment 1 Eric Seidel (no email) 2013-01-19 02:58:01 PST
Created attachment 183614 [details]
Patch
Comment 2 Adam Barth 2013-01-19 11:10:14 PST
Comment on attachment 183614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=183614&action=review

> Source/WebCore/html/parser/CompactHTMLToken.cpp:40
> +    if (!vector.size())
> +        return emptyString();

There's no reason to do this.  Both String::make8BitFrom16BitSource and String have special-case logic for the empty string.

> Source/WebCore/html/parser/CompactHTMLToken.cpp:41
> +    if (token.isAll8BitData())

This isn't correct for anything other than m_data.  We only track this flag for the main data vector.  Perhaps we should make HTMLToken smarter and track this flag for the other strings as well?
Comment 3 Adam Barth 2013-02-13 21:35:01 PST
Eric did this in a more general way.