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

Side by Side Diff: sky/engine/core/css/resolver/StyleResolver.cpp

Issue 796713002: Turn StyleSharing to 11. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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) 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 { 254 {
255 return m_features.hasSelectorForId(id); 255 return m_features.hasSelectorForId(id);
256 } 256 }
257 257
258 void StyleResolver::addToStyleSharingList(Element& element) 258 void StyleResolver::addToStyleSharingList(Element& element)
259 { 259 {
260 // Never add elements to the style sharing list if we're not in a recalcStyl e, 260 // Never add elements to the style sharing list if we're not in a recalcStyl e,
261 // otherwise we could leave stale pointers in there. 261 // otherwise we could leave stale pointers in there.
262 if (!document().inStyleRecalc()) 262 if (!document().inStyleRecalc())
263 return; 263 return;
264 ASSERT(element.supportsStyleSharing());
264 INCREMENT_STYLE_STATS_COUNTER(*this, sharedStyleCandidates); 265 INCREMENT_STYLE_STATS_COUNTER(*this, sharedStyleCandidates);
265 StyleSharingList& list = styleSharingList(); 266 StyleSharingList& list = styleSharingList();
266 if (list.size() >= styleSharingListSize) 267 if (list.size() >= styleSharingListSize)
267 list.removeLast(); 268 list.removeLast();
268 list.prepend(&element); 269 list.prepend(&element);
269 } 270 }
270 271
271 StyleSharingList& StyleResolver::styleSharingList() 272 StyleSharingList& StyleResolver::styleSharingList()
272 { 273 {
273 m_styleSharingLists.resize(styleSharingMaxDepth); 274 m_styleSharingLists.resize(styleSharingMaxDepth);
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 bool StyleResolver::mediaQueryAffectedByViewportChange() const 938 bool StyleResolver::mediaQueryAffectedByViewportChange() const
938 { 939 {
939 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 940 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
940 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression() ) != m_viewportDependentMediaQueryResults[i]->result()) 941 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression() ) != m_viewportDependentMediaQueryResults[i]->result())
941 return true; 942 return true;
942 } 943 }
943 return false; 944 return false;
944 } 945 }
945 946
946 } // namespace blink 947 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698