From ca50a57545a3ef3a9aded85a9dc17f6a4ee1ebb9 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Wed, 13 May 2020 19:57:18 +0300 Subject: issue #1547 - Correct z-ordering for some table parts and add reftests --- .../table-bordercollapse/bug1394226-notref.html | 63 ++++++++++++++++++++++ .../table-bordercollapse/bug1394226-ref.html | 47 ++++++++++++++++ .../reftests/table-bordercollapse/bug1394226.html | 47 ++++++++++++++++ layout/reftests/table-bordercollapse/reftest.list | 2 + layout/tables/nsTableWrapperFrame.cpp | 7 ++- 5 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 layout/reftests/table-bordercollapse/bug1394226-notref.html create mode 100644 layout/reftests/table-bordercollapse/bug1394226-ref.html create mode 100644 layout/reftests/table-bordercollapse/bug1394226.html diff --git a/layout/reftests/table-bordercollapse/bug1394226-notref.html b/layout/reftests/table-bordercollapse/bug1394226-notref.html new file mode 100644 index 0000000000..7c4b694a99 --- /dev/null +++ b/layout/reftests/table-bordercollapse/bug1394226-notref.html @@ -0,0 +1,63 @@ + + + +Table border collapse + + + +
+ + + + + + + + + + +
Cell 1-1Cell 1-2
Cell 2-1Cell 2-2 + + + + + + + + + +
Cell 2-2/1-1Cell 2-2/1-2
Cell 2-2/2-1Cell 2-2/2-2
+
+ + \ No newline at end of file diff --git a/layout/reftests/table-bordercollapse/bug1394226-ref.html b/layout/reftests/table-bordercollapse/bug1394226-ref.html new file mode 100644 index 0000000000..11c72d4bb5 --- /dev/null +++ b/layout/reftests/table-bordercollapse/bug1394226-ref.html @@ -0,0 +1,47 @@ + + + +Table border collapse + + + +
+ + + + + + + + + +
Cell 1-1Cell 1-2
Cell 2-1Cell 2-2 + + + + + + + + + +
Cell 2-2/1-1Cell 2-2/1-2
Cell 2-2/2-1Cell 2-2/2-2
+
+ + \ No newline at end of file diff --git a/layout/reftests/table-bordercollapse/bug1394226.html b/layout/reftests/table-bordercollapse/bug1394226.html new file mode 100644 index 0000000000..04c8ab1734 --- /dev/null +++ b/layout/reftests/table-bordercollapse/bug1394226.html @@ -0,0 +1,47 @@ + + + +Table border collapse + + + + + + + + + + + + + +
Cell 1-1Cell 1-2
Cell 2-1Cell 2-2 + + + + + + + + + +
Cell 2-2/1-1Cell 2-2/1-2
Cell 2-2/2-1Cell 2-2/2-2
+
+ + \ No newline at end of file diff --git a/layout/reftests/table-bordercollapse/reftest.list b/layout/reftests/table-bordercollapse/reftest.list index aac4934d69..2610d202d8 100644 --- a/layout/reftests/table-bordercollapse/reftest.list +++ b/layout/reftests/table-bordercollapse/reftest.list @@ -3,6 +3,8 @@ == bug1375518-3.html bug1375518-ref.html == bug1375518-4.html bug1375518-4-ref.html == bug1375518-5.html bug1375518-5-ref.html +== bug1394226.html bug1394226-ref.html +!= bug1394226.html bug1394226-notref.html == bc_dyn_cell1.html bc_dyn_cell1_ref.html == bc_dyn_cell2.html bc_dyn_cell2_ref.html == bc_dyn_cell3.html bc_dyn_cell3_ref.html diff --git a/layout/tables/nsTableWrapperFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp index 476024e96d..86f032218e 100644 --- a/layout/tables/nsTableWrapperFrame.cpp +++ b/layout/tables/nsTableWrapperFrame.cpp @@ -187,8 +187,11 @@ nsTableWrapperFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, BuildDisplayListForChild(aBuilder, mCaptionFrames.FirstChild(), captionSet); // Now we have to sort everything by content order, since the caption - // may be somewhere inside the table - set.BlockBorderBackgrounds()->SortByContentOrder(GetContent()); + // may be somewhere inside the table. + // We don't sort BlockBorderBackgrounds and BorderBackgrounds because the + // display items in those lists should stay out of content order in order to + // follow the rules in https://www.w3.org/TR/CSS21/zindex.html#painting-order + // and paint the caption background after all of the rest. set.Floats()->SortByContentOrder(GetContent()); set.Content()->SortByContentOrder(GetContent()); set.PositionedDescendants()->SortByContentOrder(GetContent()); -- cgit v1.2.3