Chromium Code Reviews| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 // ShadowRoot doesn't support custom callbacks. | 140 // ShadowRoot doesn't support custom callbacks. |
| 141 DCHECK(!hasCustomStyleCallbacks()); | 141 DCHECK(!hasCustomStyleCallbacks()); |
| 142 | 142 |
| 143 StyleSharingDepthScope sharingScope(*this); | 143 StyleSharingDepthScope sharingScope(*this); |
| 144 | 144 |
| 145 if (getStyleChangeType() >= SubtreeStyleChange) | 145 if (getStyleChangeType() >= SubtreeStyleChange) |
| 146 change = Force; | 146 change = Force; |
| 147 | 147 |
| 148 // There's no style to update so just calling recalcStyle means we're updated. | 148 // There's no style to update so just calling recalcStyle means we're updated. |
| 149 clearNeedsStyleRecalc(); | 149 clearNeedsStyleRecalc(); |
| 150 clearNeedsReattachLayoutTree(); | |
| 151 | 150 |
| 152 recalcDescendantStyles(change); | 151 recalcDescendantStyles(change); |
| 153 clearChildNeedsStyleRecalc(); | 152 clearChildNeedsStyleRecalc(); |
| 153 | |
| 154 if (host().childNeedsReattachLayoutTree()) | |
| 155 host().markAncestorsWithChildNeedsReattachLayoutTree(); | |
|
esprehn
2017/02/13 22:19:41
remove all this.
nainar
2017/02/14 03:42:09
Done.
| |
| 156 else | |
| 157 clearNeedsReattachLayoutTree(); | |
| 158 } | |
| 159 | |
| 160 void ShadowRoot::rebuildLayoutTree() { | |
| 161 // ShadowRoot doesn't support custom callbacks. | |
| 162 DCHECK(!hasCustomStyleCallbacks()); | |
| 163 | |
| 164 StyleSharingDepthScope sharingScope(*this); | |
| 165 | |
| 166 clearNeedsReattachLayoutTree(); | |
| 167 rebuildChildrenLayoutTrees(); | |
| 154 clearChildNeedsReattachLayoutTree(); | 168 clearChildNeedsReattachLayoutTree(); |
| 155 } | 169 } |
| 156 | 170 |
| 157 void ShadowRoot::attachLayoutTree(const AttachContext& context) { | 171 void ShadowRoot::attachLayoutTree(const AttachContext& context) { |
| 158 StyleSharingDepthScope sharingScope(*this); | 172 StyleSharingDepthScope sharingScope(*this); |
| 159 DocumentFragment::attachLayoutTree(context); | 173 DocumentFragment::attachLayoutTree(context); |
| 160 } | 174 } |
| 161 | 175 |
| 162 void ShadowRoot::detachLayoutTree(const AttachContext& context) { | 176 void ShadowRoot::detachLayoutTree(const AttachContext& context) { |
| 163 if (context.clearInvalidation) | 177 if (context.clearInvalidation) |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 ostream << "ShadowRootType::Open"; | 348 ostream << "ShadowRootType::Open"; |
| 335 break; | 349 break; |
| 336 case ShadowRootType::Closed: | 350 case ShadowRootType::Closed: |
| 337 ostream << "ShadowRootType::Closed"; | 351 ostream << "ShadowRootType::Closed"; |
| 338 break; | 352 break; |
| 339 } | 353 } |
| 340 return ostream; | 354 return ostream; |
| 341 } | 355 } |
| 342 | 356 |
| 343 } // namespace blink | 357 } // namespace blink |
| OLD | NEW |