| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 void InsertionPoint::childrenChanged(const ChildrenChange& change) | 160 void InsertionPoint::childrenChanged(const ChildrenChange& change) |
| 161 { | 161 { |
| 162 HTMLElement::childrenChanged(change); | 162 HTMLElement::childrenChanged(change); |
| 163 if (ShadowRoot* root = containingShadowRoot()) { | 163 if (ShadowRoot* root = containingShadowRoot()) { |
| 164 if (ElementShadow* rootOwner = root->owner()) | 164 if (ElementShadow* rootOwner = root->owner()) |
| 165 rootOwner->setNeedsDistributionRecalc(); | 165 rootOwner->setNeedsDistributionRecalc(); |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 Node::InsertionNotificationRequest InsertionPoint::insertedInto(ContainerNode* i
nsertionPoint) | 169 void InsertionPoint::insertedInto(ContainerNode* insertionPoint) |
| 170 { | 170 { |
| 171 HTMLElement::insertedInto(insertionPoint); | 171 HTMLElement::insertedInto(insertionPoint); |
| 172 if (ShadowRoot* root = containingShadowRoot()) { | 172 if (ShadowRoot* root = containingShadowRoot()) { |
| 173 if (ElementShadow* rootOwner = root->owner()) { | 173 if (ElementShadow* rootOwner = root->owner()) { |
| 174 rootOwner->setNeedsDistributionRecalc(); | 174 rootOwner->setNeedsDistributionRecalc(); |
| 175 if (canBeActive() && !m_registeredWithShadowRoot && insertionPoint->
treeScope().rootNode() == root) { | 175 if (canBeActive() && !m_registeredWithShadowRoot && insertionPoint->
treeScope().rootNode() == root) { |
| 176 m_registeredWithShadowRoot = true; | 176 m_registeredWithShadowRoot = true; |
| 177 root->didAddInsertionPoint(this); | 177 root->didAddInsertionPoint(this); |
| 178 if (canAffectSelector()) | 178 if (canAffectSelector()) |
| 179 rootOwner->willAffectSelector(); | 179 rootOwner->willAffectSelector(); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | |
| 184 return InsertionDone; | |
| 185 } | 183 } |
| 186 | 184 |
| 187 void InsertionPoint::removedFrom(ContainerNode* insertionPoint) | 185 void InsertionPoint::removedFrom(ContainerNode* insertionPoint) |
| 188 { | 186 { |
| 189 ShadowRoot* root = containingShadowRoot(); | 187 ShadowRoot* root = containingShadowRoot(); |
| 190 if (!root) | 188 if (!root) |
| 191 root = insertionPoint->containingShadowRoot(); | 189 root = insertionPoint->containingShadowRoot(); |
| 192 | 190 |
| 193 if (root) { | 191 if (root) { |
| 194 if (ElementShadow* rootOwner = root->owner()) | 192 if (ElementShadow* rootOwner = root->owner()) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 if (!insertionPoints) | 246 if (!insertionPoints) |
| 249 return; | 247 return; |
| 250 for (size_t i = 0; i < insertionPoints->size(); ++i) | 248 for (size_t i = 0; i < insertionPoints->size(); ++i) |
| 251 results.append(insertionPoints->at(i).get()); | 249 results.append(insertionPoints->at(i).get()); |
| 252 ASSERT(current != insertionPoints->last().get()); | 250 ASSERT(current != insertionPoints->last().get()); |
| 253 current = insertionPoints->last().get(); | 251 current = insertionPoints->last().get(); |
| 254 } | 252 } |
| 255 } | 253 } |
| 256 | 254 |
| 257 } // namespace blink | 255 } // namespace blink |
| OLD | NEW |