| Summary: | Fix HTMLDataListElement.options to include even options that are not suggestions | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Darin Adler <darin> | ||||
| Component: | DOM | Assignee: | Darin Adler <darin> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | cdumez, dbates, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, kondapallykalyan, mifenton, pdr, thorton, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Darin Adler
2020-02-22 23:26:11 PST
Created attachment 391481 [details]
Patch
Committed r257194: <https://trac.webkit.org/changeset/257194> Comment on attachment 391481 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391481&action=review > Source/WebCore/html/ColorInputType.cpp:291 > - suggestions.reserveInitialCapacity(length); > - for (unsigned i = 0; i != length; ++i) { > - auto value = downcast<HTMLOptionElement>(*options->item(i)).value(); > - if (isValidSimpleColor(value)) > - suggestions.uncheckedAppend(Color(value)); > + for (auto& option : dataList->suggestions()) { > + if (auto color = parseSimpleColorValue(option.value())) > + suggestions.uncheckedAppend(*color); Concerning that EWS didn't catch the loss of reserveInitialCapacity here Comment on attachment 391481 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391481&action=review >> Source/WebCore/html/ColorInputType.cpp:291 >> + suggestions.uncheckedAppend(*color); > > Concerning that EWS didn't catch the loss of reserveInitialCapacity here Oops. Obviously this needs to be plain old append, not uncheckedAppend! I can’t believe I missed that. Comment on attachment 391481 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391481&action=review >>> Source/WebCore/html/ColorInputType.cpp:291 >>> + suggestions.uncheckedAppend(*color); >> >> Concerning that EWS didn't catch the loss of reserveInitialCapacity here > > Oops. Obviously this needs to be plain old append, not uncheckedAppend! I can’t believe I missed that. Are you going to fix that, Tim, or would you like me to? I think Megan is fixing it! (she found the problem, I just did the spelunking to find out how it got this way). |