[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
simon.fraser at apple.com
simon.fraser at apple.com
Fri Jan 21 15:00:26 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit b81b821c8c2df97013a41b1615aa64d7d650878d
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 6 05:28:11 2011 +0000
2011-01-05 Simon Fraser <simon.fraser at apple.com>
Reviewed by Darin Adler.
Fix percentage values in radius of radial gradients
https://bugs.webkit.org/show_bug.cgi?id=51979
Handle percentage values for the ending size of radial gradients.
Test: fast/gradients/css3-radial-gradients3.html
* css/CSSGradientValue.cpp:
(WebCore::CSSRadialGradientValue::resolveRadius): Add parameter for height or width, which is
non-null if percentage values are allowed, and compute percentage values when we see them.
(WebCore::CSSRadialGradientValue::createGradient): Pass height or width down to say that
percentages are OK when resolving end radii.
* css/CSSGradientValue.h: New parameter for resolveRadius.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 35abd13..9122e61 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-05 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix percentage values in radius of radial gradients
+ https://bugs.webkit.org/show_bug.cgi?id=51979
+
+ * fast/gradients/css3-radial-gradients3-expected.txt: Added.
+ * fast/gradients/css3-radial-gradients3.html: Added.
+ * platform/mac/fast/gradients/css3-radial-gradients3-expected.checksum: Added.
+ * platform/mac/fast/gradients/css3-radial-gradients3-expected.png: Added.
+
2011-01-05 James Simonsen <simonjam at chromium.org>
Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/gradients/css3-radial-gradients3-expected.txt b/LayoutTests/fast/gradients/css3-radial-gradients3-expected.txt
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/LayoutTests/fast/gradients/css3-radial-gradients3-expected.txt
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/fast/gradients/css3-radial-gradients3.html b/LayoutTests/fast/gradients/css3-radial-gradients3.html
new file mode 100644
index 0000000..e85879d
--- /dev/null
+++ b/LayoutTests/fast/gradients/css3-radial-gradients3.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .box {
+ display: inline-block;
+ height: 200px;
+ width: 250px;
+ margin: 10px;
+ border: 1px solid black;
+ background-repeat: no-repeat;
+ }
+
+ .gradient1 {
+ background-image: -webkit-radial-gradient(center, 50% 50%, black, white);
+ background-image: -moz-radial-gradient(center, 50% 50%, black, white);
+ }
+
+ .gradient2 {
+ background-image: -webkit-repeating-radial-gradient(center, 20% 20%, black, white, black);
+ background-image: -moz-repeating-radial-gradient(center, 20% 20%, black, white, black);
+ }
+
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ if (window.layoutTestController) {
+ var dumpPixels = true;
+ layoutTestController.dumpAsText(dumpPixels);
+ }
+ </script>
+</head>
+<body>
+
+ <div class="gradient1 box"></div>
+ <div class="gradient2 box"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients3-expected.checksum b/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients3-expected.checksum
new file mode 100644
index 0000000..323efae
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients3-expected.checksum
@@ -0,0 +1 @@
+2893e4c8aa16d0c0e273dddba296107a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients3-expected.png b/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients3-expected.png
new file mode 100644
index 0000000..4329e05
Binary files /dev/null and b/LayoutTests/platform/mac/fast/gradients/css3-radial-gradients3-expected.png differ
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 96f2700..a271e5b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2011-01-05 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix percentage values in radius of radial gradients
+ https://bugs.webkit.org/show_bug.cgi?id=51979
+
+ Handle percentage values for the ending size of radial gradients.
+
+ Test: fast/gradients/css3-radial-gradients3.html
+
+ * css/CSSGradientValue.cpp:
+ (WebCore::CSSRadialGradientValue::resolveRadius): Add parameter for height or width, which is
+ non-null if percentage values are allowed, and compute percentage values when we see them.
+ (WebCore::CSSRadialGradientValue::createGradient): Pass height or width down to say that
+ percentages are OK when resolving end radii.
+ * css/CSSGradientValue.h: New parameter for resolveRadius.
+
2011-01-05 James Simonsen <simonjam at chromium.org>
Reviewed by Adam Barth.
diff --git a/WebCore/css/CSSGradientValue.cpp b/WebCore/css/CSSGradientValue.cpp
index 2a3b64a..8040c6c 100644
--- a/WebCore/css/CSSGradientValue.cpp
+++ b/WebCore/css/CSSGradientValue.cpp
@@ -600,13 +600,15 @@ String CSSRadialGradientValue::cssText() const
return result;
}
-float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle)
+float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, float* widthOrHeight)
{
float zoomFactor = style->effectiveZoom();
float result = 0;
if (radius->primitiveType() == CSSPrimitiveValue::CSS_NUMBER) // Can the radius be a percentage?
result = radius->getFloatValue() * zoomFactor;
+ else if (widthOrHeight && radius->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
+ result = *widthOrHeight * radius->getFloatValue() / 100;
else
result = radius->computeLengthFloat(style, rootStyle, zoomFactor);
@@ -717,8 +719,10 @@ PassRefPtr<Gradient> CSSRadialGradientValue::createGradient(RenderObject* render
if (m_secondRadius)
secondRadius = resolveRadius(m_secondRadius.get(), renderer->style(), rootStyle);
else if (m_endHorizontalSize || m_endVerticalSize) {
- secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle);
- aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle);
+ float width = size.width();
+ float height = size.height();
+ secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle, &width);
+ aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle, &height);
} else {
enum GradientShape { Circle, Ellipse };
GradientShape shape = Ellipse;
diff --git a/WebCore/css/CSSGradientValue.h b/WebCore/css/CSSGradientValue.h
index 81b80f3..0b5ca77 100644
--- a/WebCore/css/CSSGradientValue.h
+++ b/WebCore/css/CSSGradientValue.h
@@ -152,7 +152,7 @@ private:
virtual PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
// Resolve points/radii to front end values.
- float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle);
+ float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, float* widthOrHeight = 0);
// These may be null for non-deprecated gradients.
RefPtr<CSSPrimitiveValue> m_firstRadius;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list