Skip to content

Commit

Permalink
Improve LayoutTable outer collapsed border calculation
Browse files Browse the repository at this point in the history
Remove code in LayoutTable and LayoutTableSection for computing outer
borders. Use cells' cached collapsed borders instead.

This is mostly a pure refactoring, except it affects some corner cases:
- Previously collapsed borders for colgroup were not included in table's
  border. See changes to results of
  paint/invalidation/table/cached-change-border-color.html.
- Previously when the row and the table were in different inline
  direction and the the width of some collapsed border was in odd
  number, the distribution of the 1 pixel into half outer and inner
  borders was inconsistent. Now we always give the 1 pixel in the
  same way defined in LayoutTableCell::CollapsedBOrderHalfXXX().
  See changes to results of fast/table/border-collapsing/002.html.

Change-Id: I74e6d9173e5d46933fa7456cb713c370e9e7d464
Reviewed-on: https://chromium-review.googlesource.com/515606
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Reviewed-by: Walter Korman <wkorman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476219}
  • Loading branch information
wangxianzhu authored and Commit Bot committed Jun 1, 2017
1 parent 3ac5e57 commit ed67249
Show file tree
Hide file tree
Showing 41 changed files with 424 additions and 600 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"paintInvalidations": [
{
"object": "LayoutTableCol COLGROUP id='colgroup'",
"rect": [8, 8, 166, 102],
"rect": [8, 8, 167, 104],
"reason": "style change"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,54 @@
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutTableCol COLGROUP id='colgroup'",
"rect": [8, 8, 167, 104],
"reason": "style change"
},
{
"object": "LayoutTableSection TBODY",
"rect": [7, 7, 167, 104],
"rect": [8, 8, 167, 104],
"reason": "geometry"
},
{
"object": "LayoutTableCol COLGROUP id='colgroup'",
"rect": [8, 8, 166, 102],
"reason": "style change"
"object": "LayoutTable TABLE",
"rect": [8, 108, 167, 4],
"reason": "incremental"
},
{
"object": "LayoutTableCell TD",
"rect": [64, 8, 58, 53],
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"rect": [63, 7, 58, 53],
"rect": [8, 59, 58, 53],
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"rect": [7, 58, 58, 53],
"rect": [8, 8, 58, 53],
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"rect": [7, 7, 58, 53],
"rect": [118, 60, 57, 52],
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"rect": [117, 59, 57, 52],
"rect": [118, 8, 57, 52],
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"rect": [117, 7, 57, 52],
"rect": [65, 60, 57, 52],
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"rect": [64, 59, 57, 52],
"rect": [8, 58, 56, 52],
"reason": "geometry"
},
{
Expand All @@ -68,7 +78,7 @@
},
{
"object": "LayoutTable TABLE",
"rect": [169, 8, 5, 102],
"rect": [169, 8, 6, 104],
"reason": "incremental"
}
]
Expand Down Expand Up @@ -111,6 +121,10 @@
"object": "LayoutTableSection TBODY",
"reason": "geometry"
},
{
"object": "LayoutTableRow TR",
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"reason": "geometry"
Expand All @@ -123,6 +137,10 @@
"object": "LayoutTableCell TD",
"reason": "geometry"
},
{
"object": "LayoutTableRow TR",
"reason": "geometry"
},
{
"object": "LayoutTableCell TD",
"reason": "geometry"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
layer at (0,0) size 800x600 scrollWidth 970
layer at (0,0) size 800x600 scrollWidth 971
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
layer at (0,0) size 800x600 scrollWidth 1070
layer at (0,0) size 800x600 scrollWidth 1071
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
layer at (0,0) size 800x600 scrollWidth 1066
layer at (0,0) size 800x600 scrollWidth 1067
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions third_party/WebKit/Source/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ source_set("unit_tests") {
"layout/LayoutTableCellTest.cpp",
"layout/LayoutTableRowTest.cpp",
"layout/LayoutTableSectionTest.cpp",
"layout/LayoutTableTest.cpp",
"layout/LayoutTestHelper.cpp",
"layout/LayoutTestHelper.h",
"layout/LayoutTextTest.cpp",
Expand Down
Loading

0 comments on commit ed67249

Please sign in to comment.