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

Side by Side Diff: Source/core/dom/NodeRenderingTraversal.h

Issue 14731014: Added another guard to the NodeRenderingContext::nextSibling() fast path and its twin. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/dom/shadow/content-element-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #endif 86 #endif
87 return node->parentNodeGuaranteedHostFree(); 87 return node->parentNodeGuaranteedHostFree();
88 } 88 }
89 89
90 return parentSlow(node, details); 90 return parentSlow(node, details);
91 } 91 }
92 92
93 inline Node* nextSibling(const Node* node) 93 inline Node* nextSibling(const Node* node)
94 { 94 {
95 if (!node->needsShadowTreeWalker()) { 95 if (!node->needsShadowTreeWalker()) {
96 ASSERT(nextSiblingSlow(node) == node->nextSibling()); 96 Node* next = node->nextSibling();
97 return node->nextSibling(); 97 if (!next || !next->isInsertionPoint()) {
98 ASSERT(nextSiblingSlow(node) == next);
99 return next;
100 }
98 } 101 }
99 102
100 return nextSiblingSlow(node); 103 return nextSiblingSlow(node);
101 } 104 }
102 105
103 inline Node* previousSibling(const Node* node) 106 inline Node* previousSibling(const Node* node)
104 { 107 {
105 if (!node->needsShadowTreeWalker()) { 108 if (!node->needsShadowTreeWalker()) {
106 ASSERT(previousSiblingSlow(node) == node->previousSibling()); 109 Node* prev = node->previousSibling();
107 return node->previousSibling(); 110 if (!prev || !prev->isInsertionPoint()) {
111 ASSERT(previousSiblingSlow(node) == prev);
112 return prev;
113 }
108 } 114 }
109 115
110 return previousSiblingSlow(node); 116 return previousSiblingSlow(node);
111 } 117 }
112 118
113 } 119 }
114 120
115 } // namespace WebCore 121 } // namespace WebCore
116 122
117 #endif 123 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/content-element-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698