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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp

Issue 2257053003: Fix a crash when pseudo elements are used for a shadow host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test Created 4 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 | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp b/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
index 06b2b29cee3bbf52179c973a42b3182b1a85eba4..691889b889681cea47cf44e3f54bdc5b526b72ad 100644
--- a/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
@@ -100,6 +100,10 @@ static HTMLSlotElement* finalDestinationSlotFor(const Node& node)
// document flat tree. See FlatTreeTraversalTest's redistribution test for details.
Node* FlatTreeTraversal::traverseSiblings(const Node& node, TraversalDirection direction)
{
+ // TODO(hayato): Stop this hack for a pseudo element because a pseudo element should not be in a document flat tree.
+ if (node.isPseudoElement())
+ return direction == TraversalDirectionForward ? node.nextSibling() : node.previousSibling();
rune 2016/08/18 23:54:54 Shouldn't LayoutTreeBuilderTraversal handle pseudo
hayato 2016/08/19 03:58:47 Good point! I missed LayoutTreeBuilderTraversal.
+
if (node.isChildOfV1ShadowHost())
return traverseSiblingsForV1HostChild(node, direction);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698