Diff
Modified: trunk/LayoutTests/ChangeLog (122693 => 122694)
--- trunk/LayoutTests/ChangeLog 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/LayoutTests/ChangeLog 2012-07-16 05:26:24 UTC (rev 122694)
@@ -1,3 +1,18 @@
+2012-07-15 Mike Lawther <[email protected]>
+
+ Fix calculation of rgba's alpha in CSS custom text
+ https://bugs.webkit.org/show_bug.cgi?id=91355
+
+ Reviewed by Ryosuke Niwa.
+
+ * 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:
+
2012-07-15 Christophe Dumez <[email protected]>
[EFL] Several media tests are flaky in DEBUG mode
Modified: trunk/LayoutTests/css3/calc/color-hsl-expected.txt (122693 => 122694)
--- trunk/LayoutTests/css3/calc/color-hsl-expected.txt 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/LayoutTests/css3/calc/color-hsl-expected.txt 2012-07-16 05:26:24 UTC (rev 122694)
@@ -4,7 +4,7 @@
PASS getComputedStyle(document.getElementById("simple"), null).color is "rgb(31, 223, 31)"
-PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(31, 223, 31, 0.699219)"
+PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(31, 223, 31, 0.701961)"
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/css3/calc/color-rgb-expected.txt (122693 => 122694)
--- trunk/LayoutTests/css3/calc/color-rgb-expected.txt 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/LayoutTests/css3/calc/color-rgb-expected.txt 2012-07-16 05:26:24 UTC (rev 122694)
@@ -6,9 +6,9 @@
PASS getComputedStyle(document.getElementById("simple"), null).color is "rgb(10, 180, 30)"
PASS getComputedStyle(document.getElementById("percentsimple"), null).color is "rgb(25, 243, 76)"
FAIL getComputedStyle(document.getElementById("percentnumber"), null).color should be rgb(26, 240, 80). Was rgb(0, 0, 0).
-PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(10, 180, 30, 0.699219)"
-PASS getComputedStyle(document.getElementById("percentalpha"), null).color is "rgba(25, 243, 76, 0.699219)"
-FAIL getComputedStyle(document.getElementById("percentnumberalpha"), null).color should be rgba(26, 240, 80, 0.496094). Was rgb(0, 0, 0).
+PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(10, 180, 30, 0.701961)"
+PASS getComputedStyle(document.getElementById("percentalpha"), null).color is "rgba(25, 243, 76, 0.701961)"
+FAIL getComputedStyle(document.getElementById("percentnumberalpha"), null).color should be rgba(26, 240, 80, 0.498039). Was rgb(0, 0, 0).
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/editing/execCommand/query-command-value-background-color-expected.txt (122693 => 122694)
--- trunk/LayoutTests/editing/execCommand/query-command-value-background-color-expected.txt 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/LayoutTests/editing/execCommand/query-command-value-background-color-expected.txt 2012-07-16 05:26:24 UTC (rev 122694)
@@ -8,6 +8,6 @@
PASS rgb(0, 128, 0) for <div style='background: green;' id=selected><span style='background-color: yellow'>hello</span><span style='background-color: blue'> world</span></div>
PASS rgb(255, 255, 0) for <div style='background: green;'><span style='background-color: yellow' id=selected>hello world</span></div>
PASS rgb(0, 128, 0) for <div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0);' id=selected>hello world</span></div>
-PASS rgba(255, 255, 0, 0.496094) for <div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>
+PASS rgba(255, 255, 0, 0.498039) for <div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>
Modified: trunk/LayoutTests/editing/execCommand/query-command-value-background-color.html (122693 => 122694)
--- trunk/LayoutTests/editing/execCommand/query-command-value-background-color.html 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/LayoutTests/editing/execCommand/query-command-value-background-color.html 2012-07-16 05:26:24 UTC (rev 122694)
@@ -55,6 +55,6 @@
test("<div style='background: green;' id=selected><span style='background-color: yellow'>hello</span><span style='background-color: blue'> world</span></div>", 'rgb(0, 128, 0)');
test("<div style='background: green;'><span style='background-color: yellow' id=selected>hello world</span></div>", 'rgb(255, 255, 0)');
test("<div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0);' id=selected>hello world</span></div>", 'rgb(0, 128, 0)');
-test("<div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>", 'rgba(255, 255, 0, 0.496094)');
+test("<div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>", 'rgba(255, 255, 0, 0.498039)');
</script>
Added: trunk/LayoutTests/fast/css/rgba-custom-text-expected.txt (0 => 122694)
--- trunk/LayoutTests/fast/css/rgba-custom-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css/rgba-custom-text-expected.txt 2012-07-16 05:26:24 UTC (rev 122694)
@@ -0,0 +1,10 @@
+Tests the CSS custom text implementation for rgba(). Note that WebKit internally stores alpha as an 8 bit value, and that 255 * 0.2 = 51 exactly. So 0.2 is able to be stored with no rounding.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(document.getElementById("test"), null).color is "rgba(0, 0, 0, 0.2)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/css/rgba-custom-text.html (0 => 122694)
--- trunk/LayoutTests/fast/css/rgba-custom-text.html (rev 0)
+++ trunk/LayoutTests/fast/css/rgba-custom-text.html 2012-07-16 05:26:24 UTC (rev 122694)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<script src=""
+<style>
+ #test {
+ color: rgba(0, 0, 0, 0.2);
+ }
+</style>
+<div id="test"></div>
+<script>
+ description("Tests the CSS custom text implementation for rgba(). Note that WebKit internally stores alpha as an 8 bit value, and that 255 * 0.2 = 51 exactly. So 0.2 is able to be stored with no rounding.");
+ shouldBeEqualToString('getComputedStyle(document.getElementById("test"), null).color', "rgba(0, 0, 0, 0.2)");
+</script>
+<script src=""
\ No newline at end of file
Modified: trunk/LayoutTests/media/track/track-cue-rendering-expected.txt (122693 => 122694)
--- trunk/LayoutTests/media/track/track-cue-rendering-expected.txt 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/LayoutTests/media/track/track-cue-rendering-expected.txt 2012-07-16 05:26:24 UTC (rev 122694)
@@ -50,6 +50,6 @@
EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontFamily == 'sans-serif') OK
EXPECTED (getComputedStyle(textTrackDisplayElement(video)).color == 'rgba(255, 255, 255, 0)') OK
-EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'display').firstChild).backgroundColor == 'rgba(0, 0, 0, 0.796875)') OK
+EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'display').firstChild).backgroundColor == 'rgba(0, 0, 0, 0.796875)'), OBSERVED 'rgba(0, 0, 0, 0.8)' FAIL
END OF TEST
Modified: trunk/Source/WebCore/ChangeLog (122693 => 122694)
--- trunk/Source/WebCore/ChangeLog 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/Source/WebCore/ChangeLog 2012-07-16 05:26:24 UTC (rev 122694)
@@ -1,3 +1,18 @@
+2012-07-15 Mike Lawther <[email protected]>
+
+ Fix calculation of rgba's alpha in CSS custom text
+ https://bugs.webkit.org/show_bug.cgi?id=91355
+
+ Reviewed by Ryosuke Niwa.
+
+ 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):
+
2012-07-15 Jason Liu <[email protected]>
[BlackBerry] We shouldn't call didFinishLoading for the old request when a new request has been sent by notifyAuthReceived.
Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (122693 => 122694)
--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2012-07-16 03:22:36 UTC (rev 122693)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2012-07-16 05:26:24 UTC (rev 122694)
@@ -1046,7 +1046,7 @@
appendNumber(result, static_cast<unsigned char>(color.blue()));
if (color.hasAlpha()) {
append(result, commaSpace);
- append(result, String::number(color.alpha() / 256.0f));
+ append(result, String::number(color.alpha() / 255.0f));
}
result.append(')');