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

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

Issue 2220873002: Add a fast-path for independent inherited properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added 2 more tests 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
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 < Inherit && getStyleChangeType() < SubtreeStyleChange) 125 if (change < IndependentInherit && getStyleChangeType() < SubtreeStyleChange )
126 return; 126 return;
127 for (size_t i = 0; i < m_distributedNodes.size(); ++i) 127 for (size_t i = 0; i < m_distributedNodes.size(); ++i)
128 m_distributedNodes.at(i)->setNeedsStyleRecalc(SubtreeStyleChange, StyleC hangeReasonForTracing::create(StyleChangeReason::PropagateInheritChangeToDistrib utedNodes)); 128 m_distributedNodes.at(i)->setNeedsStyleRecalc(SubtreeStyleChange, StyleC hangeReasonForTracing::create(StyleChangeReason::PropagateInheritChangeToDistrib utedNodes));
129 } 129 }
130 130
131 bool InsertionPoint::canBeActive() const 131 bool InsertionPoint::canBeActive() const
132 { 132 {
133 ShadowRoot* shadowRoot = containingShadowRoot(); 133 ShadowRoot* shadowRoot = containingShadowRoot();
134 if (!shadowRoot) 134 if (!shadowRoot)
135 return false; 135 return false;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 if (!insertionPoints) 285 if (!insertionPoints)
286 return; 286 return;
287 for (size_t i = 0; i < insertionPoints->size(); ++i) 287 for (size_t i = 0; i < insertionPoints->size(); ++i)
288 results.append(insertionPoints->at(i).get()); 288 results.append(insertionPoints->at(i).get());
289 DCHECK_NE(current, insertionPoints->last().get()); 289 DCHECK_NE(current, insertionPoints->last().get());
290 current = insertionPoints->last().get(); 290 current = insertionPoints->last().get();
291 } 291 }
292 } 292 }
293 293
294 } // namespace blink 294 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/html/HTMLSlotElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698