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

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

Issue 834693007: Remove the remaining parts of ignorePendingStylesheets and placeholder styles. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove comment. Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolver.h ('k') | sky/engine/core/dom/Document.h » ('j') | 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // If any changes to CSS Animations were detected, stash the update away for application after the 81 // If any changes to CSS Animations were detected, stash the update away for application after the
82 // render object is updated if we're in the appropriate scope. 82 // render object is updated if we're in the appropriate scope.
83 if (state.animationUpdate()) 83 if (state.animationUpdate())
84 element.ensureActiveAnimations().cssAnimations().setPendingUpdate(state. takeAnimationUpdate()); 84 element.ensureActiveAnimations().cssAnimations().setPendingUpdate(state. takeAnimationUpdate());
85 } 85 }
86 86
87 } // namespace 87 } // namespace
88 88
89 namespace blink { 89 namespace blink {
90 90
91 RenderStyle* StyleResolver::s_styleNotYetAvailable;
92
93 static void addFontFaceRule(Document* document, CSSFontSelector* cssFontSelector , const StyleRuleFontFace* fontFaceRule) 91 static void addFontFaceRule(Document* document, CSSFontSelector* cssFontSelector , const StyleRuleFontFace* fontFaceRule)
94 { 92 {
95 RefPtr<FontFace> fontFace = FontFace::create(document, fontFaceRule); 93 RefPtr<FontFace> fontFace = FontFace::create(document, fontFaceRule);
96 if (fontFace) 94 if (fontFace)
97 cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule, fon tFace); 95 cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule, fon tFace);
98 } 96 }
99 97
100 static RuleSet& defaultStyles() 98 static RuleSet& defaultStyles()
101 { 99 {
102 DEFINE_STATIC_LOCAL(RefPtr<StyleSheetContents>, styleSheet, ()); 100 DEFINE_STATIC_LOCAL(RefPtr<StyleSheetContents>, styleSheet, ());
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 388 }
391 389
392 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior, 390 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior,
393 RuleMatchingBehavior matchingBehavior) 391 RuleMatchingBehavior matchingBehavior)
394 { 392 {
395 ASSERT(document().frame()); 393 ASSERT(document().frame());
396 ASSERT(document().settings()); 394 ASSERT(document().settings());
397 ASSERT(!hasPendingAuthorStyleSheets()); 395 ASSERT(!hasPendingAuthorStyleSheets());
398 ASSERT(!m_needCollectFeatures); 396 ASSERT(!m_needCollectFeatures);
399 397
400 // Once an element has a renderer, we don't try to destroy it, since otherwi se the renderer
401 // will vanish if a style recalc happens during loading.
402 if (sharingBehavior == AllowStyleSharing && !document().isRenderingReady() & & !element->renderer()) {
403 if (!s_styleNotYetAvailable) {
404 s_styleNotYetAvailable = RenderStyle::create().leakRef();
405 s_styleNotYetAvailable->setDisplay(NONE);
406 s_styleNotYetAvailable->font().update(document().styleEngine()->font Selector());
407 }
408
409 document().setHasNodesWithPlaceholderStyle();
410 return s_styleNotYetAvailable;
411 }
412
413 didAccess(); 398 didAccess();
414 399
415 if (element == document().documentElement()) 400 if (element == document().documentElement())
416 document().setDirectionSetOnDocumentElement(false); 401 document().setDirectionSetOnDocumentElement(false);
417 StyleResolverState state(document(), element, defaultParent); 402 StyleResolverState state(document(), element, defaultParent);
418 403
419 if (sharingBehavior == AllowStyleSharing && state.parentStyle()) { 404 if (sharingBehavior == AllowStyleSharing && state.parentStyle()) {
420 SharedStyleFinder styleFinder(state.elementContext(), m_features, *this) ; 405 SharedStyleFinder styleFinder(state.elementContext(), m_features, *this) ;
421 if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle()) 406 if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle())
422 return sharedStyle.release(); 407 return sharedStyle.release();
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 bool StyleResolver::mediaQueryAffectedByViewportChange() const 896 bool StyleResolver::mediaQueryAffectedByViewportChange() const
912 { 897 {
913 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 898 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
914 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression() ) != m_viewportDependentMediaQueryResults[i]->result()) 899 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression() ) != m_viewportDependentMediaQueryResults[i]->result())
915 return true; 900 return true;
916 } 901 }
917 return false; 902 return false;
918 } 903 }
919 904
920 } // namespace blink 905 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolver.h ('k') | sky/engine/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698