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

Unified Diff: Source/core/dom/Text.cpp

Issue 1249433003: Recognize when an anonymous table cell has been generated to wrap a cell (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 5 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 | « LayoutTests/fast/table/whitespace-in-table-cells-when-div-appended-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Text.cpp
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 71ce46fafe31b261b867f458704327e75b04cf5b..cbe43473484023544e5c5095819cd984c78a5cf2 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -33,6 +33,7 @@
#include "core/dom/NodeTraversal.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/ScopedEventQueue.h"
+#include "core/html/HTMLTableCellElement.h"
#include "core/layout/LayoutText.h"
#include "core/layout/LayoutTextCombine.h"
#include "core/layout/svg/LayoutSVGInlineText.h"
@@ -244,8 +245,11 @@ static inline bool hasGeneratedAnonymousTableCells(const LayoutObject& parent)
LayoutObject* child = parent.slowFirstChild();
if (!child || !child->isAnonymous())
return false;
- if (child->isTableCell())
- return true;
+ if (child->isTableCell()) {
+ LayoutObject* firstChild = child->slowFirstChild();
+ // Ignore the anonymous table cell if it is wrapping a table cell element (e.g. because of <td style="display:block;">).
+ return !firstChild || !firstChild->node() || !isHTMLTableCellElement(firstChild->node());
+ }
if (child->isTableSection() || child->isTableRow())
return hasGeneratedAnonymousTableCells(*child);
return false;
« no previous file with comments | « LayoutTests/fast/table/whitespace-in-table-cells-when-div-appended-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698