| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |