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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 m_elementShadowV0 = ElementShadowV0::create(*this); | 75 m_elementShadowV0 = ElementShadowV0::create(*this); |
76 } | 76 } |
77 | 77 |
78 ShadowRoot* shadowRoot = ShadowRoot::create(shadowHost.document(), type); | 78 ShadowRoot* shadowRoot = ShadowRoot::create(shadowHost.document(), type); |
79 shadowRoot->setParentOrShadowHostNode(&shadowHost); | 79 shadowRoot->setParentOrShadowHostNode(&shadowHost); |
80 shadowRoot->setParentTreeScope(shadowHost.treeScope()); | 80 shadowRoot->setParentTreeScope(shadowHost.treeScope()); |
81 appendShadowRoot(*shadowRoot); | 81 appendShadowRoot(*shadowRoot); |
82 setNeedsDistributionRecalc(); | 82 setNeedsDistributionRecalc(); |
83 | 83 |
84 shadowRoot->insertedInto(&shadowHost); | 84 shadowRoot->insertedInto(&shadowHost); |
85 shadowHost.setChildNeedsStyleRecalc(); | |
86 shadowHost.setNeedsStyleRecalc( | 85 shadowHost.setNeedsStyleRecalc( |
87 SubtreeStyleChange, | 86 SubtreeStyleChange, |
88 StyleChangeReasonForTracing::create(StyleChangeReason::Shadow)); | 87 StyleChangeReasonForTracing::create(StyleChangeReason::Shadow)); |
| 88 shadowRoot->setNeedsReattachLayoutTree(); |
89 | 89 |
90 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot); | 90 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot); |
91 | 91 |
92 return *shadowRoot; | 92 return *shadowRoot; |
93 } | 93 } |
94 | 94 |
95 void ElementShadow::appendShadowRoot(ShadowRoot& shadowRoot) { | 95 void ElementShadow::appendShadowRoot(ShadowRoot& shadowRoot) { |
96 if (!m_shadowRoot) { | 96 if (!m_shadowRoot) { |
97 m_shadowRoot = &shadowRoot; | 97 m_shadowRoot = &shadowRoot; |
98 return; | 98 return; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 visitor->trace(m_elementShadowV0); | 163 visitor->trace(m_elementShadowV0); |
164 visitor->trace(m_shadowRoot); | 164 visitor->trace(m_shadowRoot); |
165 } | 165 } |
166 | 166 |
167 DEFINE_TRACE_WRAPPERS(ElementShadow) { | 167 DEFINE_TRACE_WRAPPERS(ElementShadow) { |
168 visitor->traceWrappers(m_elementShadowV0); | 168 visitor->traceWrappers(m_elementShadowV0); |
169 visitor->traceWrappers(m_shadowRoot); | 169 visitor->traceWrappers(m_shadowRoot); |
170 } | 170 } |
171 | 171 |
172 } // namespace blink | 172 } // namespace blink |
OLD | NEW |