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

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

Issue 2791433003: Fix Border collapsing with colpsan / rowspan cells
Patch Set: bug 2902 Created 3 years, 8 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/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index 2899bc53beb04101f6b4d49581903d96d20d9a76..0665497504bbb6fa047c5f579269e881b020f5ec 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1068,7 +1068,7 @@ void LayoutTableSection::DistributeRemainingExtraLogicalHeight(
if (extra_logical_height <= 0 || !row_pos_[total_rows])
return;
- // FIXME: m_rowPos[totalRows] - m_rowPos[0] is the total rows' size.
+ // FIXME: row_pos_[totalRows] - row_pos_[0] is the total rows' size.
int total_row_size = row_pos_[total_rows];
int total_logical_height_added = 0;
int previous_row_position = row_pos_[0];
@@ -2164,13 +2164,45 @@ bool LayoutTableSection::MapToVisualRectInAncestorSpaceInternal(
ancestor, transform_state, flags);
}
-bool LayoutTableSection::PaintedOutputOfObjectHasNoEffectRegardlessOfSize()
- const {
- // LayoutTableSection paints background from columns.
- if (Table()->HasColElements())
- return false;
- return LayoutTableBoxComponent::
- PaintedOutputOfObjectHasNoEffectRegardlessOfSize();
+LayoutRect LayoutTableSection::GetCellPosition(
+ unsigned row,
+ unsigned effective_column) const {
+ LayoutTable* table = this->Table();
+ LayoutUnit left =
+ LayoutUnit(table->EffectiveColumnPositions()[effective_column]);
+ LayoutUnit top = LayoutUnit(row_pos_[row]);
+ unsigned rightCol = std::min<unsigned>(
+ table->EffectiveColumnPositions().size() - 1, effective_column + 1);
+ unsigned bottom_row = std::min<unsigned>(row_pos_.size() - 1, row + 1);
+ LayoutUnit right = LayoutUnit(table->EffectiveColumnPositions()[rightCol]);
+ LayoutUnit bottom = LayoutUnit(row_pos_[bottom_row]);
+ left += LayoutUnit(table->HBorderSpacing());
+ return LayoutRect(left, top, right - left, bottom - top);
+}
+
+LayoutRect LayoutTableSection::GetCellPhysicalPosition(
+ unsigned row,
+ unsigned effective_column) const {
+ return TransformLogicalToPhysicalPosition(
+ GetCellPosition(row, effective_column));
+}
+
+LayoutRect LayoutTableSection::TransformLogicalToPhysicalPosition(
+ const LayoutRect& position) const {
+ WritingMode writingMode = Style()->GetWritingMode();
+ bool is_ltr = Style()->IsLeftToRightDirection();
+ LayoutRect transformed_position = position;
+ if (blink::IsHorizontalWritingMode(writingMode)) {
+ if (!is_ltr)
+ transformed_position.SetX(Size().Width() - transformed_position.MaxX());
+ } else {
+ transformed_position = transformed_position.TransposedRect();
+ if (!is_ltr)
+ transformed_position.SetY(Size().Height() - transformed_position.MaxY());
+ if (blink::IsFlippedBlocksWritingMode(writingMode))
+ transformed_position.SetX(Size().Width() - transformed_position.MaxX());
+ }
+ return transformed_position;
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableSection.h ('k') | third_party/WebKit/Source/core/paint/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698