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

Unified Diff: Source/core/layout/LayoutBox.cpp

Issue 1211523002: Table cells, rows, sections or column (groups) don't support margins. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « no previous file | Source/core/layout/LayoutTableRow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index 36c0c273c5b5abb3310c289aa2d71bc9b8a9d42a..556dd0ef53cd93c171459cf65ed3e503901f9855 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -2130,15 +2130,12 @@ bool LayoutBox::autoWidthShouldFitContent() const
void LayoutBox::computeMarginsForDirection(MarginDirection flowDirection, const LayoutBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const
{
+ // First assert that we're not calling this method on box types that don't support margins.
+ ASSERT(!isTableCell());
+ ASSERT(!isTableRow());
+ ASSERT(!isTableSection());
+ ASSERT(!isLayoutTableCol());
if (flowDirection == BlockDirection || isFloating() || isInline()) {
- if (isTableCell() && flowDirection == BlockDirection) {
- // FIXME: Not right if we allow cells to have different directionality than the table. If we do allow this, though,
- // we may just do it with an extra anonymous block inside the cell.
- marginStart = 0;
- marginEnd = 0;
- return;
- }
-
// Margins are calculated with respect to the logical width of
// the containing block (8.3)
// Inline blocks/tables and floats don't have their margins increased.
« no previous file with comments | « no previous file | Source/core/layout/LayoutTableRow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698