Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp

Issue 2890543002: Improve LayoutTable outer collapsed border calculation (Closed)
Patch Set: - Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
index f5d5d12ac1e152c06d5c1fe3814818a15dcf8983..4c6cda3fc99f97b96b97a8d6247940b2972c2bc1 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
@@ -374,107 +374,6 @@ TEST_F(LayoutTableSectionTest, OverflowingCells) {
EXPECT_EQ(big_section->FullTableEffectiveColumnSpan(), columns);
}
-TEST_F(LayoutTableSectionTest, OuterBorder) {
- SetBodyInnerHTML(
- "<table style='border-collapse: collapse'>"
- " <thead id='section1'"
- " style='border-top: hidden; border-bottom: 8px solid;"
- " border-left: hidden; border-right: 10px solid'>"
- " <tr><td>A</td><td>B</td></tr>"
- " </thead>"
- " <tbody id='section2' style='border: 10px solid'>"
- " <tr>"
- " <td style='border: hidden'>C</td>"
- " <td style='border: hidden'>D</td>"
- " </tr>"
- " </tbody>"
- " <tfoot id='section3' style='border: 10px solid'>"
- " <tr>"
- " <td style='border-top: 15px solid;"
- " border-left: 21px solid'>E</td>"
- " <td style='border-bottom: 19px solid;"
- " border-right: 25px solid'>F</td>"
- " </tr>"
- " </tfoot>"
- "</table>");
-
- auto* section1 = GetSectionByElementId("section1");
- EXPECT_EQ(-1, section1->OuterBorderBefore());
- EXPECT_EQ(4, section1->OuterBorderAfter());
- EXPECT_EQ(-1, section1->OuterBorderStart());
- EXPECT_EQ(5, section1->OuterBorderEnd());
-
- // All cells have hidden border.
- auto* section2 = GetSectionByElementId("section2");
- EXPECT_EQ(-1, section2->OuterBorderBefore());
- EXPECT_EQ(-1, section2->OuterBorderAfter());
- EXPECT_EQ(-1, section2->OuterBorderStart());
- EXPECT_EQ(-1, section2->OuterBorderEnd());
-
- // Cells have wider borders.
- auto* section3 = GetSectionByElementId("section3");
- // Cell E's border-top won.
- EXPECT_EQ(7, section3->OuterBorderBefore());
- // Cell F's border-bottom won.
- EXPECT_EQ(10, section3->OuterBorderAfter());
- // Cell E's border-left won.
- EXPECT_EQ(10, section3->OuterBorderStart());
- // Cell F's border-bottom won.
- EXPECT_EQ(13, section3->OuterBorderEnd());
-}
-
-TEST_F(LayoutTableSectionTest, OuterBorderWithCol) {
- SetBodyInnerHTML(
- "<table style='border-collapse: collapse'>"
- " <colgroup>"
- " <col colspan='2000' style='border: 10px solid'>"
- " <col colspan='2000' style='border: 20px solid'>"
- " <thead id='section1' style='border: hidden'>"
- " <tr>"
- " <td colspan='2000'>A</td>"
- " <td colspan='2000'>B</td>"
- " </tr>"
- " </thead>"
- " <tbody id='section2' style='border: 10px solid'>"
- " <tr>"
- " <td colspan='2000' style='border: hidden'>C</td>"
- " <td colspan='2000' style='border: hidden'>D</td>"
- " </tr>"
- " </tbody>"
- " <tfoot id='section3'>"
- " <tr>"
- " <td colspan='2000' style='border: 12px solid'>E</td>"
- " <td colspan='2000' style='border: 16px solid'>F</td>"
- " </tr>"
- " </tfoot>"
- "</table>");
-
- // Section has hidden border.
- auto* section1 = GetSectionByElementId("section1");
- EXPECT_EQ(-1, section1->OuterBorderBefore());
- EXPECT_EQ(-1, section1->OuterBorderAfter());
- EXPECT_EQ(-1, section1->OuterBorderStart());
- EXPECT_EQ(-1, section1->OuterBorderEnd());
-
- // All cells have hidden border.
- auto* section2 = GetSectionByElementId("section2");
- EXPECT_EQ(-1, section2->OuterBorderBefore());
- EXPECT_EQ(-1, section2->OuterBorderAfter());
- EXPECT_EQ(-1, section2->OuterBorderStart());
- EXPECT_EQ(-1, section2->OuterBorderEnd());
-
- // Combined cell and col borders.
- auto* section3 = GetSectionByElementId("section3");
- // This is wrong. Should use cell border instead of the col border.
- EXPECT_EQ(10, section3->OuterBorderBefore());
- // Col 2's border-bottom won.
- EXPECT_EQ(10, section3->OuterBorderAfter());
- // Cell E's border-left won.
- EXPECT_EQ(6, section3->OuterBorderStart());
- // Col 2's border-right won.
- EXPECT_EQ(10, section3->OuterBorderEnd());
-}
-
} // anonymous namespace
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698