Bug 55661

Summary: CSS RGBA fast-path color parsing should clamp of out-of-range alpha values
Product: WebKit Reporter: Andras Becsi <abecsi>
Component: CSSAssignee: Andras Becsi <abecsi>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, kling, ossy, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
proposed patch with test case
none
proposed patch with test case none

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