| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 const DestinationInsertionPoints* ElementShadow::destinationInsertionPointsFor(c
onst Node* key) const | 248 const DestinationInsertionPoints* ElementShadow::destinationInsertionPointsFor(c
onst Node* key) const |
| 249 { | 249 { |
| 250 ASSERT(key && !key->document().childNeedsDistributionRecalc()); | 250 ASSERT(key && !key->document().childNeedsDistributionRecalc()); |
| 251 NodeToDestinationInsertionPoints::const_iterator it = m_nodeToInsertionPoint
s.find(key); | 251 NodeToDestinationInsertionPoints::const_iterator it = m_nodeToInsertionPoint
s.find(key); |
| 252 return it == m_nodeToInsertionPoints.end() ? 0: &it->value; | 252 return it == m_nodeToInsertionPoints.end() ? 0: &it->value; |
| 253 } | 253 } |
| 254 | 254 |
| 255 void ElementShadow::distribute() | 255 void ElementShadow::distribute() |
| 256 { | 256 { |
| 257 host()->setNeedsStyleRecalc(SubtreeStyleChange); | 257 host()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing:
:create(StyleChangeReason::Shadow)); |
| 258 WillBeHeapVector<RawPtrWillBeMember<HTMLShadowElement>, 32> shadowInsertionP
oints; | 258 WillBeHeapVector<RawPtrWillBeMember<HTMLShadowElement>, 32> shadowInsertionP
oints; |
| 259 DistributionPool pool(*host()); | 259 DistributionPool pool(*host()); |
| 260 | 260 |
| 261 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { | 261 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow
Root()) { |
| 262 HTMLShadowElement* shadowInsertionPoint = 0; | 262 HTMLShadowElement* shadowInsertionPoint = 0; |
| 263 const WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> >& insertionPo
ints = root->descendantInsertionPoints(); | 263 const WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> >& insertionPo
ints = root->descendantInsertionPoints(); |
| 264 for (size_t i = 0; i < insertionPoints.size(); ++i) { | 264 for (size_t i = 0; i < insertionPoints.size(); ++i) { |
| 265 InsertionPoint* point = insertionPoints[i].get(); | 265 InsertionPoint* point = insertionPoints[i].get(); |
| 266 if (!point->isActive()) | 266 if (!point->isActive()) |
| 267 continue; | 267 continue; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 visitor->trace(m_nodeToInsertionPoints); | 361 visitor->trace(m_nodeToInsertionPoints); |
| 362 visitor->trace(m_selectFeatures); | 362 visitor->trace(m_selectFeatures); |
| 363 // Shadow roots are linked with previous and next pointers which are traced. | 363 // Shadow roots are linked with previous and next pointers which are traced. |
| 364 // It is therefore enough to trace one of the shadow roots here and the | 364 // It is therefore enough to trace one of the shadow roots here and the |
| 365 // rest will be traced from there. | 365 // rest will be traced from there. |
| 366 visitor->trace(m_shadowRoots.head()); | 366 visitor->trace(m_shadowRoots.head()); |
| 367 #endif | 367 #endif |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace | 370 } // namespace |
| OLD | NEW |