Bug 161216 - HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
Summary: HTMLAreaElement's coords attributes parsing does not comply with the HTML spe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
: 153124 155516 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-25 15:01 PDT by Chris Dumez
Modified: 2023-12-18 08:15 PST (History)
10 users (show)

See Also:


Attachments
Patch (15.76 KB, patch)
2016-08-25 15:08 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (24.23 KB, patch)
2016-08-26 12:09 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Follow-up fixes (3.25 KB, patch)
2016-08-27 21:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-08-25 15:01:40 PDT
HTMLAreaElement's coords attributes parsing does not comply with the HTML specification:
- https://html.spec.whatwg.org/#attr-area-coords
Comment 1 Chris Dumez 2016-08-25 15:08:39 PDT
Created attachment 287028 [details]
Patch
Comment 2 Andreas Kling 2016-08-26 11:00:32 PDT
Comment on attachment 287028 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2016-08-26 11:10:48 PDT
Comment on attachment 287028 [details]
Patch

Clearing flags on attachment: 287028

Committed r205030: <http://trac.webkit.org/changeset/205030>
Comment 4 WebKit Commit Bot 2016-08-26 11:10:55 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Chris Dumez 2016-08-26 12:09:35 PDT
Reopening to attach new patch.
Comment 6 Chris Dumez 2016-08-26 12:09:38 PDT
Created attachment 287128 [details]
Patch
Comment 7 Darin Adler 2016-08-26 22:10:27 PDT
Comment on attachment 287128 [details]
Patch

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

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:229
> +template <typename CharacterType>
> +static inline bool isHTMLSpaceOrDelimiter(CharacterType character)
> +{
> +    return isHTMLSpace(character) || character == ',' || character == ';';
> +}
> +
> +template <typename CharacterType>
> +static inline bool isNumberStart(CharacterType character)
> +{
> +    return isASCIIDigit(character) || character == '.' || character == '-';
> +}

Is a template really needed? I think these could be be written to work on UChar and should work fine for LChar too.

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:262
> +Vector<double> parseHTMLListOfOfFloatingPointNumberValues(const String& input)

Should take a StringView rather than a String.

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:266
> +    unsigned length = input.length();
> +    if (!length)
> +        return { };

This won’t be needed if the argument is a StringView.
Comment 8 Chris Dumez 2016-08-27 21:35:33 PDT
Created attachment 287220 [details]
Follow-up fixes

Patch to take Darin's feedback into consideration.
Comment 9 WebKit Commit Bot 2016-08-27 22:26:27 PDT
Comment on attachment 287220 [details]
Follow-up fixes

Clearing flags on attachment: 287220

Committed r205095: <http://trac.webkit.org/changeset/205095>
Comment 10 WebKit Commit Bot 2016-08-27 22:26:32 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Chris Dumez 2016-09-13 09:18:13 PDT
*** Bug 153124 has been marked as a duplicate of this bug. ***
Comment 12 zalan 2023-12-18 08:15:20 PST
*** Bug 155516 has been marked as a duplicate of this bug. ***