Ignore:
Timestamp:
Jul 15, 2012, 10:26:24 PM (13 years ago)
Author:
[email protected]
Message:

Fix calculation of rgba's alpha in CSS custom text
https://bugs.webkit.org/show_bug.cgi?id=91355

Reviewed by Ryosuke Niwa.

Source/WebCore:

Alpha values are stored as an 8 bit value. To convert this to a float in the
range [0,1], we need to divide by 255, not 256.

Test: fast/css/rgba-custom-text.html

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::customCssText):

LayoutTests:

  • css3/calc/color-hsl-expected.txt:
  • css3/calc/color-rgb-expected.txt:
  • editing/execCommand/query-command-value-background-color-expected.txt:
  • editing/execCommand/query-command-value-background-color.html:
  • fast/css/rgba-custom-text-expected.txt: Added.
  • fast/css/rgba-custom-text.html: Added.
  • media/track/track-cue-rendering-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r121599 r122694  
    10471047            if (color.hasAlpha()) {
    10481048                append(result, commaSpace);
    1049                 append(result, String::number(color.alpha() / 256.0f));
     1049                append(result, String::number(color.alpha() / 255.0f));
    10501050            }
    10511051
Note: See TracChangeset for help on using the changeset viewer.