Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 if (getStyleChangeType() >= SubtreeStyleChange) 128 if (getStyleChangeType() >= SubtreeStyleChange)
129 change = Force; 129 change = Force;
130 130
131 // There's no style to update so just calling recalcStyle means we're updated. 131 // There's no style to update so just calling recalcStyle means we're updated.
132 clearNeedsStyleRecalc(); 132 clearNeedsStyleRecalc();
133 clearNeedsReattachLayoutTree(); 133 clearNeedsReattachLayoutTree();
134 134
135 recalcDescendantStyles(change); 135 recalcDescendantStyles(change);
136 clearChildNeedsStyleRecalc(); 136 clearChildNeedsStyleRecalc();
137 }
138
139 void ShadowRoot::rebuildLayoutTree() {
140 DCHECK(!needsStyleRecalc());
141 DCHECK(!childNeedsStyleRecalc());
142 DCHECK(!needsReattachLayoutTree());
143 // ShadowRoot doesn't support custom callbacks.
144 DCHECK(!hasCustomStyleCallbacks());
145 clearNeedsReattachLayoutTree();
146 rebuildDescendantLayoutTree();
137 clearChildNeedsReattachLayoutTree(); 147 clearChildNeedsReattachLayoutTree();
138 } 148 }
139 149
140 void ShadowRoot::attachLayoutTree(const AttachContext& context) { 150 void ShadowRoot::attachLayoutTree(const AttachContext& context) {
141 StyleSharingDepthScope sharingScope(*this); 151 StyleSharingDepthScope sharingScope(*this);
142 DocumentFragment::attachLayoutTree(context); 152 DocumentFragment::attachLayoutTree(context);
143 } 153 }
144 154
145 void ShadowRoot::detachLayoutTree(const AttachContext& context) { 155 void ShadowRoot::detachLayoutTree(const AttachContext& context) {
146 if (context.clearInvalidation) 156 if (context.clearInvalidation)
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 ostream << "ShadowRootType::Open"; 336 ostream << "ShadowRootType::Open";
327 break; 337 break;
328 case ShadowRootType::Closed: 338 case ShadowRootType::Closed:
329 ostream << "ShadowRootType::Closed"; 339 ostream << "ShadowRootType::Closed";
330 break; 340 break;
331 } 341 }
332 return ostream; 342 return ostream;
333 } 343 }
334 344
335 } // namespace blink 345 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698