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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 144853004: Don't use cached inherited props for distributed nodes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Allow sharing inherited properties if -webkit-user-modify is read-only. Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/editing/shadow/contenteditable-propagation-to-distributed-node-expected.txt ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 bool applyInheritedOnly = false; 1350 bool applyInheritedOnly = false;
1351 const CachedMatchedProperties* cachedMatchedProperties = 0; 1351 const CachedMatchedProperties* cachedMatchedProperties = 0;
1352 1352
1353 if (cacheHash && (cachedMatchedProperties = m_matchedPropertiesCache.find(ca cheHash, state, matchResult)) 1353 if (cacheHash && (cachedMatchedProperties = m_matchedPropertiesCache.find(ca cheHash, state, matchResult))
1354 && MatchedPropertiesCache::isCacheable(element, state.style(), state.par entStyle())) { 1354 && MatchedPropertiesCache::isCacheable(element, state.style(), state.par entStyle())) {
1355 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheHit); 1355 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheHit);
1356 // We can build up the style by copying non-inherited properties from an earlier style object built using the same exact 1356 // We can build up the style by copying non-inherited properties from an earlier style object built using the same exact
1357 // style declarations. We then only need to apply the inherited properti es, if any, as their values can depend on the 1357 // style declarations. We then only need to apply the inherited properti es, if any, as their values can depend on the
1358 // element context. This is fast and saves memory by reusing the style d ata structures. 1358 // element context. This is fast and saves memory by reusing the style d ata structures.
1359 state.style()->copyNonInheritedFrom(cachedMatchedProperties->renderStyle .get()); 1359 state.style()->copyNonInheritedFrom(cachedMatchedProperties->renderStyle .get());
1360 if (state.parentStyle()->inheritedDataShared(cachedMatchedProperties->pa rentRenderStyle.get()) && !isAtShadowBoundary(element)) { 1360 if (state.parentStyle()->inheritedDataShared(cachedMatchedProperties->pa rentRenderStyle.get()) && !isAtShadowBoundary(element)
1361 && (!state.distributedToInsertionPoint() || state.style()->userModif y() == READ_ONLY)) {
1361 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheInheritedHi t); 1362 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheInheritedHi t);
1362 1363
1363 EInsideLink linkStatus = state.style()->insideLink(); 1364 EInsideLink linkStatus = state.style()->insideLink();
1364 // If the cache item parent style has identical inherited properties to the current parent style then the 1365 // If the cache item parent style has identical inherited properties to the current parent style then the
1365 // resulting style will be identical too. We copy the inherited prop erties over from the cache and are done. 1366 // resulting style will be identical too. We copy the inherited prop erties over from the cache and are done.
1366 state.style()->inheritFrom(cachedMatchedProperties->renderStyle.get( )); 1367 state.style()->inheritFrom(cachedMatchedProperties->renderStyle.get( ));
1367 1368
1368 // Unfortunately the link status is treated like an inherited proper ty. We need to explicitly restore it. 1369 // Unfortunately the link status is treated like an inherited proper ty. We need to explicitly restore it.
1369 state.style()->setInsideLink(linkStatus); 1370 state.style()->setInsideLink(linkStatus);
1370 return; 1371 return;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 bool StyleResolver::mediaQueryAffectedByViewportChange() const 1508 bool StyleResolver::mediaQueryAffectedByViewportChange() const
1508 { 1509 {
1509 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 1510 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
1510 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) 1511 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result)
1511 return true; 1512 return true;
1512 } 1513 }
1513 return false; 1514 return false;
1514 } 1515 }
1515 1516
1516 } // namespace WebCore 1517 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/shadow/contenteditable-propagation-to-distributed-node-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698