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

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

Issue 292173009: Web Animations - responsive interpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@0519_MySeparation
Patch Set: applyAndSnapshotAnimatableValue Created 6 years, 7 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
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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 745
746 loadPendingResources(state); 746 loadPendingResources(state);
747 747
748 didAccess(); 748 didAccess();
749 749
750 return state.takeStyle(); 750 return state.takeStyle();
751 } 751 }
752 752
753 // This function is used by the WebAnimations JavaScript API method animate(). 753 // This function is used by the WebAnimations JavaScript API method animate().
754 // FIXME: Remove this when animate() switches away from resolution-dependent par sing. 754 // FIXME: Remove this when animate() switches away from resolution-dependent par sing.
755 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap shot(Element& element, CSSPropertyID property, CSSValue* value) 755 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::applyAndSnapshotAnimatabl eValue(Element& element, CSSPropertyID property, CSSValue& value, RenderStyle* m utableStyle)
756 { 756 {
757 // We use a fresh RenderStyle here because certain values (eg. background-po sition) won't always completely replace the previously applied property. 757 RefPtr<RenderStyle> style;
758 RefPtr<RenderStyle> style = element.renderStyle() ? RenderStyle::clone(eleme nt.renderStyle()) : RenderStyle::create(); 758 if (mutableStyle)
759 style = mutableStyle;
760 else if (element.renderStyle())
761 style = RenderStyle::clone(element.renderStyle());
762 else
763 style = RenderStyle::create();
shans 2014/05/26 03:31:01 This looks like a recipe for introducing bugs in t
alancutter (OOO until 2018) 2014/05/26 05:22:41 Perhaps the style parameter should be non-optional
759 StyleResolverState state(element.document(), &element); 764 StyleResolverState state(element.document(), &element);
760 state.setStyle(style.get()); 765 state.setStyle(style.get());
761 state.fontBuilder().initForStyleResolve(state.document(), state.style(), sta te.useSVGZoomRules()); 766 state.fontBuilder().initForStyleResolve(state.document(), state.style(), sta te.useSVGZoomRules());
762 StyleBuilder::applyProperty(property, state, value); 767 StyleBuilder::applyProperty(property, state, &value);
763 return CSSAnimatableValueFactory::create(property, *style); 768 return CSSAnimatableValueFactory::create(property, *style);
764 } 769 }
765 770
766 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded (Element& parent, PseudoId pseudoId) 771 PassRefPtrWillBeRawPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded (Element& parent, PseudoId pseudoId)
767 { 772 {
768 RenderObject* parentRenderer = parent.renderer(); 773 RenderObject* parentRenderer = parent.renderer();
769 if (!parentRenderer) 774 if (!parentRenderer)
770 return nullptr; 775 return nullptr;
771 776
772 if (pseudoId < FIRST_INTERNAL_PSEUDOID && !parentRenderer->style()->hasPseud oStyle(pseudoId)) 777 if (pseudoId < FIRST_INTERNAL_PSEUDOID && !parentRenderer->style()->hasPseud oStyle(pseudoId))
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 visitor->trace(m_features); 1500 visitor->trace(m_features);
1496 visitor->trace(m_siblingRuleSet); 1501 visitor->trace(m_siblingRuleSet);
1497 visitor->trace(m_uncommonAttributeRuleSet); 1502 visitor->trace(m_uncommonAttributeRuleSet);
1498 visitor->trace(m_watchedSelectorsRules); 1503 visitor->trace(m_watchedSelectorsRules);
1499 visitor->trace(m_treeBoundaryCrossingRules); 1504 visitor->trace(m_treeBoundaryCrossingRules);
1500 visitor->trace(m_pendingStyleSheets); 1505 visitor->trace(m_pendingStyleSheets);
1501 CSSFontSelectorClient::trace(visitor); 1506 CSSFontSelectorClient::trace(visitor);
1502 } 1507 }
1503 1508
1504 } // namespace WebCore 1509 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698