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

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

Issue 2945993002: Experimental: Change LazyReattachIfAttached to SetChildNeedsStyleRecalc
Patch Set: Use SetNeedsStyleRecalc Created 3 years, 6 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 element_shadow_v0_ = ElementShadowV0::Create(*this); 76 element_shadow_v0_ = ElementShadowV0::Create(*this);
77 } 77 }
78 78
79 ShadowRoot* shadow_root = ShadowRoot::Create(shadow_host.GetDocument(), type); 79 ShadowRoot* shadow_root = ShadowRoot::Create(shadow_host.GetDocument(), type);
80 shadow_root->SetParentOrShadowHostNode(&shadow_host); 80 shadow_root->SetParentOrShadowHostNode(&shadow_host);
81 shadow_root->SetParentTreeScope(shadow_host.GetTreeScope()); 81 shadow_root->SetParentTreeScope(shadow_host.GetTreeScope());
82 AppendShadowRoot(*shadow_root); 82 AppendShadowRoot(*shadow_root);
83 if (type == ShadowRootType::V0) { 83 if (type == ShadowRootType::V0) {
84 SetNeedsDistributionRecalc(); 84 SetNeedsDistributionRecalc();
85 } else { 85 } else {
86 for (Node& child : NodeTraversal::ChildrenOf(shadow_host)) 86 for (Node& child : NodeTraversal::ChildrenOf(shadow_host)) {
87 child.LazyReattachIfAttached(); 87 child.SetNeedsStyleRecalc(
88 kSubtreeStyleChange,
89 StyleChangeReasonForTracing::Create(StyleChangeReason::kShadow));
90 }
88 } 91 }
89 92
90 shadow_root->InsertedInto(&shadow_host); 93 shadow_root->InsertedInto(&shadow_host);
91 shadow_host.SetChildNeedsStyleRecalc(); 94 shadow_host.SetChildNeedsStyleRecalc();
92 shadow_host.SetNeedsStyleRecalc( 95 shadow_host.SetNeedsStyleRecalc(
93 kSubtreeStyleChange, 96 kSubtreeStyleChange,
94 StyleChangeReasonForTracing::Create(StyleChangeReason::kShadow)); 97 StyleChangeReasonForTracing::Create(StyleChangeReason::kShadow));
95 98
96 probe::didPushShadowRoot(&shadow_host, shadow_root); 99 probe::didPushShadowRoot(&shadow_host, shadow_root);
97 100
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 visitor->Trace(element_shadow_v0_); 173 visitor->Trace(element_shadow_v0_);
171 visitor->Trace(shadow_root_); 174 visitor->Trace(shadow_root_);
172 } 175 }
173 176
174 DEFINE_TRACE_WRAPPERS(ElementShadow) { 177 DEFINE_TRACE_WRAPPERS(ElementShadow) {
175 visitor->TraceWrappers(element_shadow_v0_); 178 visitor->TraceWrappers(element_shadow_v0_);
176 visitor->TraceWrappers(shadow_root_); 179 visitor->TraceWrappers(shadow_root_);
177 } 180 }
178 181
179 } // namespace blink 182 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698