From 3ad7017163720386c8dbd39fc32e3c40dfc605ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?=
Date: Mon, 9 Jan 2023 18:02:23 +0000
Subject: [PATCH] Bug 1807963 - Remove non-standard values of caption-side for
good. r=TYLin,layout-reviewers
They have been disabled since bug 1688695. There's a variety of
table-caption bugs that would be easier to fix if we didn't have to
account for side-captions.
Differential Revision: https://phabricator.services.mozilla.com/D165690
---
.../shared/css/generated/properties-db.js | 4 -
dom/base/test/test_bug414190.html | 31 +-
dom/html/HTMLTableCaptionElement.cpp | 2 -
layout/generic/ReflowInput.cpp | 14 -
layout/generic/nsContainerFrame.cpp | 51 +-
.../bugs/1062963-floatmanager-reflow-ref.html | 55 -
.../bugs/1062963-floatmanager-reflow.html | 83 --
layout/reftests/bugs/134706-6b.html | 64 -
layout/reftests/bugs/134706-6c.html | 64 -
.../bugs/427129-table-caption-ref.html | 715 ++---------
.../reftests/bugs/427129-table-caption.html | 1120 +++--------------
layout/reftests/bugs/478614-6-ref.html | 16 -
layout/reftests/bugs/478614-6.html | 16 -
layout/reftests/bugs/478614-7-ref.html | 18 -
layout/reftests/bugs/478614-7.html | 17 -
layout/reftests/bugs/reftest.list | 11 +-
.../grid-item-table-stretch-003-ref.html | 191 ---
.../css-grid/grid-item-table-stretch-003.html | 180 ---
layout/reftests/css-grid/reftest.list | 1 -
.../reftests/margin-collapsing/reftest.list | 13 -
.../table-caption-bottom-outside-1-dyn.html | 48 -
.../table-caption-bottom-outside-1.html | 41 -
.../table-caption-bottom-outside-2-dyn.html | 43 -
.../table-caption-bottom-outside-2.html | 36 -
.../table-caption-top-outside-1-dyn.html | 48 -
.../table-caption-top-outside-1.html | 41 -
.../table-caption-top-outside-2-dyn.html | 43 -
.../table-caption-top-outside-2.html | 36 -
layout/reftests/pagination/reftest.list | 4 -
.../table-caption-splitaftercaption-10.html | 23 -
.../table-caption-splitaftercaption-11.html | 23 -
...table-caption-splitaftercaption-6-ref.html | 28 -
.../table-caption-splitaftercaption-6.html | 22 -
...table-caption-splitaftercaption-7-ref.html | 28 -
.../table-caption-splitaftercaption-7.html | 22 -
.../reftests/writing-mode/tables/reftest.list | 4 +-
.../tables/table-caption-left-1-ref.html | 65 -
.../tables/table-caption-left-1.html | 71 --
.../tables/table-caption-right-1-ref.html | 65 -
.../tables/table-caption-right-1.html | 71 --
layout/style/test/property_database.js | 18 +-
layout/tables/nsTableWrapperFrame.cpp | 325 +----
layout/tables/nsTableWrapperFrame.h | 29 +-
modules/libpref/init/StaticPrefList.yaml | 7 -
.../style/values/specified/table.rs | 20 +-
.../floats/floats-wrap-bfc-006b.xht.ini | 2 -
.../floats/floats-wrap-bfc-006c.xht.ini | 2 -
.../floats/floats-wrap-bfc-006b.xht | 63 -
.../floats/floats-wrap-bfc-006c.xht | 63 -
49 files changed, 345 insertions(+), 3612 deletions(-)
delete mode 100644 layout/reftests/bugs/1062963-floatmanager-reflow-ref.html
delete mode 100644 layout/reftests/bugs/1062963-floatmanager-reflow.html
delete mode 100644 layout/reftests/bugs/134706-6b.html
delete mode 100644 layout/reftests/bugs/134706-6c.html
delete mode 100644 layout/reftests/bugs/478614-6-ref.html
delete mode 100644 layout/reftests/bugs/478614-6.html
delete mode 100644 layout/reftests/bugs/478614-7-ref.html
delete mode 100644 layout/reftests/bugs/478614-7.html
delete mode 100644 layout/reftests/css-grid/grid-item-table-stretch-003-ref.html
delete mode 100644 layout/reftests/css-grid/grid-item-table-stretch-003.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-bottom-outside-1-dyn.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-bottom-outside-1.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-bottom-outside-2-dyn.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-bottom-outside-2.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-top-outside-1-dyn.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-top-outside-1.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-top-outside-2-dyn.html
delete mode 100644 layout/reftests/margin-collapsing/table-caption-top-outside-2.html
delete mode 100644 layout/reftests/pagination/table-caption-splitaftercaption-10.html
delete mode 100644 layout/reftests/pagination/table-caption-splitaftercaption-11.html
delete mode 100644 layout/reftests/pagination/table-caption-splitaftercaption-6-ref.html
delete mode 100644 layout/reftests/pagination/table-caption-splitaftercaption-6.html
delete mode 100644 layout/reftests/pagination/table-caption-splitaftercaption-7-ref.html
delete mode 100644 layout/reftests/pagination/table-caption-splitaftercaption-7.html
delete mode 100644 layout/reftests/writing-mode/tables/table-caption-left-1-ref.html
delete mode 100644 layout/reftests/writing-mode/tables/table-caption-left-1.html
delete mode 100644 layout/reftests/writing-mode/tables/table-caption-right-1-ref.html
delete mode 100644 layout/reftests/writing-mode/tables/table-caption-right-1.html
delete mode 100644 testing/web-platform/meta/css/css-tables/floats/floats-wrap-bfc-006b.xht.ini
delete mode 100644 testing/web-platform/meta/css/css-tables/floats/floats-wrap-bfc-006c.xht.ini
delete mode 100644 testing/web-platform/tests/css/css-tables/floats/floats-wrap-bfc-006b.xht
delete mode 100644 testing/web-platform/tests/css/css-tables/floats/floats-wrap-bfc-006c.xht
diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js
index 42af6a75fede..a4a322577742 100644
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -5621,15 +5621,11 @@ exports.CSS_PROPERTIES = {
"supports": [],
"values": [
"bottom",
- "bottom-outside",
"inherit",
"initial",
- "left",
"revert",
"revert-layer",
- "right",
"top",
- "top-outside",
"unset"
]
},
diff --git a/dom/base/test/test_bug414190.html b/dom/base/test/test_bug414190.html
index a8a6f7f81838..813d35ae7d4d 100644
--- a/dom/base/test/test_bug414190.html
+++ b/dom/base/test/test_bug414190.html
@@ -40,7 +40,7 @@ function runTest() {
var tableBoundingRect = table.getBoundingClientRect();
var cellBoundingRect = cell.getBoundingClientRect();
var captionBoundingRect = caption.getBoundingClientRect();
-
+
is(tableRects.length, 2, "Table should have rects for body and caption");
isEqualRect(tableRects[0], cellBoundingRect, 10,
"Table first rect should be cell rect");
@@ -51,41 +51,18 @@ function runTest() {
is(captionBoundingRect.right - captionBoundingRect.left, 50, "Caption incorrect width");
is(captionBoundingRect.bottom - captionBoundingRect.top, 70, "Caption incorrect height");
is(captionBoundingRect.top, cellBoundingRect.bottom + 10, "Discontiguous vertical geometry");
-
+
is(tableBoundingRect.top, cellBoundingRect.top - 10, "Table top error");
is(tableBoundingRect.left, cellBoundingRect.left - 10, "Table left error");
is(tableBoundingRect.bottom, captionBoundingRect.bottom, "Table bottom error");
is(tableBoundingRect.right, cellBoundingRect.right + 10, "Table right error");
-
- caption.style.captionSide = "left";
-
- tableRects = table.getClientRects();
- tableBoundingRect = table.getBoundingClientRect();
- cellBoundingRect = cell.getBoundingClientRect();
- captionBoundingRect = caption.getBoundingClientRect();
-
- is(tableRects.length, 2, "Table should have rects for body and caption");
- isEqualRect(tableRects[0], cellBoundingRect, 10,
- "Table first rect should be cell rect plus border");
- isEqualRect(tableRects[1], captionBoundingRect, 0,
- "Table second rect should be caption rect");
- is(cellBoundingRect.right - cellBoundingRect.left, 80, "Cell incorrect width");
- is(cellBoundingRect.bottom - cellBoundingRect.top, 100, "Cell incorrect height");
- is(captionBoundingRect.right - captionBoundingRect.left, 50, "Caption incorrect width");
- is(captionBoundingRect.bottom - captionBoundingRect.top, 70, "Caption incorrect height");
- is(captionBoundingRect.right + 10, cellBoundingRect.left, "Discontiguous horizontal geometry");
- is(tableBoundingRect.top, cellBoundingRect.top - 10, "Table top error");
- is(tableBoundingRect.left, captionBoundingRect.left, "Table left error");
- is(tableBoundingRect.bottom, cellBoundingRect.bottom + 10, "Table bottom error");
- is(tableBoundingRect.right, cellBoundingRect.right + 10, "Table right error");
+
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
-addLoadEvent(function() {
- SpecialPowers.pushPrefEnv({"set": [["layout.css.caption-side-non-standard.enabled", true]]}, runTest);
-});
+addLoadEvent(runTest);
-
-
-
-
diff --git a/dom/html/HTMLTableCaptionElement.cpp b/dom/html/HTMLTableCaptionElement.cpp
index f3b384b843bb..01b1f3e7c782 100644
--- a/dom/html/HTMLTableCaptionElement.cpp
+++ b/dom/html/HTMLTableCaptionElement.cpp
@@ -26,8 +26,6 @@ JSObject* HTMLTableCaptionElement::WrapNode(JSContext* aCx,
NS_IMPL_ELEMENT_CLONE(HTMLTableCaptionElement)
static const nsAttrValue::EnumTable kCaptionAlignTable[] = {
- {"left", StyleCaptionSide::Left},
- {"right", StyleCaptionSide::Right},
{"top", StyleCaptionSide::Top},
{"bottom", StyleCaptionSide::Bottom},
{nullptr, 0}};
diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp
index 1fd53a654484..d5e6b17d4ace 100644
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -2127,17 +2127,6 @@ static eNormalLineHeightControl GetNormalLineHeightCalcControl(void) {
return sNormalLineHeightControl;
}
-static inline bool IsSideCaption(nsIFrame* aFrame,
- const nsStyleDisplay* aStyleDisplay,
- WritingMode aWM) {
- if (aStyleDisplay->mDisplay != StyleDisplay::TableCaption) {
- return false;
- }
- auto captionSide = aFrame->StyleTableBorder()->mCaptionSide;
- return captionSide == StyleCaptionSide::Left ||
- captionSide == StyleCaptionSide::Right;
-}
-
// XXX refactor this code to have methods for each set of properties
// we are computing: width,height,line-height; margin; offsets
@@ -2425,9 +2414,6 @@ void ReflowInput::InitConstraints(
if (!isBlockLevel) {
return false;
}
- if (IsSideCaption(mFrame, mStyleDisplay, cbwm)) {
- return false;
- }
if (mStyleDisplay->mDisplay == StyleDisplay::InlineTable) {
return false;
}
diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp
index 09a3704f311f..e76355d02cfd 100644
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -954,45 +954,22 @@ LogicalSize nsContainerFrame::ComputeAutoSize(
AutoMaybeDisableFontInflation an(this);
WritingMode tableWM = GetParent()->GetWritingMode();
- StyleCaptionSide captionSide = StyleTableBorder()->mCaptionSide;
-
if (aWM.IsOrthogonalTo(tableWM)) {
- if (captionSide == StyleCaptionSide::Top ||
- captionSide == StyleCaptionSide::TopOutside ||
- captionSide == StyleCaptionSide::Bottom ||
- captionSide == StyleCaptionSide::BottomOutside) {
- // For an orthogonal caption on a block-dir side of the table,
- // shrink-wrap to min-isize.
- result.ISize(aWM) = GetMinISize(aRenderingContext);
- } else {
- // An orthogonal caption on an inline-dir side of the table
- // is constrained to the containing block.
- nscoord pref = GetPrefISize(aRenderingContext);
- if (pref > aCBSize.ISize(aWM)) {
- pref = aCBSize.ISize(aWM);
- }
- if (pref < result.ISize(aWM)) {
- result.ISize(aWM) = pref;
- }
- }
+ // For an orthogonal caption on a block-dir side of the table, shrink-wrap
+ // to min-isize.
+ result.ISize(aWM) = GetMinISize(aRenderingContext);
} else {
- if (captionSide == StyleCaptionSide::Left ||
- captionSide == StyleCaptionSide::Right) {
- result.ISize(aWM) = GetMinISize(aRenderingContext);
- } else if (captionSide == StyleCaptionSide::Top ||
- captionSide == StyleCaptionSide::Bottom) {
- // The outer frame constrains our available isize to the isize of
- // the table. Grow if our min-isize is bigger than that, but not
- // larger than the containing block isize. (It would really be nice
- // to transmit that information another way, so we could grow up to
- // the table's available isize, but that's harder.)
- nscoord min = GetMinISize(aRenderingContext);
- if (min > aCBSize.ISize(aWM)) {
- min = aCBSize.ISize(aWM);
- }
- if (min > result.ISize(aWM)) {
- result.ISize(aWM) = min;
- }
+ // The outer frame constrains our available isize to the isize of
+ // the table. Grow if our min-isize is bigger than that, but not
+ // larger than the containing block isize. (It would really be nice
+ // to transmit that information another way, so we could grow up to
+ // the table's available isize, but that's harder.)
+ nscoord min = GetMinISize(aRenderingContext);
+ if (min > aCBSize.ISize(aWM)) {
+ min = aCBSize.ISize(aWM);
+ }
+ if (min > result.ISize(aWM)) {
+ result.ISize(aWM) = min;
}
}
}
diff --git a/layout/reftests/bugs/1062963-floatmanager-reflow-ref.html b/layout/reftests/bugs/1062963-floatmanager-reflow-ref.html
deleted file mode 100644
index adde9d36313c..000000000000
--- a/layout/reftests/bugs/1062963-floatmanager-reflow-ref.html
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
Reftest, bug 1062963
-
-
-
-
-
-