Bug 55661 - CSS RGBA fast-path color parsing should clamp of out-of-range alpha values
Summary: CSS RGBA fast-path color parsing should clamp of out-of-range alpha values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Andras Becsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 04:27 PST by Andras Becsi
Modified: 2011-03-03 07:17 PST (History)
5 users (show)

See Also:


Attachments
proposed patch with test case (38.38 KB, patch)
2011-03-03 04:42 PST, Andras Becsi
no flags Details | Formatted Diff | Diff
proposed patch with test case (38.39 KB, patch)
2011-03-03 04:51 PST, Andras Becsi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Becsi 2011-03-03 04:27:57 PST
RGBA fast-path color parsing does not handle out-of-range alpha values these are handled by the slow-path.

Let the fast-path handle the clamping of out-of-range alpha values.
Comment 1 Andras Becsi 2011-03-03 04:42:47 PST
Created attachment 84544 [details]
proposed patch with test case
Comment 2 WebKit Review Bot 2011-03-03 04:44:06 PST
Attachment 84544 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1

Source/WebCore/css/CSSParser.cpp:3884:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Source/WebCore/css/CSSParser.cpp:3919:  An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andras Becsi 2011-03-03 04:51:12 PST
Created attachment 84545 [details]
proposed patch with test case

Fixed the style issues.
Comment 4 Andreas Kling 2011-03-03 05:35:15 PST
Comment on attachment 84545 [details]
proposed patch with test case

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

r=me, and thanks for including the test I forgot to commit ages ago! >_<

> Source/WebCore/css/CSSParser.cpp:3945
>      for (int i = 0; i < length; ++i) {

The braces for this block should be removed now.
Comment 5 Andras Becsi 2011-03-03 05:52:49 PST
Landed in http://trac.webkit.org/changeset/80235.
Comment 6 Andras Becsi 2011-03-03 05:53:26 PST
Comment on attachment 84545 [details]
proposed patch with test case

Clearing flags.
Comment 7 WebKit Review Bot 2011-03-03 07:17:36 PST
http://trac.webkit.org/changeset/80235 might have broken GTK Linux 32-bit Release
The following tests are not passing:
fast/canvas/rgba-parsing.html