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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document* document) | 44 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document* document) |
45 : HTMLElement(tagName, document, CreateInsertionPoint) | 45 : HTMLElement(tagName, document, CreateInsertionPoint) |
46 , m_registeredWithShadowRoot(false) | 46 , m_registeredWithShadowRoot(false) |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 InsertionPoint::~InsertionPoint() | 50 InsertionPoint::~InsertionPoint() |
51 { | 51 { |
52 } | 52 } |
53 | 53 |
54 void InsertionPoint::attach() | 54 void InsertionPoint::attach(const AttachContext& context) |
55 { | 55 { |
56 if (ShadowRoot* shadowRoot = containingShadowRoot()) | 56 if (ShadowRoot* shadowRoot = containingShadowRoot()) |
57 ContentDistributor::ensureDistribution(shadowRoot); | 57 ContentDistributor::ensureDistribution(shadowRoot); |
58 for (size_t i = 0; i < m_distribution.size(); ++i) { | 58 for (size_t i = 0; i < m_distribution.size(); ++i) { |
59 if (!m_distribution.at(i)->attached()) | 59 if (!m_distribution.at(i)->attached()) |
60 m_distribution.at(i)->attach(); | 60 m_distribution.at(i)->attach(context); |
61 } | 61 } |
62 | 62 |
63 HTMLElement::attach(); | 63 HTMLElement::attach(context); |
64 } | 64 } |
65 | 65 |
66 void InsertionPoint::detach() | 66 void InsertionPoint::detach(const AttachContext& context) |
67 { | 67 { |
68 if (ShadowRoot* shadowRoot = containingShadowRoot()) | 68 if (ShadowRoot* shadowRoot = containingShadowRoot()) |
69 ContentDistributor::ensureDistribution(shadowRoot); | 69 ContentDistributor::ensureDistribution(shadowRoot); |
70 | 70 |
71 for (size_t i = 0; i < m_distribution.size(); ++i) | 71 for (size_t i = 0; i < m_distribution.size(); ++i) |
72 m_distribution.at(i)->detach(); | 72 m_distribution.at(i)->detach(context); |
73 | 73 |
74 HTMLElement::detach(); | 74 HTMLElement::detach(context); |
75 } | 75 } |
76 | 76 |
77 bool InsertionPoint::shouldUseFallbackElements() const | 77 bool InsertionPoint::shouldUseFallbackElements() const |
78 { | 78 { |
79 return isActive() && !hasDistribution(); | 79 return isActive() && !hasDistribution(); |
80 } | 80 } |
81 | 81 |
82 bool InsertionPoint::isShadowBoundary() const | 82 bool InsertionPoint::isShadowBoundary() const |
83 { | 83 { |
84 return treeScope()->rootNode()->isShadowRoot() && isActive(); | 84 return treeScope()->rootNode()->isShadowRoot() && isActive(); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 current = insertedTo; | 247 current = insertedTo; |
248 results.append(insertedTo); | 248 results.append(insertedTo); |
249 continue; | 249 continue; |
250 } | 250 } |
251 } | 251 } |
252 return; | 252 return; |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 } // namespace WebCore | 256 } // namespace WebCore |
OLD | NEW |