| Index: Source/core/dom/NodeRenderingTraversal.h
|
| diff --git a/Source/core/dom/NodeRenderingTraversal.h b/Source/core/dom/NodeRenderingTraversal.h
|
| index 3d7fa11a46cdfabd57b022b785a1fed0f658753c..6fb020d33fac98f566ce12ace2ae9dfd75e086bd 100644
|
| --- a/Source/core/dom/NodeRenderingTraversal.h
|
| +++ b/Source/core/dom/NodeRenderingTraversal.h
|
| @@ -93,8 +93,11 @@ inline ContainerNode* parent(const Node* node, ParentDetails* details)
|
| inline Node* nextSibling(const Node* node)
|
| {
|
| if (!node->needsShadowTreeWalker()) {
|
| - ASSERT(nextSiblingSlow(node) == node->nextSibling());
|
| - return node->nextSibling();
|
| + Node* next = node->nextSibling();
|
| + if (!next || !next->isInsertionPoint()) {
|
| + ASSERT(nextSiblingSlow(node) == next);
|
| + return next;
|
| + }
|
| }
|
|
|
| return nextSiblingSlow(node);
|
| @@ -103,8 +106,11 @@ inline Node* nextSibling(const Node* node)
|
| inline Node* previousSibling(const Node* node)
|
| {
|
| if (!node->needsShadowTreeWalker()) {
|
| - ASSERT(previousSiblingSlow(node) == node->previousSibling());
|
| - return node->previousSibling();
|
| + Node* prev = node->previousSibling();
|
| + if (!prev || !prev->isInsertionPoint()) {
|
| + ASSERT(previousSiblingSlow(node) == prev);
|
| + return prev;
|
| + }
|
| }
|
|
|
| return previousSiblingSlow(node);
|
|
|