Bug 1521066 - Fix double border rendering of border-collapsed tables. r=jrmuizel
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 18 Jan 2019 16:49:04 +0000
changeset 454464 6c6fecd533820b4b31507307a2e3a70f1887fe23
parent 454463 5fdaf215ab1242bf140b2139f516f940096ceebe
child 454465 188f7a851811d58a97cffe44ec52df4ef5b2993b
push id35397
push useropoprus@mozilla.com
push dateSat, 19 Jan 2019 03:35:41 +0000
treeherdermozilla-central@57dc8bbbc38f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1521066
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1521066 - Fix double border rendering of border-collapsed tables. r=jrmuizel 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
@@ -3598,16 +3598,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>