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

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: 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 // Now do rest of the properties. 723 // Now do rest of the properties.
724 if (keyframe->properties()) 724 if (keyframe->properties())
725 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, r esult.matchedProperties.size() - 1, inheritedOnly); 725 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, r esult.matchedProperties.size() - 1, inheritedOnly);
726 726
727 // If our font got dirtied by one of the non-essential font props, 727 // If our font got dirtied by one of the non-essential font props,
728 // go ahead and update it a second time. 728 // go ahead and update it a second time.
729 updateFont(state); 729 updateFont(state);
730 730
731 // Start loading resources referenced by this style. 731 // Start loading resources referenced by this style.
732 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 732 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
733 m_fontSelector->loadPendingFonts();
733 734
734 document().didAccessStyleResolver(); 735 document().didAccessStyleResolver();
735 736
736 return state.takeStyle(); 737 return state.takeStyle();
737 } 738 }
738 739
739 void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& el ementStyle, KeyframeList& list) 740 void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& el ementStyle, KeyframeList& list)
740 { 741 {
741 ASSERT(!RuntimeEnabledFeatures::webAnimationsCSSEnabled()); 742 ASSERT(!RuntimeEnabledFeatures::webAnimationsCSSEnabled());
742 list.clear(); 743 list.clear();
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 // Line-height is set when we are sure we decided on the font-size. 884 // Line-height is set when we are sure we decided on the font-size.
884 if (state.lineHeightValue()) 885 if (state.lineHeightValue())
885 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.lineHeig htValue()); 886 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.lineHeig htValue());
886 887
887 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, resul t.matchedProperties.size() - 1, inheritedOnly); 888 applyMatchedProperties<LowPriorityProperties>(state, result, false, 0, resul t.matchedProperties.size() - 1, inheritedOnly);
888 889
889 addContentAttrValuesToFeatures(state.contentAttrValues(), m_features); 890 addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
890 891
891 // Start loading resources referenced by this style. 892 // Start loading resources referenced by this style.
892 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 893 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
894 m_fontSelector->loadPendingFonts();
893 895
894 document().didAccessStyleResolver(); 896 document().didAccessStyleResolver();
895 897
896 // Now return the style. 898 // Now return the style.
897 return state.takeStyle(); 899 return state.takeStyle();
898 } 900 }
899 901
900 void StyleResolver::collectViewportRules() 902 void StyleResolver::collectViewportRules()
901 { 903 {
902 viewportStyleResolver()->collectViewportRules(CSSDefaultStyleSheets::default Style, ViewportStyleResolver::UserAgentOrigin); 904 viewportStyleResolver()->collectViewportRules(CSSDefaultStyleSheets::default Style, ViewportStyleResolver::UserAgentOrigin);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRu le, applyInheritedOnly); 1279 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRu le, applyInheritedOnly);
1278 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly); 1280 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
1279 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, appl yInheritedOnly); 1281 applyMatchedProperties<LowPriorityProperties>(state, matchResult , important, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, appl yInheritedOnly);
1280 } 1282 }
1281 applyAnimatedProperties<LowPriorityProperties>(state, compositableVa luesForTransitions); 1283 applyAnimatedProperties<LowPriorityProperties>(state, compositableVa luesForTransitions);
1282 } 1284 }
1283 } 1285 }
1284 1286
1285 // Start loading resources referenced by this style. 1287 // Start loading resources referenced by this style.
1286 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 1288 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
1289 m_fontSelector->loadPendingFonts();
1287 1290
1288 ASSERT(!state.fontBuilder().fontDirty()); 1291 ASSERT(!state.fontBuilder().fontDirty());
1289 1292
1290 #ifdef STYLE_STATS 1293 #ifdef STYLE_STATS
1291 if (!cachedMatchedProperties) 1294 if (!cachedMatchedProperties)
1292 STYLE_STATS_ADD_MATCHED_PROPERTIES_TO_CACHE(); 1295 STYLE_STATS_ADD_MATCHED_PROPERTIES_TO_CACHE();
1293 #endif 1296 #endif
1294 1297
1295 if (cachedMatchedProperties || !cacheHash) 1298 if (cachedMatchedProperties || !cacheHash)
1296 return; 1299 return;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che); 1371 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che);
1369 1372
1370 fprintf(stderr, "Total:\n"); 1373 fprintf(stderr, "Total:\n");
1371 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing, 1374 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing,
1372 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache); 1375 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache);
1373 fprintf(stderr, "----------------------------------------------------------- ---------------------\n"); 1376 fprintf(stderr, "----------------------------------------------------------- ---------------------\n");
1374 } 1377 }
1375 #endif 1378 #endif
1376 1379
1377 } // namespace WebCore 1380 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698