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

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

Issue 1238943004: CSSValue Immediates: Replace CSSValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 years, 4 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 | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/TransformBuilder.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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 632
633 if (state.style()->hasViewportUnits()) 633 if (state.style()->hasViewportUnits())
634 document().setHasViewportUnits(); 634 document().setHasViewportUnits();
635 635
636 // Now return the style. 636 // Now return the style.
637 return state.takeStyle(); 637 return state.takeStyle();
638 } 638 }
639 639
640 // This function is used by the WebAnimations JavaScript API method animate(). 640 // This function is used by the WebAnimations JavaScript API method animate().
641 // FIXME: Remove this when animate() switches away from resolution-dependent par sing. 641 // FIXME: Remove this when animate() switches away from resolution-dependent par sing.
642 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(Element& element, const ComputedStyle* baseStyle, CSSPropertyID property, N ullableCSSValue value) 642 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(Element& element, const ComputedStyle* baseStyle, CSSPropertyID property, c onst NullableCSSValue& value)
643 { 643 {
644 StyleResolverState state(element.document(), &element); 644 StyleResolverState state(element.document(), &element);
645 state.setStyle(baseStyle ? ComputedStyle::clone(*baseStyle) : ComputedStyle: :create()); 645 state.setStyle(baseStyle ? ComputedStyle::clone(*baseStyle) : ComputedStyle: :create());
646 return createAnimatableValueSnapshot(state, property, value); 646 return createAnimatableValueSnapshot(state, property, value);
647 } 647 }
648 648
649 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(StyleResolverState& state, CSSPropertyID property, NullableCSSValue value) 649 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(StyleResolverState& state, CSSPropertyID property, const NullableCSSValue& value)
650 { 650 {
651 if (value) { 651 if (value) {
652 StyleBuilder::applyProperty(property, state, *value); 652 StyleBuilder::applyProperty(property, state, *value);
653 state.fontBuilder().createFont(state.document().styleEngine().fontSelect or(), state.mutableStyleRef()); 653 state.fontBuilder().createFont(state.document().styleEngine().fontSelect or(), state.mutableStyleRef());
654 } 654 }
655 return CSSAnimatableValueFactory::create(property, *state.style()); 655 return CSSAnimatableValueFactory::create(property, *state.style());
656 } 656 }
657 657
658 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element * parent, PseudoId pseudoId) 658 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElement(Element * parent, PseudoId pseudoId)
659 { 659 {
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 visitor->trace(m_watchedSelectorsRules); 1434 visitor->trace(m_watchedSelectorsRules);
1435 visitor->trace(m_treeBoundaryCrossingRules); 1435 visitor->trace(m_treeBoundaryCrossingRules);
1436 visitor->trace(m_styleResourceLoader); 1436 visitor->trace(m_styleResourceLoader);
1437 visitor->trace(m_styleSharingLists); 1437 visitor->trace(m_styleSharingLists);
1438 visitor->trace(m_pendingStyleSheets); 1438 visitor->trace(m_pendingStyleSheets);
1439 visitor->trace(m_document); 1439 visitor->trace(m_document);
1440 #endif 1440 #endif
1441 } 1441 }
1442 1442
1443 } // namespace blink 1443 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/TransformBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698