| 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "core/dom/QualifiedName.h" | 36 #include "core/dom/QualifiedName.h" |
| 37 #include "core/dom/StaticNodeList.h" | 37 #include "core/dom/StaticNodeList.h" |
| 38 #include "core/dom/shadow/ElementShadow.h" | 38 #include "core/dom/shadow/ElementShadow.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document& document) | 42 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document& document) |
| 43 : HTMLElement(tagName, document, CreateInsertionPoint) | 43 : HTMLElement(tagName, document, CreateInsertionPoint) |
| 44 , m_registeredWithShadowRoot(false) | 44 , m_registeredWithShadowRoot(false) |
| 45 { | 45 { |
| 46 setHasCustomStyleCallbacks(); | |
| 47 } | 46 } |
| 48 | 47 |
| 49 InsertionPoint::~InsertionPoint() | 48 InsertionPoint::~InsertionPoint() |
| 50 { | 49 { |
| 51 } | 50 } |
| 52 | 51 |
| 53 void InsertionPoint::setDistribution(ContentDistribution& distribution) | 52 void InsertionPoint::setDistribution(ContentDistribution& distribution) |
| 54 { | 53 { |
| 55 if (shouldUseFallbackElements()) { | 54 if (shouldUseFallbackElements()) { |
| 56 for (Node* child = firstChild(); child; child = child->nextSibling()) | 55 for (Node* child = firstChild(); child; child = child->nextSibling()) |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 root->didRemoveInsertionPoint(this); | 231 root->didRemoveInsertionPoint(this); |
| 233 if (rootOwner) { | 232 if (rootOwner) { |
| 234 if (canAffectSelector()) | 233 if (canAffectSelector()) |
| 235 rootOwner->willAffectSelector(); | 234 rootOwner->willAffectSelector(); |
| 236 } | 235 } |
| 237 } | 236 } |
| 238 | 237 |
| 239 HTMLElement::removedFrom(insertionPoint); | 238 HTMLElement::removedFrom(insertionPoint); |
| 240 } | 239 } |
| 241 | 240 |
| 242 void InsertionPoint::trace(Visitor* visitor) | |
| 243 { | |
| 244 visitor->trace(m_distribution); | |
| 245 HTMLElement::trace(visitor); | |
| 246 } | |
| 247 | |
| 248 const InsertionPoint* resolveReprojection(const Node* projectedNode) | 241 const InsertionPoint* resolveReprojection(const Node* projectedNode) |
| 249 { | 242 { |
| 250 ASSERT(projectedNode); | 243 ASSERT(projectedNode); |
| 251 const InsertionPoint* insertionPoint = 0; | 244 const InsertionPoint* insertionPoint = 0; |
| 252 const Node* current = projectedNode; | 245 const Node* current = projectedNode; |
| 253 ElementShadow* lastElementShadow = 0; | 246 ElementShadow* lastElementShadow = 0; |
| 254 while (true) { | 247 while (true) { |
| 255 ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*current); | 248 ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*current); |
| 256 if (!shadow || shadow == lastElementShadow) | 249 if (!shadow || shadow == lastElementShadow) |
| 257 break; | 250 break; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 279 if (!insertionPoints) | 272 if (!insertionPoints) |
| 280 return; | 273 return; |
| 281 for (size_t i = 0; i < insertionPoints->size(); ++i) | 274 for (size_t i = 0; i < insertionPoints->size(); ++i) |
| 282 results.append(insertionPoints->at(i).get()); | 275 results.append(insertionPoints->at(i).get()); |
| 283 ASSERT(current != insertionPoints->last().get()); | 276 ASSERT(current != insertionPoints->last().get()); |
| 284 current = insertionPoints->last().get(); | 277 current = insertionPoints->last().get(); |
| 285 } | 278 } |
| 286 } | 279 } |
| 287 | 280 |
| 288 } // namespace blink | 281 } // namespace blink |
| OLD | NEW |