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

Side by Side Diff: sky/engine/core/dom/shadow/ComposedTreeWalker.cpp

Issue 1215103007: Remove remaining HTML elements (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « sky/engine/core/dom/TreeScope.cpp ('k') | sky/engine/core/dom/shadow/ElementShadow.cpp » ('j') | 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 /* 2 /*
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 Node* ComposedTreeWalker::traverseNode(const Node* node, TraversalDirection dire ction) 65 Node* ComposedTreeWalker::traverseNode(const Node* node, TraversalDirection dire ction)
66 { 66 {
67 ASSERT(node); 67 ASSERT(node);
68 if (!isActiveInsertionPoint(*node)) 68 if (!isActiveInsertionPoint(*node))
69 return const_cast<Node*>(node); 69 return const_cast<Node*>(node);
70 const InsertionPoint* insertionPoint = toInsertionPoint(node); 70 const InsertionPoint* insertionPoint = toInsertionPoint(node);
71 if (Node* found = traverseDistributedNodes(direction == TraversalDirectionFo rward ? insertionPoint->first() : insertionPoint->last(), insertionPoint, direct ion)) 71 if (Node* found = traverseDistributedNodes(direction == TraversalDirectionFo rward ? insertionPoint->first() : insertionPoint->last(), insertionPoint, direct ion))
72 return found; 72 return found;
73 ASSERT(isHTMLContentElement(node) && !node->hasChildren()); 73 ASSERT_NOT_REACHED();
74 return 0; 74 return 0;
75 } 75 }
76 76
77 Node* ComposedTreeWalker::traverseDistributedNodes(const Node* node, const Inser tionPoint* insertionPoint, TraversalDirection direction) 77 Node* ComposedTreeWalker::traverseDistributedNodes(const Node* node, const Inser tionPoint* insertionPoint, TraversalDirection direction)
78 { 78 {
79 for (const Node* next = node; next; next = (direction == TraversalDirectionF orward ? insertionPoint->nextTo(next) : insertionPoint->previousTo(next))) { 79 for (const Node* next = node; next; next = (direction == TraversalDirectionF orward ? insertionPoint->nextTo(next) : insertionPoint->previousTo(next))) {
80 if (Node* found = traverseNode(next, direction)) 80 if (Node* found = traverseNode(next, direction))
81 return found; 81 return found;
82 } 82 }
83 return 0; 83 return 0;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 Node* parent = node->parentNode(); 130 Node* parent = node->parentNode();
131 if (!parent) 131 if (!parent)
132 return 0; 132 return 0;
133 if (!parent->isShadowRoot()) 133 if (!parent->isShadowRoot())
134 return parent; 134 return parent;
135 ShadowRoot* shadowRoot = toShadowRoot(parent); 135 ShadowRoot* shadowRoot = toShadowRoot(parent);
136 return shadowRoot->host(); 136 return shadowRoot->host();
137 } 137 }
138 138
139 } // namespace 139 } // namespace
OLDNEW
« no previous file with comments | « sky/engine/core/dom/TreeScope.cpp ('k') | sky/engine/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698