Reviewed by Adam Roben.
Some repeating linear gradients look wrong
https://bugs.webkit.org/show_bug.cgi?id=61371
Test: fast/gradients/css3-repeating-linear-gradients2.html
Fix incorrect stop duplication code when filling forwards a repeating
gradient. The "if (srcStopOrdinal < originalNumStops - 1)" test was wrong
because srcStopOrdinal had been adjusted for stops added by start-filling,
but originalNumStops had not. Fix by considering srcStopOrdinal as an index
into the original stops, so comparing it with originalNumStops remains valid.
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::addStops):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87389
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2011-05-25 Simon Fraser <simon.fraser@apple.com>
+ Reviewed by Adam Roben.
+
+ Some repeating linear gradients look wrong
+ https://bugs.webkit.org/show_bug.cgi?id=61371
+
+ Pixel test for repeating linear gradient.
+
+ * fast/gradients/css3-repeating-linear-gradients2-expected.txt: Added.
+ * fast/gradients/css3-repeating-linear-gradients2.html: Added.
+ * platform/mac/fast/gradients/css3-repeating-linear-gradients2-expected.png: Added.
+
+2011-05-25 Simon Fraser <simon.fraser@apple.com>
+
Reviewed by Dan Bernstein.
Always antialias table borders when scaling
--- /dev/null
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .box {
+ display: inline-block;
+ height: 120px;
+ width: 400px;
+ margin: 10px;
+ border: 1px solid black;
+ background-repeat: no-repeat;
+ }
+
+ .linear1 {
+ background-image: -webkit-repeating-linear-gradient(0deg, green 150px, blue 175px, blue 200px);
+ background-image: -moz-repeating-linear-gradient(0deg, green 150px, blue 175px, blue 200px);
+ }
+ </style>
+ <script>
+ if (window.layoutTestController) {
+ var dumpPixels = true;
+ layoutTestController.dumpAsText(dumpPixels);
+ }
+ </script>
+</head>
+<body>
+
+ <div class="linear1 box"></div>
+
+</body>
+</html>
+2011-05-26 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Some repeating linear gradients look wrong
+ https://bugs.webkit.org/show_bug.cgi?id=61371
+
+ Test: fast/gradients/css3-repeating-linear-gradients2.html
+
+ Fix incorrect stop duplication code when filling forwards a repeating
+ gradient. The "if (srcStopOrdinal < originalNumStops - 1)" test was wrong
+ because srcStopOrdinal had been adjusted for stops added by start-filling,
+ but originalNumStops had not. Fix by considering srcStopOrdinal as an index
+ into the original stops, so comparing it with originalNumStops remains valid.
+
+ * css/CSSGradientValue.cpp:
+ (WebCore::CSSGradientValue::addStops):
+
2011-05-26 Vsevolod Vlasov <vsevik@chromium.org>
Reviewed by Yury Semikhatsky.
float lastOffset = stops[stops.size() - 1].offset;
if (lastOffset < maxExtent) {
float currOffset = lastOffset;
- size_t srcStopOrdinal = originalFirstStopIndex;
+ size_t srcStopOrdinal = 0;
while (true) {
- GradientStop newStop = stops[srcStopOrdinal];
+ size_t srcStopIndex = originalFirstStopIndex + srcStopOrdinal;
+ GradientStop newStop = stops[srcStopIndex];
newStop.offset = currOffset;
stops.append(newStop);
if (currOffset > maxExtent)
break;
if (srcStopOrdinal < originalNumStops - 1)
- currOffset += stops[srcStopOrdinal + 1].offset - stops[srcStopOrdinal].offset;
+ currOffset += stops[srcStopIndex + 1].offset - stops[srcStopIndex].offset;
srcStopOrdinal = (srcStopOrdinal + 1) % originalNumStops;
}
}