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

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

Issue 63713002: Initiate webfont download right after style recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix zoom-zoom-coords.xhtml Created 7 years, 1 month 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
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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 // Now do rest of the properties. 791 // Now do rest of the properties.
792 if (keyframe->properties()) 792 if (keyframe->properties())
793 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, r esult.matchedProperties.size() - 1, inheritedOnly); 793 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, r esult.matchedProperties.size() - 1, inheritedOnly);
794 794
795 // If our font got dirtied by one of the non-essential font props, 795 // If our font got dirtied by one of the non-essential font props,
796 // go ahead and update it a second time. 796 // go ahead and update it a second time.
797 updateFont(state); 797 updateFont(state);
798 798
799 // Start loading resources referenced by this style. 799 // Start loading resources referenced by this style.
800 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 800 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
801 m_fontSelector->loadPendingFonts();
801 802
802 didAccess(); 803 didAccess();
803 804
804 return state.takeStyle(); 805 return state.takeStyle();
805 } 806 }
806 807
807 void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& el ementStyle, KeyframeList& list) 808 void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& el ementStyle, KeyframeList& list)
808 { 809 {
809 ASSERT(!RuntimeEnabledFeatures::webAnimationsCSSEnabled()); 810 ASSERT(!RuntimeEnabledFeatures::webAnimationsCSSEnabled());
810 list.clear(); 811 list.clear();
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 // Line-height is set when we are sure we decided on the font-size. 952 // Line-height is set when we are sure we decided on the font-size.
952 if (state.lineHeightValue()) 953 if (state.lineHeightValue())
953 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.lineHeig htValue()); 954 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.lineHeig htValue());
954 955
955 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, resul t.matchedProperties.size() - 1, inheritedOnly); 956 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, resul t.matchedProperties.size() - 1, inheritedOnly);
956 957
957 addContentAttrValuesToFeatures(state.contentAttrValues(), m_features); 958 addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
958 959
959 // Start loading resources referenced by this style. 960 // Start loading resources referenced by this style.
960 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 961 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
962 m_fontSelector->loadPendingFonts();
961 963
962 didAccess(); 964 didAccess();
963 965
964 // Now return the style. 966 // Now return the style.
965 return state.takeStyle(); 967 return state.takeStyle();
966 } 968 }
967 969
968 void StyleResolver::collectViewportRules() 970 void StyleResolver::collectViewportRules()
969 { 971 {
970 viewportStyleResolver()->collectViewportRules(CSSDefaultStyleSheets::default Style, ViewportStyleResolver::UserAgentOrigin); 972 viewportStyleResolver()->collectViewportRules(CSSDefaultStyleSheets::default Style, ViewportStyleResolver::UserAgentOrigin);
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 state.cacheUserAgentBorderAndBackground(); 1342 state.cacheUserAgentBorderAndBackground();
1341 1343
1342 // Now do the author and user normal priority properties and all the !import ant properties. 1344 // Now do the author and user normal priority properties and all the !import ant properties.
1343 applyMatchedProperties<LowPriorityProperties>(state, matchResult, false, mat chResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyI nheritedOnly); 1345 applyMatchedProperties<LowPriorityProperties>(state, matchResult, false, mat chResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyI nheritedOnly);
1344 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInherite dOnly); 1346 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInherite dOnly);
1345 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnl y); 1347 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnl y);
1346 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); 1348 applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matc hResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
1347 1349
1348 // Start loading resources referenced by this style. 1350 // Start loading resources referenced by this style.
1349 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 1351 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
1352 m_fontSelector->loadPendingFonts();
1350 1353
1351 if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCache able(element, state.style(), state.parentStyle())) { 1354 if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCache able(element, state.style(), state.parentStyle())) {
1352 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheAdded); 1355 INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheAdded);
1353 m_matchedPropertiesCache.add(state.style(), state.parentStyle(), cacheHa sh, matchResult); 1356 m_matchedPropertiesCache.add(state.style(), state.parentStyle(), cacheHa sh, matchResult);
1354 } 1357 }
1355 1358
1356 applyAnimatedProperties(state, animatingElement); 1359 applyAnimatedProperties(state, animatingElement);
1357 1360
1358 ASSERT(!state.fontBuilder().fontDirty()); 1361 ASSERT(!state.fontBuilder().fontDirty());
1359 } 1362 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 bool StyleResolver::affectedByViewportChange() const 1428 bool StyleResolver::affectedByViewportChange() const
1426 { 1429 {
1427 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 1430 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
1428 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) 1431 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result)
1429 return true; 1432 return true;
1430 } 1433 }
1431 return false; 1434 return false;
1432 } 1435 }
1433 1436
1434 } // namespace WebCore 1437 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698