DescriptionFix HTMLToken::Attribute::value handling in AtomicHTMLToken
|HTMLToken::Attribute::value| should be used as |String(value)| or
|StringImpl::create8BitIfPossible(value)|.
- |value.data()| is nullptr for attributes with no values, and such |value|
should be converted to the empty string (WTF::String or AtomicString),
because the null string is used for absence of an attribute.
- |String(value)| and |StringImpl::create8BitIfPossible(value)| converts
|value| with null |value.data()| into the empty string.
However, |AtomicString(value)| converts |value| with null |value.data()| into
the null string.
This is done in AtomicHTMLToken, so this CL fixes it.
Also, this CL
- Adds unit tests for attributes with empty value,
- Adds CORE_EXPORT to classes/function needed by the unit tests, and
- Creates AtomicHTMLToken.cpp and moves implementation of AtomicHTMLToken from
HTMLTokenizer.cpp.
BUG=540546
Committed: https://crrev.com/37d6b63597f41322f6092405ae913b19a7e85686
Cr-Commit-Position: refs/heads/master@{#354704}
Patch Set 1 #Patch Set 2 : Rebase + Tests. #Patch Set 3 : Refactor AtomicHTMLToken / CORE_EXPORT #Patch Set 4 : CORE_EXPORT #Patch Set 5 : Style fix. #Messages
Total messages: 40 (19 generated)
|