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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp

Issue 2323953003: Clarify a role of Shadow DOM related functions (Closed)
Patch Set: rebased Created 4 years, 3 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
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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 HTMLElement::trace(visitor); 258 HTMLElement::trace(visitor);
259 } 259 }
260 260
261 const InsertionPoint* resolveReprojection(const Node* projectedNode) 261 const InsertionPoint* resolveReprojection(const Node* projectedNode)
262 { 262 {
263 DCHECK(projectedNode); 263 DCHECK(projectedNode);
264 const InsertionPoint* insertionPoint = 0; 264 const InsertionPoint* insertionPoint = 0;
265 const Node* current = projectedNode; 265 const Node* current = projectedNode;
266 ElementShadow* lastElementShadow = 0; 266 ElementShadow* lastElementShadow = 0;
267 while (true) { 267 while (true) {
268 ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*current); 268 ElementShadow* shadow = shadowWhereNodeCanBeDistributedForV0(*current);
269 if (!shadow || shadow == lastElementShadow) 269 if (!shadow || shadow->isV1() || shadow == lastElementShadow)
270 break; 270 break;
271 lastElementShadow = shadow; 271 lastElementShadow = shadow;
272 const InsertionPoint* insertedTo = shadow->finalDestinationInsertionPoin tFor(projectedNode); 272 const InsertionPoint* insertedTo = shadow->finalDestinationInsertionPoin tFor(projectedNode);
273 if (!insertedTo) 273 if (!insertedTo)
274 break; 274 break;
275 DCHECK_NE(current, insertedTo); 275 DCHECK_NE(current, insertedTo);
276 current = insertedTo; 276 current = insertedTo;
277 insertionPoint = insertedTo; 277 insertionPoint = insertedTo;
278 } 278 }
279 return insertionPoint; 279 return insertionPoint;
280 } 280 }
281 281
282 void collectDestinationInsertionPoints(const Node& node, HeapVector<Member<Inser tionPoint>, 8>& results) 282 void collectDestinationInsertionPoints(const Node& node, HeapVector<Member<Inser tionPoint>, 8>& results)
283 { 283 {
284 const Node* current = &node; 284 const Node* current = &node;
285 ElementShadow* lastElementShadow = 0; 285 ElementShadow* lastElementShadow = 0;
286 while (true) { 286 while (true) {
287 ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*current); 287 ElementShadow* shadow = shadowWhereNodeCanBeDistributedForV0(*current);
288 if (!shadow || shadow == lastElementShadow) 288 if (!shadow || shadow->isV1() || shadow == lastElementShadow)
289 return; 289 return;
290 lastElementShadow = shadow; 290 lastElementShadow = shadow;
291 const DestinationInsertionPoints* insertionPoints = shadow->destinationI nsertionPointsFor(&node); 291 const DestinationInsertionPoints* insertionPoints = shadow->destinationI nsertionPointsFor(&node);
292 if (!insertionPoints) 292 if (!insertionPoints)
293 return; 293 return;
294 for (size_t i = 0; i < insertionPoints->size(); ++i) 294 for (size_t i = 0; i < insertionPoints->size(); ++i)
295 results.append(insertionPoints->at(i).get()); 295 results.append(insertionPoints->at(i).get());
296 DCHECK_NE(current, insertionPoints->last().get()); 296 DCHECK_NE(current, insertionPoints->last().get());
297 current = insertionPoints->last().get(); 297 current = insertionPoints->last().get();
298 } 298 }
299 } 299 }
300 300
301 } // namespace blink 301 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/InsertionPoint.h ('k') | third_party/WebKit/Source/core/html/HTMLContentElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698