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

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

Issue 1339903002: Revert "Allow whitespace inside anonymous table cells" from M46 (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2490
Patch Set: Created 5 years, 3 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-anonymous-table-cells-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 b1eda88c9f801fe8428a1c31aac2059d95dec355..0ee207e66957876b84cb5180c3794fa65e837715 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -33,7 +33,6 @@
#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"
@@ -238,28 +237,6 @@ PassRefPtrWillBeRawPtr<Node> Text::cloneNode(bool /*deep*/)
return cloneWithData(data());
}
-static inline bool hasGeneratedAnonymousTableCells(const LayoutObject& parent)
-{
- // We're checking whether the table part has generated anonymous table
- // part wrappers to hold its contents, so inspecting its first child will suffice.
- LayoutObject* child = parent.slowFirstChild();
- if (!child || !child->isAnonymous())
- return false;
- if (child->isTableCell())
- return true;
- if (child->isTableSection() || child->isTableRow())
- return hasGeneratedAnonymousTableCells(*child);
- return false;
-}
-
-static inline bool nodeAllowsAdjacentWhitespace(Node* node)
-{
- if (!node)
- return true;
- const ComputedStyle* style = node->ensureComputedStyle();
- return style && style->originalDisplay() != TABLE_CELL && !isHTMLTableCellElement(node);
-}
-
static inline bool canHaveWhitespaceChildren(const LayoutObject& parent, Text* text)
{
// <button> should allow whitespace even though LayoutFlexibleBox doesn't.
@@ -273,10 +250,6 @@ static inline bool canHaveWhitespaceChildren(const LayoutObject& parent, Text* t
|| parent.isSVGContainer()
|| parent.isSVGImage()
|| parent.isSVGShape()) {
- // Allow whitespace when the text is inside a table, section or row element that
- // has generated anonymous table cells to hold its contents.
- if (hasGeneratedAnonymousTableCells(parent))
- return nodeAllowsAdjacentWhitespace(text->previousSibling()) && nodeAllowsAdjacentWhitespace(text->nextSibling());
return false;
}
return true;
« no previous file with comments | « LayoutTests/fast/table/whitespace-in-anonymous-table-cells-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698