https://bugs.webkit.org/show_bug.cgi?id=70471
Patch by Ben Wells <benwells@chromium.org> on 2011-11-16
Reviewed by Simon Fraser.
Source/WebCore:
Seaming is fixed by antialiasing mitred corners for edges that have alpha and are joining
a side that is of a different color.
Test: fast/borders/border-mixed-alpha.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::colorNeedsAntiAliasAtCorner):
(WebCore::RenderBoxModelObject::paintOneBorderSide):
LayoutTests:
* fast/borders/border-mixed-alpha.html: Added.
* platform/chromium/test_expectations.txt:
* platform/mac/fast/borders/border-mixed-alpha-expected.png: Added.
* platform/mac/fast/borders/border-mixed-alpha-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100528
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-11-16 Ben Wells <benwells@chromium.org>
+
+ Seaming on border corners with mixed colour alpha borders
+ https://bugs.webkit.org/show_bug.cgi?id=70471
+
+ Reviewed by Simon Fraser.
+
+ * fast/borders/border-mixed-alpha.html: Added.
+ * platform/chromium/test_expectations.txt:
+ * platform/mac/fast/borders/border-mixed-alpha-expected.png: Added.
+ * platform/mac/fast/borders/border-mixed-alpha-expected.txt: Added.
+
2011-11-16 Peter Kasting <pkasting@google.com>
[chromium] Clean up some animations/ expectations.
--- /dev/null
+<!doctype html>
+<style>
+ div {
+ width: 10px;
+ height: 100px;
+ display: inline-block;
+ border-width: 85px;
+ border-color: rgba(0, 255, 0, 0.5);
+ border-right-color: rgba(0, 0, 255, 0.5);
+ }
+ .dashed { border-style: dashed; }
+ .dotted { border-style: dotted; }
+ .solid { border-style: solid; }
+ .double { border-style: double; }
+ .groove { border-style: groove; }
+ .ridge { border-style: ridge; }
+ .inset { border-style: inset; }
+ .outset { border-style: outset; }
+</style>
+<div class="dashed"></div>
+<div class="dotted"></div>
+<div class="solid"></div>
+<div class="double"></div>
+<br>
+<div class="groove"></div>
+<div class="ridge"></div>
+<div class="inset"></div>
+<div class="outset"></div>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText(true);
+</script>
BUGWK68436 SNOWLEOPARD CPU : fast/repaint/text-emphasis-h.html = TIMEOUT IMAGE
BUGWK68436 SNOWLEOPARD CPU : svg/W3C-SVG-1.1/paths-data-12-t.svg = IMAGE+TEXT
+// New test that needs rebaselining for chromium ports
+BUGWK70471 : fast/borders/border-mixed-alpha.html = IMAGE
+// WK70471 introduces slight changes in seams for this test
+BUGWK70471 : fast/borders/mixed-border-styles.html = IMAGE
+
// Tests that are known to exhibit TEXT failures on Mac10.5 with Skia (CPU and/or GPU) graphics.
BUGWK68437 LEOPARD CPU : canvas/philip/tests/2d.text.draw.fontface.notinpage.html = TEXT
+2011-11-16 Ben Wells <benwells@chromium.org>
+
+ Seaming on border corners with mixed colour alpha borders
+ https://bugs.webkit.org/show_bug.cgi?id=70471
+
+ Reviewed by Simon Fraser.
+
+ Seaming is fixed by antialiasing mitred corners for edges that have alpha and are joining
+ a side that is of a different color.
+
+ Test: fast/borders/border-mixed-alpha.html
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::colorNeedsAntiAliasAtCorner):
+ (WebCore::RenderBoxModelObject::paintOneBorderSide):
+
2011-11-16 Sam Weinig <sam@webkit.org>
JS wrappers of DOM objects should have no-op constructors
return !borderStyleHasUnmatchedColorsAtCorner(edges[side].style, side, adjacentSide);
}
+
+static inline bool colorNeedsAntiAliasAtCorner(BoxSide side, BoxSide adjacentSide, const BorderEdge edges[])
+{
+ if (!edges[side].color.hasAlpha())
+ return false;
+
+ if (edges[side].shouldRender() != edges[adjacentSide].shouldRender())
+ return false;
+
+ if (!edgesShareColor(edges[side], edges[adjacentSide]))
+ return true;
+
+ return borderStyleHasUnmatchedColorsAtCorner(edges[side].style, side, adjacentSide);
+}
+
// This assumes that we draw in order: top, bottom, left, right.
static inline bool willBeOverdrawn(BoxSide side, BoxSide adjacentSide, const BorderEdge edges[])
{
drawBoxSideFromPath(graphicsContext, outerBorder.rect(), *path, edges, edgeToRender.width, thickness, side, style,
colorToPaint, edgeToRender.style, bleedAvoidance, includeLogicalLeftEdge, includeLogicalRightEdge);
} else {
- bool shouldClip = styleRequiresClipPolygon(edgeToRender.style) && (mitreAdjacentSide1 || mitreAdjacentSide2);
+ bool clipForStyle = styleRequiresClipPolygon(edgeToRender.style) && (mitreAdjacentSide1 || mitreAdjacentSide2);
+ bool clipAdjacentSide1 = colorNeedsAntiAliasAtCorner(side, adjacentSide1, edges) && mitreAdjacentSide1;
+ bool clipAdjacentSide2 = colorNeedsAntiAliasAtCorner(side, adjacentSide2, edges) && mitreAdjacentSide2;
+ bool shouldClip = clipForStyle || clipAdjacentSide1 || clipAdjacentSide2;
GraphicsContextStateSaver clipStateSaver(*graphicsContext, shouldClip);
if (shouldClip) {
- clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, side, !mitreAdjacentSide1, !mitreAdjacentSide2);
+ bool aliasAdjacentSide1 = clipAdjacentSide1 || (clipForStyle && mitreAdjacentSide1);
+ bool aliasAdjacentSide2 = clipAdjacentSide2 || (clipForStyle && mitreAdjacentSide2);
+ clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, side, !aliasAdjacentSide1, !aliasAdjacentSide2);
// Since we clipped, no need to draw with a mitre.
mitreAdjacentSide1 = false;
mitreAdjacentSide2 = false;