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

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

Issue 342373004: Remove StyleResolver::documentSettings() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « Source/core/css/resolver/StyleResolver.h ('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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 void StyleResolver::loadPendingResources(StyleResolverState& state) 589 void StyleResolver::loadPendingResources(StyleResolverState& state)
590 { 590 {
591 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 591 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
592 document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts(); 592 document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts();
593 } 593 }
594 594
595 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior, 595 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior,
596 RuleMatchingBehavior matchingBehavior) 596 RuleMatchingBehavior matchingBehavior)
597 { 597 {
598 ASSERT(document().frame()); 598 ASSERT(document().frame());
599 ASSERT(documentSettings()); 599 ASSERT(document().settings());
600 ASSERT(!hasPendingAuthorStyleSheets()); 600 ASSERT(!hasPendingAuthorStyleSheets());
601 ASSERT(!m_needCollectFeatures); 601 ASSERT(!m_needCollectFeatures);
602 602
603 // Once an element has a renderer, we don't try to destroy it, since otherwi se the renderer 603 // Once an element has a renderer, we don't try to destroy it, since otherwi se the renderer
604 // will vanish if a style recalc happens during loading. 604 // will vanish if a style recalc happens during loading.
605 if (sharingBehavior == AllowStyleSharing && !document().isRenderingReady() & & !element->renderer()) { 605 if (sharingBehavior == AllowStyleSharing && !document().isRenderingReady() & & !element->renderer()) {
606 if (!s_styleNotYetAvailable) { 606 if (!s_styleNotYetAvailable) {
607 s_styleNotYetAvailable = RenderStyle::create().leakRef(); 607 s_styleNotYetAvailable = RenderStyle::create().leakRef();
608 s_styleNotYetAvailable->setDisplay(NONE); 608 s_styleNotYetAvailable->setDisplay(NONE);
609 s_styleNotYetAvailable->font().update(document().styleEngine()->font Selector()); 609 s_styleNotYetAvailable->font().update(document().styleEngine()->font Selector());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 if (state.style()->hasViewportUnits()) 688 if (state.style()->hasViewportUnits())
689 document().setHasViewportUnits(); 689 document().setHasViewportUnits();
690 690
691 // Now return the style. 691 // Now return the style.
692 return state.takeStyle(); 692 return state.takeStyle();
693 } 693 }
694 694
695 PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const RenderStyle& elementStyle, RenderStyle* parentStyle, const StyleKeyframe* keyfra me, const AtomicString& animationName) 695 PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const RenderStyle& elementStyle, RenderStyle* parentStyle, const StyleKeyframe* keyfra me, const AtomicString& animationName)
696 { 696 {
697 ASSERT(document().frame()); 697 ASSERT(document().frame());
698 ASSERT(documentSettings()); 698 ASSERT(document().settings());
699 ASSERT(!hasPendingAuthorStyleSheets()); 699 ASSERT(!hasPendingAuthorStyleSheets());
700 700
701 if (element == document().documentElement()) 701 if (element == document().documentElement())
702 resetDirectionAndWritingModeOnDocument(document()); 702 resetDirectionAndWritingModeOnDocument(document());
703 StyleResolverState state(document(), element, parentStyle); 703 StyleResolverState state(document(), element, parentStyle);
704 704
705 MatchResult result; 705 MatchResult result;
706 result.addMatchedProperties(&keyframe->properties()); 706 result.addMatchedProperties(&keyframe->properties());
707 707
708 ASSERT(!state.style()); 708 ASSERT(!state.style());
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 799
800 setAnimationUpdateIfNeeded(state, *pseudo); 800 setAnimationUpdateIfNeeded(state, *pseudo);
801 if (ActiveAnimations* activeAnimations = pseudo->activeAnimations()) 801 if (ActiveAnimations* activeAnimations = pseudo->activeAnimations())
802 activeAnimations->cssAnimations().maybeApplyPendingUpdate(pseudo.get()); 802 activeAnimations->cssAnimations().maybeApplyPendingUpdate(pseudo.get());
803 return pseudo.release(); 803 return pseudo.release();
804 } 804 }
805 805
806 bool StyleResolver::pseudoStyleForElementInternal(Element& element, const Pseudo StyleRequest& pseudoStyleRequest, RenderStyle* parentStyle, StyleResolverState& state) 806 bool StyleResolver::pseudoStyleForElementInternal(Element& element, const Pseudo StyleRequest& pseudoStyleRequest, RenderStyle* parentStyle, StyleResolverState& state)
807 { 807 {
808 ASSERT(document().frame()); 808 ASSERT(document().frame());
809 ASSERT(documentSettings()); 809 ASSERT(document().settings());
810 ASSERT(pseudoStyleRequest.pseudoId != FIRST_LINE_INHERITED); 810 ASSERT(pseudoStyleRequest.pseudoId != FIRST_LINE_INHERITED);
811 811
812 StyleResolverParentScope::ensureParentStackIsPushed(); 812 StyleResolverParentScope::ensureParentStackIsPushed();
813 813
814 if (pseudoStyleRequest.allowsInheritance(state.parentStyle())) { 814 if (pseudoStyleRequest.allowsInheritance(state.parentStyle())) {
815 state.setStyle(RenderStyle::create()); 815 state.setStyle(RenderStyle::create());
816 state.style()->inheritFrom(state.parentStyle()); 816 state.style()->inheritFrom(state.parentStyle());
817 } else { 817 } else {
818 state.setStyle(defaultStyleForElement()); 818 state.setStyle(defaultStyleForElement());
819 state.setParentStyle(RenderStyle::clone(state.style())); 819 state.setParentStyle(RenderStyle::clone(state.style()));
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 visitor->trace(m_viewportStyleResolver); 1595 visitor->trace(m_viewportStyleResolver);
1596 visitor->trace(m_features); 1596 visitor->trace(m_features);
1597 visitor->trace(m_siblingRuleSet); 1597 visitor->trace(m_siblingRuleSet);
1598 visitor->trace(m_uncommonAttributeRuleSet); 1598 visitor->trace(m_uncommonAttributeRuleSet);
1599 visitor->trace(m_watchedSelectorsRules); 1599 visitor->trace(m_watchedSelectorsRules);
1600 visitor->trace(m_treeBoundaryCrossingRules); 1600 visitor->trace(m_treeBoundaryCrossingRules);
1601 visitor->trace(m_pendingStyleSheets); 1601 visitor->trace(m_pendingStyleSheets);
1602 } 1602 }
1603 1603
1604 } // namespace WebCore 1604 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698