Bug 1521066 - Fix double border rendering of border-collapsed tables. r=jrmuizel, a=RyanVM
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 18 Jan 2019 16:49:04 +0000
changeset 509555 a95de98740380133be0ae2e6368170cf413c021c
parent 509554 ff8f2153265d685e8486211e391a2fdc09185453
child 509556 9876a3bd6201164969f035266bb64ec983b286c6
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, RyanVM
bugs1521066
milestone65.0
Bug 1521066 - Fix double border rendering of border-collapsed tables. r=jrmuizel, a=RyanVM Gotta love C++... I missed the `break;` for that branch so we were always falling back to the solid border rendering path (which we use if the border is too small). Differential Revision: https://phabricator.services.mozilla.com/D16977
layout/painting/nsCSSRendering.cpp
testing/web-platform/tests/css/css-tables/border-collapse-double-border-notref.html
testing/web-platform/tests/css/css-tables/border-collapse-double-border.html
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -3580,16 +3580,17 @@ void nsCSSRendering::GetTableBorderSolid
             rightRect.height -= aEndBevelOffset - endBevel;
           }
           aSegments.AppendElement(
               SolidBeveledBorderSegment{rightRect,
                                         aBorderColor,
                                         {aStartBevelSide, startBevel},
                                         {aEndBevelSide, endBevel}});
         }
+        break;
       }
       // else fall through to solid
       MOZ_FALLTHROUGH;
     case StyleBorderStyle::Solid:
       aSegments.AppendElement(
           SolidBeveledBorderSegment{aBorder,
                                     aBorderColor,
                                     {aStartBevelSide, aStartBevelOffset},
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-tables/border-collapse-double-border-notref.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<title>CSS Test Reference</title>
+<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
+<link rel="author" href="https://mozilla.org" title="Mozilla">
+<table style="border-collapse: collapse; border-style: solid;">
+  <td>Should see a non-solid border</td>
+</table>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-tables/border-collapse-double-border.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<title>CSS Test: border-collapsed tables don't unconditionally render double borders as solid</title>
+<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
+<link rel="author" href="https://mozilla.org" title="Mozilla">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1521066">
+<link rel="help" href="https://drafts.csswg.org/css2/tables.html#collapsing-borders">
+<link rel="mismatch" href="border-collapse-double-border-notref.html">
+<table style="border-collapse: collapse; border-style: double;">
+  <td>Should see a non-solid border</td>
+</table>