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

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

Issue 2803383002: The first table row is pushed down by border-spacing. (Closed)
Patch Set: break-inside:avoid on a row shouldn't prevent breaking inside adjacent border spacing 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableSection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index 8f0a6e468121e26f941585f7d7624a6fc555cbb6..275532bb4fd737759e67a6f72a4a27292d04d4dc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -828,6 +828,14 @@ void LayoutTableSection::UpdateBaselineForCell(LayoutTableCell* cell,
}
}
+int LayoutTableSection::VBorderSpacingBeforeFirstRow() const {
+ // We ignore the border-spacing on any non-top section, as it is already
+ // included in the previous section's last row position.
+ if (this != Table()->TopSection())
+ return 0;
+ return Table()->VBorderSpacing();
+}
+
int LayoutTableSection::CalcRowLogicalHeight() {
#if DCHECK_IS_ON()
SetLayoutNeededForbiddenScope layout_forbidden_scope(*this);
@@ -842,13 +850,7 @@ int LayoutTableSection::CalcRowLogicalHeight() {
LayoutState state(*this);
row_pos_.resize(grid_.size() + 1);
-
- // We ignore the border-spacing on any non-top section as it is already
- // included in the previous section's last row position.
- if (this == Table()->TopSection())
- row_pos_[0] = Table()->VBorderSpacing();
- else
- row_pos_[0] = 0;
+ row_pos_[0] = VBorderSpacingBeforeFirstRow();
SpanningLayoutTableCells row_span_cells;
@@ -962,7 +964,7 @@ void LayoutTableSection::UpdateLayout() {
LayoutState state(*this);
const Vector<int>& column_pos = Table()->EffectiveColumnPositions();
- LayoutUnit row_logical_top;
+ LayoutUnit row_logical_top(VBorderSpacingBeforeFirstRow());
SubtreeLayoutScope layouter(*this);
for (unsigned r = 0; r < grid_.size(); ++r) {
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableSection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698