| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 m_distribution.swap(distribution); | 94 m_distribution.swap(distribution); |
| 95 m_distribution.shrinkToFit(); | 95 m_distribution.shrinkToFit(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void InsertionPoint::attach(const AttachContext& context) | 98 void InsertionPoint::attach(const AttachContext& context) |
| 99 { | 99 { |
| 100 // FIXME: This loop shouldn't be needed since the distributed nodes should | 100 // FIXME: This loop shouldn't be needed since the distributed nodes should |
| 101 // never be detached, we can probably remove it. | 101 // never be detached, we can probably remove it. |
| 102 for (size_t i = 0; i < m_distribution.size(); ++i) { | 102 for (size_t i = 0; i < m_distribution.size(); ++i) { |
| 103 if (!m_distribution.at(i)->attached()) | 103 if (!m_distribution.at(i)->confusingAndOftenMisusedAttached()) |
| 104 m_distribution.at(i)->attach(context); | 104 m_distribution.at(i)->attach(context); |
| 105 } | 105 } |
| 106 | 106 |
| 107 HTMLElement::attach(context); | 107 HTMLElement::attach(context); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void InsertionPoint::detach(const AttachContext& context) | 110 void InsertionPoint::detach(const AttachContext& context) |
| 111 { | 111 { |
| 112 for (size_t i = 0; i < m_distribution.size(); ++i) | 112 for (size_t i = 0; i < m_distribution.size(); ++i) |
| 113 m_distribution.at(i)->lazyReattachIfAttached(); | 113 m_distribution.at(i)->lazyReattachIfAttached(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 rootOwner->willAffectSelector(); | 215 rootOwner->willAffectSelector(); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 HTMLElement::removedFrom(insertionPoint); | 219 HTMLElement::removedFrom(insertionPoint); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void InsertionPoint::parseAttribute(const QualifiedName& name, const AtomicStrin
g& value) | 222 void InsertionPoint::parseAttribute(const QualifiedName& name, const AtomicStrin
g& value) |
| 223 { | 223 { |
| 224 if (name == reset_style_inheritanceAttr) { | 224 if (name == reset_style_inheritanceAttr) { |
| 225 if (!inDocument() || !attached() || !isActive()) | 225 if (!inDocument() || !confusingAndOftenMisusedAttached() || !isActive()) |
| 226 return; | 226 return; |
| 227 containingShadowRoot()->host()->setNeedsStyleRecalc(); | 227 containingShadowRoot()->host()->setNeedsStyleRecalc(); |
| 228 } else | 228 } else |
| 229 HTMLElement::parseAttribute(name, value); | 229 HTMLElement::parseAttribute(name, value); |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool InsertionPoint::resetStyleInheritance() const | 232 bool InsertionPoint::resetStyleInheritance() const |
| 233 { | 233 { |
| 234 return fastHasAttribute(reset_style_inheritanceAttr); | 234 return fastHasAttribute(reset_style_inheritanceAttr); |
| 235 } | 235 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 current = insertedTo; | 283 current = insertedTo; |
| 284 results.append(insertedTo); | 284 results.append(insertedTo); |
| 285 continue; | 285 continue; |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 return; | 288 return; |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace WebCore | 292 } // namespace WebCore |
| OLD | NEW |