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

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

Issue 2258793003: Use LocalStyleChange for insertion point inheritance propagation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 | « third_party/WebKit/LayoutTests/fast/css/invalidation/inherit-through-insertion-point-v0.html ('k') | 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void InsertionPoint::detachLayoutTree(const AttachContext& context) 115 void InsertionPoint::detachLayoutTree(const AttachContext& context)
116 { 116 {
117 for (size_t i = 0; i < m_distributedNodes.size(); ++i) 117 for (size_t i = 0; i < m_distributedNodes.size(); ++i)
118 m_distributedNodes.at(i)->lazyReattachIfAttached(); 118 m_distributedNodes.at(i)->lazyReattachIfAttached();
119 119
120 HTMLElement::detachLayoutTree(context); 120 HTMLElement::detachLayoutTree(context);
121 } 121 }
122 122
123 void InsertionPoint::willRecalcStyle(StyleRecalcChange change) 123 void InsertionPoint::willRecalcStyle(StyleRecalcChange change)
124 { 124 {
125 if (change < IndependentInherit && getStyleChangeType() < SubtreeStyleChange ) 125 StyleChangeType styleChangeType = NoStyleChange;
126
127 if (change > Inherit || getStyleChangeType() > LocalStyleChange)
128 styleChangeType = SubtreeStyleChange;
129 else if (change > NoInherit)
130 styleChangeType = LocalStyleChange;
131 else
126 return; 132 return;
133
127 for (size_t i = 0; i < m_distributedNodes.size(); ++i) 134 for (size_t i = 0; i < m_distributedNodes.size(); ++i)
128 m_distributedNodes.at(i)->setNeedsStyleRecalc(SubtreeStyleChange, StyleC hangeReasonForTracing::create(StyleChangeReason::PropagateInheritChangeToDistrib utedNodes)); 135 m_distributedNodes.at(i)->setNeedsStyleRecalc(styleChangeType, StyleChan geReasonForTracing::create(StyleChangeReason::PropagateInheritChangeToDistribute dNodes));
129 } 136 }
130 137
131 bool InsertionPoint::canBeActive() const 138 bool InsertionPoint::canBeActive() const
132 { 139 {
133 ShadowRoot* shadowRoot = containingShadowRoot(); 140 ShadowRoot* shadowRoot = containingShadowRoot();
134 if (!shadowRoot) 141 if (!shadowRoot)
135 return false; 142 return false;
136 if (shadowRoot->isV1()) 143 if (shadowRoot->isV1())
137 return false; 144 return false;
138 return !Traversal<InsertionPoint>::firstAncestor(*this); 145 return !Traversal<InsertionPoint>::firstAncestor(*this);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 if (!insertionPoints) 292 if (!insertionPoints)
286 return; 293 return;
287 for (size_t i = 0; i < insertionPoints->size(); ++i) 294 for (size_t i = 0; i < insertionPoints->size(); ++i)
288 results.append(insertionPoints->at(i).get()); 295 results.append(insertionPoints->at(i).get());
289 DCHECK_NE(current, insertionPoints->last().get()); 296 DCHECK_NE(current, insertionPoints->last().get());
290 current = insertionPoints->last().get(); 297 current = insertionPoints->last().get();
291 } 298 }
292 } 299 }
293 300
294 } // namespace blink 301 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/invalidation/inherit-through-insertion-point-v0.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698