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

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

Issue 1280123004: Don't allow whitespace between elements with display:table-cell (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 4 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 | « Source/core/layout/LayoutTableRow.h ('k') | Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTableRow.cpp
diff --git a/Source/core/layout/LayoutTableRow.cpp b/Source/core/layout/LayoutTableRow.cpp
index 93adae4e3a52fe9d8fc78885c4e233eb403f34c1..6ae84c4cddd93443b2f33f4746ca98b19ec86efa 100644
--- a/Source/core/layout/LayoutTableRow.cpp
+++ b/Source/core/layout/LayoutTableRow.cpp
@@ -105,9 +105,21 @@ const BorderValue& LayoutTableRow::borderAdjoiningEndCell(const LayoutTableCell*
return style()->borderEnd();
}
+void LayoutTableRow::createAndAddAnonymousCell(LayoutObject* child, LayoutObject* beforeChild)
+{
+ LayoutTableCell* cell = LayoutTableCell::createAnonymousWithParent(this);
+ addChild(cell, beforeChild);
+ cell->addChild(child);
+}
+
void LayoutTableRow::addChild(LayoutObject* child, LayoutObject* beforeChild)
{
if (!child->isTableCell()) {
+ if (child->style()->display() == TABLE_CELL) {
+ createAndAddAnonymousCell(child, beforeChild);
esprehn 2015/08/17 17:58:54 This doesn't feel like a good idea, does the input
rhogan 2015/08/17 18:16:57 We don't ignore it anymore (see below in LayoutThe
esprehn 2015/08/17 18:27:08 Yeah I don't think that's a good idea, it means th
+ return;
+ }
+
LayoutObject* last = beforeChild;
if (!last)
last = lastCell();
@@ -133,9 +145,7 @@ void LayoutTableRow::addChild(LayoutObject* child, LayoutObject* beforeChild)
return;
}
- LayoutTableCell* cell = LayoutTableCell::createAnonymousWithParent(this);
- addChild(cell, beforeChild);
- cell->addChild(child);
+ createAndAddAnonymousCell(child, beforeChild);
return;
}
« no previous file with comments | « Source/core/layout/LayoutTableRow.h ('k') | Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698