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

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

Issue 448893003: Add an assertion to make sure NodeRenderingTraversal::parent is called after the distribution resul… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update styleForPage Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 void ParentDetails::didTraverseInsertionPoint(const InsertionPoint* insertionPoi nt) 48 void ParentDetails::didTraverseInsertionPoint(const InsertionPoint* insertionPoi nt)
49 { 49 {
50 if (!m_insertionPoint) { 50 if (!m_insertionPoint) {
51 m_insertionPoint = insertionPoint; 51 m_insertionPoint = insertionPoint;
52 } 52 }
53 } 53 }
54 54
55 ContainerNode* parent(const Node* node, ParentDetails* details) 55 ContainerNode* parent(const Node* node, ParentDetails* details)
56 { 56 {
57 // FIXME: We should probably ASSERT(!node->document().childNeedsDistribution Recalc()) here, but
58 // a bunch of things use NodeRenderingTraversal::parent in places where that looks like it could
59 // be false.
60 ASSERT(node); 57 ASSERT(node);
58 ASSERT(!node->document().childNeedsDistributionRecalc());
61 if (isActiveInsertionPoint(*node)) 59 if (isActiveInsertionPoint(*node))
62 return 0; 60 return 0;
63 ComposedTreeWalker walker(node, ComposedTreeWalker::CanStartFromShadowBounda ry); 61 ComposedTreeWalker walker(node, ComposedTreeWalker::CanStartFromShadowBounda ry);
64 return toContainerNode(walker.traverseParent(walker.get(), details)); 62 return toContainerNode(walker.traverseParent(walker.get(), details));
65 } 63 }
66 64
67 bool contains(const ContainerNode* container, const Node* node) 65 bool contains(const ContainerNode* container, const Node* node)
68 { 66 {
69 while (node) { 67 while (node) {
70 if (node == container) 68 if (node == container)
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 for (size_t i = position + 1; i < topLayerElements.size(); ++i) { 249 for (size_t i = position + 1; i < topLayerElements.size(); ++i) {
252 if (RenderObject* renderer = topLayerElements[i]->renderer()) 250 if (RenderObject* renderer = topLayerElements[i]->renderer())
253 return renderer; 251 return renderer;
254 } 252 }
255 return 0; 253 return 0;
256 } 254 }
257 255
258 } 256 }
259 257
260 } // namespace 258 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698