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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp

Issue 2846563002: Optimize collapsed border calculation (step 1) (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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 bool HasEndBorderAdjoiningTable(const LayoutTableCell* cell) { 79 bool HasEndBorderAdjoiningTable(const LayoutTableCell* cell) {
80 return cell->HasEndBorderAdjoiningTable(); 80 return cell->HasEndBorderAdjoiningTable();
81 } 81 }
82 82
83 LayoutTableCell* GetCellByElementId(const char* id) { 83 LayoutTableCell* GetCellByElementId(const char* id) {
84 return ToLayoutTableCell(GetLayoutObjectByElementId(id)); 84 return ToLayoutTableCell(GetLayoutObjectByElementId(id));
85 } 85 }
86 }; 86 };
87 87
88 TEST_F(LayoutTableCellTest, AbsoluteColumnIndex) {
89 auto* cell = LayoutTableCell::CreateAnonymous(&GetDocument());
90 EXPECT_FALSE(cell->HasSetAbsoluteColumnIndex());
91 cell->SetAbsoluteColumnIndex(kMaxColumnIndex);
92 EXPECT_TRUE(cell->HasSetAbsoluteColumnIndex());
93 EXPECT_NE(kUnsetColumnIndex, cell->AbsoluteColumnIndex());
94 EXPECT_EQ(kMaxColumnIndex, cell->AbsoluteColumnIndex());
95 }
96
88 TEST_F(LayoutTableCellTest, ResetColspanIfTooBig) { 97 TEST_F(LayoutTableCellTest, ResetColspanIfTooBig) {
89 SetBodyInnerHTML("<table><td id='cell' colspan='14000'></td></table>"); 98 SetBodyInnerHTML("<table><td id='cell' colspan='14000'></td></table>");
90 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U); 99 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U);
91 } 100 }
92 101
93 TEST_F(LayoutTableCellTest, DoNotResetColspanJustBelowBoundary) { 102 TEST_F(LayoutTableCellTest, DoNotResetColspanJustBelowBoundary) {
94 SetBodyInnerHTML("<table><td id='cell' colspan='8190'></td></table>"); 103 SetBodyInnerHTML("<table><td id='cell' colspan='8190'></td></table>");
95 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U); 104 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U);
96 } 105 }
97 106
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 EXPECT_TRUE(HasStartBorderAdjoiningTable(cell23)); 245 EXPECT_TRUE(HasStartBorderAdjoiningTable(cell23));
237 EXPECT_FALSE(HasEndBorderAdjoiningTable(cell23)); 246 EXPECT_FALSE(HasEndBorderAdjoiningTable(cell23));
238 247
239 EXPECT_FALSE(HasStartBorderAdjoiningTable(cell31)); 248 EXPECT_FALSE(HasStartBorderAdjoiningTable(cell31));
240 EXPECT_FALSE(HasEndBorderAdjoiningTable(cell31)); 249 EXPECT_FALSE(HasEndBorderAdjoiningTable(cell31));
241 EXPECT_FALSE(HasStartBorderAdjoiningTable(cell32)); 250 EXPECT_FALSE(HasStartBorderAdjoiningTable(cell32));
242 EXPECT_FALSE(HasEndBorderAdjoiningTable(cell32)); 251 EXPECT_FALSE(HasEndBorderAdjoiningTable(cell32));
243 } 252 }
244 253
245 } // namespace blink 254 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698