OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // ShadowRoot doesn't support custom callbacks. | 122 // ShadowRoot doesn't support custom callbacks. |
123 DCHECK(!hasCustomStyleCallbacks()); | 123 DCHECK(!hasCustomStyleCallbacks()); |
124 | 124 |
125 StyleSharingDepthScope sharingScope(*this); | 125 StyleSharingDepthScope sharingScope(*this); |
126 | 126 |
127 if (getStyleChangeType() >= SubtreeStyleChange) | 127 if (getStyleChangeType() >= SubtreeStyleChange) |
128 change = Force; | 128 change = Force; |
129 | 129 |
130 // There's no style to update so just calling recalcStyle means we're updated. | 130 // There's no style to update so just calling recalcStyle means we're updated. |
131 clearNeedsStyleRecalc(); | 131 clearNeedsStyleRecalc(); |
132 clearNeedsReattachLayoutTree(); | |
133 | 132 |
134 recalcDescendantStyles(change); | 133 recalcDescendantStyles(change); |
135 clearChildNeedsStyleRecalc(); | 134 clearChildNeedsStyleRecalc(); |
| 135 setNeedsReattachLayoutTree(); |
| 136 } |
| 137 |
| 138 void ShadowRoot::rebuildLayoutTree() { |
| 139 DCHECK(!needsStyleRecalc()); |
| 140 // ShadowRoot doesn't support custom callbacks. |
| 141 DCHECK(!hasCustomStyleCallbacks()); |
| 142 |
| 143 clearNeedsReattachLayoutTree(); |
| 144 rebuildDescendantLayoutTrees(); |
136 clearChildNeedsReattachLayoutTree(); | 145 clearChildNeedsReattachLayoutTree(); |
137 } | 146 } |
138 | 147 |
139 void ShadowRoot::attachLayoutTree(const AttachContext& context) { | 148 void ShadowRoot::attachLayoutTree(const AttachContext& context) { |
140 StyleSharingDepthScope sharingScope(*this); | 149 StyleSharingDepthScope sharingScope(*this); |
141 DocumentFragment::attachLayoutTree(context); | 150 DocumentFragment::attachLayoutTree(context); |
142 } | 151 } |
143 | 152 |
144 void ShadowRoot::detachLayoutTree(const AttachContext& context) { | 153 void ShadowRoot::detachLayoutTree(const AttachContext& context) { |
145 if (context.clearInvalidation) | 154 if (context.clearInvalidation) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 ostream << "ShadowRootType::Open"; | 325 ostream << "ShadowRootType::Open"; |
317 break; | 326 break; |
318 case ShadowRootType::Closed: | 327 case ShadowRootType::Closed: |
319 ostream << "ShadowRootType::Closed"; | 328 ostream << "ShadowRootType::Closed"; |
320 break; | 329 break; |
321 } | 330 } |
322 return ostream; | 331 return ostream; |
323 } | 332 } |
324 | 333 |
325 } // namespace blink | 334 } // namespace blink |
OLD | NEW |