Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Issue 2588293004: Clamp rgba(...) alpha value in the CSS fast-path parser (Closed)

Created:
4 years ago by fs
Modified:
4 years ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, chromium-reviews, dglazkov+blink, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Clamp rgba(...) alpha value in the CSS fast-path parser The general CSS parser will clamp the alpha value to the [0, 1] range, while the fast-path parser does not. This means that large alpha values will result in overflow in the cast to int, yielding the wrong color value. Add a clamp to the [0, 1] range before converting to the [0, 256) range and converting to int. Because negative values are handled separately, we only need to apply the clamp for the range above zero. BUG=675158 Committed: https://crrev.com/6c6634508a1438f66057dc414af8171be9602e7c Cr-Commit-Position: refs/heads/master@{#440374}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -1 line) Patch
M third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp View 1 chunk +3 lines, -1 line 2 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserFastPathsTest.cpp View 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (9 generated)
fs
4 years ago (2016-12-20 18:47:30 UTC) #6
alancutter (OOO until 2018)
https://codereview.chromium.org/2588293004/diff/1/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp File third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp (right): https://codereview.chromium.org/2588293004/diff/1/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp#newcode380 third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp:380: : static_cast<int>(std::min(alpha, 1.0) * nextafter(256.0, 0.0)); Instead of static_cast ...
4 years ago (2016-12-20 23:31:24 UTC) #7
fs
https://codereview.chromium.org/2588293004/diff/1/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp File third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp (right): https://codereview.chromium.org/2588293004/diff/1/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp#newcode380 third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp:380: : static_cast<int>(std::min(alpha, 1.0) * nextafter(256.0, 0.0)); On 2016/12/20 at ...
4 years ago (2016-12-21 08:53:00 UTC) #8
alancutter (OOO until 2018)
lgtm
4 years ago (2016-12-21 23:20:03 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2588293004/1
4 years ago (2016-12-22 08:39:41 UTC) #11
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-12-22 10:11:21 UTC) #14
commit-bot: I haz the power
4 years ago (2016-12-22 10:13:47 UTC) #16
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/6c6634508a1438f66057dc414af8171be9602e7c
Cr-Commit-Position: refs/heads/master@{#440374}

Powered by Google App Engine
This is Rietveld 408576698