[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
arv at chromium.org
arv at chromium.org
Wed Dec 22 15:28:16 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 4e08dfc34f12032a3be99162cee160049d52dfd8
Author: arv at chromium.org <arv at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 4 09:24:07 2010 +0000
2010-11-04 Erik Arvidsson <arv at chromium.org>
Reviewed by Tony Chang.
Computed style is not correct for negative values in the presence of zooming
https://bugs.webkit.org/show_bug.cgi?id=48855
Updated the test to include some negative values. I also added tests for zoom less than one which in turn
forced me to increase the values because we lose a lot of precision when zooming out.
* fast/css/getComputedStyle/computed-style-with-zoom-expected.txt: Updated the expectations
* fast/css/getComputedStyle/script-tests/computed-style-with-zoom.js: Updated tests.
2010-11-04 Erik Arvidsson <arv at chromium.org>
Reviewed by Tony Chang.
Computed style is not correct for negative values in the presence of zooming
https://bugs.webkit.org/show_bug.cgi?id=48855
* rendering/style/RenderStyle.h:
(WebCore::adjustForAbsoluteZoom): When the value is less than zero we need to decrement instead of increment.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b18a4b0..5cd671a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-04 Erik Arvidsson <arv at chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Computed style is not correct for negative values in the presence of zooming
+ https://bugs.webkit.org/show_bug.cgi?id=48855
+
+ Updated the test to include some negative values. I also added tests for zoom less than one which in turn
+ forced me to increase the values because we lose a lot of precision when zooming out.
+
+ * fast/css/getComputedStyle/computed-style-with-zoom-expected.txt: Updated the expectations
+ * fast/css/getComputedStyle/script-tests/computed-style-with-zoom.js: Updated tests.
+
2010-11-04 Shane Stephens <shanestephens at google.com>
Reviewed by Tony Chang.
diff --git a/LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom-expected.txt b/LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom-expected.txt
index 0b6c008..31b8b59 100644
--- a/LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom-expected.txt
+++ b/LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom-expected.txt
@@ -3,47 +3,58 @@ Tests that computed style is not affected by the zoom value
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS -webkit-border-horizontal-spacing, value: "5px"
-PASS -webkit-border-vertical-spacing, value: "5px"
-PASS -webkit-box-reflect, value: "below 5px -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(white)) 0 0 0 0 stretch stretch"
-PASS -webkit-box-shadow, value: "rgb(255, 0, 0) 5px 5px 5px 5px"
-PASS -webkit-column-rule-width, value: "5px"
-PASS -webkit-perspective-origin, value: "5px 5px"
-PASS -webkit-text-stroke-width, value: "5px"
-PASS -webkit-transform, value: "matrix(1, 0, 0, 1, 5, 5)"
-PASS -webkit-transform, value: "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 5, 5, 5, 1)"
-PASS -webkit-transform-origin, value: "5px 5px"
-PASS border-bottom-left-radius, value: "5px"
-PASS border-bottom-right-radius, value: "5px"
-PASS border-bottom-width, value: "5px"
-PASS border-left-width, value: "5px"
-PASS border-right-width, value: "5px"
-PASS border-spacing, value: "5px 5px"
-PASS border-top-left-radius, value: "5px"
-PASS border-top-right-radius, value: "5px"
-PASS border-top-width, value: "5px"
-PASS bottom, value: "5px"
-PASS clip, value: "rect(5px 95px 95px 5px)"
-PASS font-size, value: "5px"
-PASS font-size, value: "16px"
-PASS height, value: "5px"
-PASS left, value: "5px"
-PASS letter-spacing, value: "5px"
-PASS line-height, value: "5px"
-PASS margin-bottom, value: "5px"
-PASS margin-left, value: "5px"
-PASS margin-right, value: "5px"
-PASS margin-top, value: "5px"
-PASS outline-width, value: "5px"
-PASS padding-bottom, value: "5px"
-PASS padding-left, value: "5px"
-PASS padding-right, value: "5px"
-PASS padding-top, value: "5px"
-PASS right, value: "5px"
-PASS text-shadow, value: "rgb(255, 0, 0) 5px 5px 5px"
-PASS top, value: "5px"
-PASS width, value: "5px"
-PASS word-spacing, value: "5px"
+PASS -webkit-border-horizontal-spacing, value: "20px"
+PASS -webkit-border-vertical-spacing, value: "20px"
+PASS -webkit-box-reflect, value: "below 20px -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(white)) 0 0 0 0 stretch stretch"
+PASS -webkit-box-shadow, value: "rgb(255, 0, 0) 20px 20px 20px 20px"
+PASS -webkit-column-rule-width, value: "20px"
+PASS -webkit-perspective-origin, value: "20px 20px"
+PASS -webkit-text-stroke-width, value: "20px"
+PASS -webkit-transform, value: "matrix(1, 0, 0, 1, 20, 20)"
+PASS -webkit-transform, value: "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 20, 20, 20, 1)"
+PASS -webkit-transform-origin, value: "20px 20px"
+PASS -webkit-transform-origin, value: "-20px -20px"
+PASS border-bottom-left-radius, value: "20px"
+PASS border-bottom-right-radius, value: "20px"
+PASS border-bottom-width, value: "20px"
+PASS border-left-width, value: "20px"
+PASS border-right-width, value: "20px"
+PASS border-spacing, value: "20px 20px"
+PASS border-top-left-radius, value: "20px"
+PASS border-top-right-radius, value: "20px"
+PASS border-top-width, value: "20px"
+PASS bottom, value: "20px"
+PASS bottom, value: "-20px"
+PASS clip, value: "rect(20px 80px 80px 20px)"
+PASS font-size, value: "20px"
+PASS font-size, value: "18px"
+PASS height, value: "20px"
+PASS left, value: "20px"
+PASS left, value: "-20px"
+PASS letter-spacing, value: "20px"
+PASS letter-spacing, value: "-20px"
+PASS line-height, value: "20px"
+PASS margin-bottom, value: "20px"
+PASS margin-bottom, value: "-20px"
+PASS margin-left, value: "20px"
+PASS margin-left, value: "-20px"
+PASS margin-right, value: "20px"
+PASS margin-right, value: "-20px"
+PASS margin-top, value: "20px"
+PASS margin-top, value: "-20px"
+PASS outline-width, value: "20px"
+PASS padding-bottom, value: "20px"
+PASS padding-left, value: "20px"
+PASS padding-right, value: "20px"
+PASS padding-top, value: "20px"
+PASS right, value: "20px"
+PASS right, value: "-20px"
+PASS text-shadow, value: "rgb(255, 0, 0) 20px 20px 20px"
+PASS top, value: "20px"
+PASS top, value: "-20px"
+PASS width, value: "20px"
+PASS word-spacing, value: "20px"
+PASS word-spacing, value: "-20px"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/css/getComputedStyle/script-tests/computed-style-with-zoom.js b/LayoutTests/fast/css/getComputedStyle/script-tests/computed-style-with-zoom.js
index a5ad9d4..35e07b4 100644
--- a/LayoutTests/fast/css/getComputedStyle/script-tests/computed-style-with-zoom.js
+++ b/LayoutTests/fast/css/getComputedStyle/script-tests/computed-style-with-zoom.js
@@ -4,7 +4,7 @@ function testProperty(data)
{
var prop = data[0];
if (data.length == 1)
- data.push('5px');
+ data.push('20px');
for (var i = 1; i < data.length; i++) {
testPropertyValue(prop, data[i]);
@@ -15,8 +15,8 @@ function testPropertyValue(prop, value)
{
var el = document.createElement('div');
el.style.cssText = 'position: absolute; width: 100px; height: 100px;' +
- 'overflow: hidden; border: 1px solid red;' +
- 'outline: 1px solid blue;-webkit-column-rule: 1px solid red';
+ 'overflow: hidden; border: 20px solid red;' +
+ 'outline: 20px solid blue;-webkit-column-rule: 20px solid red';
el.style.setProperty(prop, value, '');
document.body.style.zoom = '';
@@ -25,26 +25,28 @@ function testPropertyValue(prop, value)
var value1 = getComputedStyle(el, null).getPropertyValue(prop);
document.body.style.zoom = 2;
var value2 = getComputedStyle(el, null).getPropertyValue(prop);
+ document.body.style.zoom = .5;
+ var value3 = getComputedStyle(el, null).getPropertyValue(prop);
document.body.removeChild(el);
document.body.style.zoom = '';
- if (typeof value1 === 'string' && value1 === value2)
+ if (typeof value1 === 'string' && value1 === value2 && value2 == value3)
testPassed(prop + ', value: "' + value1 + '"');
else
- testFailed(prop + ', value1: "' + value1 + '", value2: "' + value2 + '"');
+ testFailed(prop + ', value1: "' + value1 + '", value2: "' + value2 + '", value3: "' + value3 + '"');
}
var testData = [
['-webkit-border-horizontal-spacing'],
['-webkit-border-vertical-spacing'],
- ['-webkit-box-reflect', 'below 5px -webkit-gradient(linear, left top, left bottom, from(transparent), to(white))'],
- ['-webkit-box-shadow', '5px 5px 5px 5px red'],
- ['-webkit-column-rule-width', '5px'],
- ['-webkit-perspective-origin', '5px 5px'],
+ ['-webkit-box-reflect', 'below 20px -webkit-gradient(linear, left top, left bottom, from(transparent), to(white))'],
+ ['-webkit-box-shadow', '20px 20px 20px 20px red'],
+ ['-webkit-column-rule-width', '20px'],
+ ['-webkit-perspective-origin', '20px 20px'],
['-webkit-text-stroke-width'],
- ['-webkit-transform', 'translate(5px, 5px)', 'translate3d(5px, 5px, 5px)'],
- ['-webkit-transform-origin', '5px 5px'],
+ ['-webkit-transform', 'translate(20px, 20px)', 'translate3d(20px, 20px, 20px)'],
+ ['-webkit-transform-origin', '20px 20px', '-20px -20px'],
['border-bottom-left-radius'],
['border-bottom-right-radius'],
['border-bottom-width'],
@@ -54,30 +56,29 @@ var testData = [
['border-top-left-radius'],
['border-top-right-radius'],
['border-top-width'],
- ['bottom'],
- ['clip', 'rect(5px 95px 95px 5px)'],
- ['font-size', '5px', 'medium'],
+ ['bottom', '20px', '-20px'],
+ ['clip', 'rect(20px 80px 80px 20px)'],
+ ['font-size', '20px', 'large'],
['height'],
- ['left'],
- ['letter-spacing'],
+ ['left', '20px', '-20px'],
+ ['letter-spacing', '20px', '-20px'],
['line-height'],
- ['margin-bottom'],
- ['margin-left'],
- ['margin-right'],
- ['margin-top'],
+ ['margin-bottom', '20px', '-20px'],
+ ['margin-left', '20px', '-20px'],
+ ['margin-right', '20px', '-20px'],
+ ['margin-top', '20px', '-20px'],
['outline-width'],
['padding-bottom'],
['padding-left'],
['padding-right'],
['padding-top'],
- ['right'],
- ['text-shadow', '5px 5px 5px red'],
- ['top'],
+ ['right', '20px', '-20px'],
+ ['text-shadow', '20px 20px 20px red'],
+ ['top', '20px', '-20px'],
['width'],
- ['word-spacing'],
+ ['word-spacing', '20px', '-20px'],
];
testData.forEach(testProperty);
successfullyParsed = true;
-
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 87e9806..bf1439e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-04 Erik Arvidsson <arv at chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Computed style is not correct for negative values in the presence of zooming
+ https://bugs.webkit.org/show_bug.cgi?id=48855
+
+ * rendering/style/RenderStyle.h:
+ (WebCore::adjustForAbsoluteZoom): When the value is less than zero we need to decrement instead of increment.
+
2010-11-04 Shane Stephens <shanestephens at google.com>
Reviewed by Tony Chang.
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 69a0828..ed0f9d2 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -1319,8 +1319,12 @@ inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
if (zoomFactor == 1)
return value;
// Needed because computeLengthInt truncates (rather than rounds) when scaling up.
- if (zoomFactor > 1)
- value++;
+ if (zoomFactor > 1) {
+ if (value < 0)
+ value--;
+ else
+ value++;
+ }
return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list