Bug 1525698 - Don't generate outlines for table-column or table-column-group elements. r=emilio
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 09 Apr 2019 00:00:05 +0000
changeset 468455 a7c00b62990f02b45c956cf371b1cb593ff5cfb9
parent 468454 674e4d7ead23c5b6c76a4c77abe86be8b8aaa8af
child 468456 05cee7dc3b5ca0745802c80a27f13c2dc4638ebe
push id35838
push usernerli@mozilla.com
push dateTue, 09 Apr 2019 09:54:40 +0000
treeherdermozilla-central@6efaae3bcd67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1525698
milestone68.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 1525698 - Don't generate outlines for table-column or table-column-group elements. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D26432
layout/generic/nsFrame.cpp
testing/web-platform/meta/css/CSS2/ui/outline-applies-to-005.xht.ini
testing/web-platform/meta/css/CSS2/ui/outline-applies-to-006.xht.ini
testing/web-platform/meta/css/CSS2/ui/outline-color-applies-to-005.xht.ini
testing/web-platform/meta/css/CSS2/ui/outline-color-applies-to-006.xht.ini
testing/web-platform/meta/css/CSS2/ui/outline-style-applies-to-005.xht.ini
testing/web-platform/meta/css/CSS2/ui/outline-style-applies-to-006.xht.ini
testing/web-platform/meta/css/CSS2/ui/outline-width-applies-to-005.xht.ini
testing/web-platform/meta/css/CSS2/ui/outline-width-applies-to-006.xht.ini
testing/web-platform/tests/css/CSS2/ui/outline-applies-to-016-ref.xht
testing/web-platform/tests/css/CSS2/ui/outline-applies-to-016.xht
testing/web-platform/tests/css/CSS2/ui/outline-applies-to-017.xht
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2345,16 +2345,24 @@ void nsFrame::DisplaySelectionOverlay(ns
 }
 
 void nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
                                           const nsDisplayListSet& aLists) {
   if (!StyleOutline()->ShouldPaintOutline()) {
     return;
   }
 
+  if (IsTableColGroupFrame() || IsTableColFrame()) {
+    // Per https://drafts.csswg.org/css-tables-3/#global-style-overrides:
+    // "All css properties of table-column and table-column-group boxes are
+    // ignored, except when explicitly specified by this specification."
+    // CSS outlines fall into this category, so we skip them on these boxes.
+    return;
+  }
+
   aLists.Outlines()->AppendNewToTop<nsDisplayOutline>(aBuilder, this);
 }
 
 void nsFrame::DisplayOutline(nsDisplayListBuilder* aBuilder,
                              const nsDisplayListSet& aLists) {
   if (!IsVisibleForPainting()) return;
 
   DisplayOutlineUnconditional(aBuilder, aLists);
--- a/testing/web-platform/meta/css/CSS2/ui/outline-applies-to-005.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-applies-to-005.xht.ini
@@ -1,4 +1,2 @@
 [outline-applies-to-005.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
--- a/testing/web-platform/meta/css/CSS2/ui/outline-applies-to-006.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-applies-to-006.xht.ini
@@ -1,4 +1,2 @@
 [outline-applies-to-006.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
--- a/testing/web-platform/meta/css/CSS2/ui/outline-color-applies-to-005.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-color-applies-to-005.xht.ini
@@ -1,4 +1,2 @@
 [outline-color-applies-to-005.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
--- a/testing/web-platform/meta/css/CSS2/ui/outline-color-applies-to-006.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-color-applies-to-006.xht.ini
@@ -1,4 +1,2 @@
 [outline-color-applies-to-006.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
--- a/testing/web-platform/meta/css/CSS2/ui/outline-style-applies-to-005.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-style-applies-to-005.xht.ini
@@ -1,4 +1,2 @@
 [outline-style-applies-to-005.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
--- a/testing/web-platform/meta/css/CSS2/ui/outline-style-applies-to-006.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-style-applies-to-006.xht.ini
@@ -1,4 +1,2 @@
 [outline-style-applies-to-006.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
--- a/testing/web-platform/meta/css/CSS2/ui/outline-width-applies-to-005.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-width-applies-to-005.xht.ini
@@ -1,4 +1,2 @@
 [outline-width-applies-to-005.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
--- a/testing/web-platform/meta/css/CSS2/ui/outline-width-applies-to-006.xht.ini
+++ b/testing/web-platform/meta/css/CSS2/ui/outline-width-applies-to-006.xht.ini
@@ -1,4 +1,2 @@
 [outline-width-applies-to-006.xht]
-  expected:
-    if webrender: FAIL
   max-asserts: 2
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/ui/outline-applies-to-016-ref.xht
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>CSS Test Reference</title>
+        <style type="text/css">
+            #test
+            {
+                outline: solid blue 10px;
+                height: 1in;
+                width: 1in;
+            }
+            #table
+            {
+                display: table;
+            }
+        </style>
+    </head>
+    <body>
+        <p>Test passes if there is a blue box below.</p>
+        <div id="table">
+            <img id="test"></img>
+        </div>
+    </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/ui/outline-applies-to-016.xht
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>CSS Test: Outline applied to replaced element with display table-column-group</title>
+        <link rel="help" href="http://www.w3.org/TR/CSS21/ui.html#propdef-outline" />
+        <link rel="help" href="http://www.w3.org/TR/CSS21/ui.html#dynamic-outlines" />
+        <link rel="match" href="outline-applies-to-016-ref.xht"/>
+        <meta name="flags" content="" />
+        <meta name="assert" content="The 'outline' property applies to replaced elements with a display of table-column-group." />
+        <style type="text/css">
+            #test
+            {
+                display: table-column-group;
+                outline: solid blue 10px;
+                height: 1in;
+                width: 1in;
+            }
+            #table
+            {
+                display: table;
+            }
+        </style>
+    </head>
+    <body>
+        <p>Test passes if there is a blue box below.</p>
+        <div id="table">
+            <img id="test"></img>
+        </div>
+    </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/ui/outline-applies-to-017.xht
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>CSS Test: Outline applied to replaced element with display table-column</title>
+        <link rel="help" href="http://www.w3.org/TR/CSS21/ui.html#propdef-outline" />
+        <link rel="help" href="http://www.w3.org/TR/CSS21/ui.html#dynamic-outlines" />
+        <link rel="match" href="outline-applies-to-016-ref.xht"/>
+        <meta name="flags" content="" />
+        <meta name="assert" content="The 'outline' property applies to replaced elements with a display of table-column." />
+        <style type="text/css">
+            #test
+            {
+                display: table-column;
+                outline: solid blue 10px;
+                height: 1in;
+                width: 1in;
+            }
+            #table
+            {
+                display: table;
+            }
+        </style>
+    </head>
+    <body>
+        <p>Test passes if there is a blue box below.</p>
+        <div id="table">
+            <img id="test"></img>
+        </div>
+    </body>
+</html>