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

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 73643004: Web Animations: Extract an API for servicing animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 11 matching lines...) Expand all
22 */ 22 */
23 23
24 #include "config.h" 24 #include "config.h"
25 #include "core/css/CSSComputedStyleDeclaration.h" 25 #include "core/css/CSSComputedStyleDeclaration.h"
26 26
27 #include "CSSPropertyNames.h" 27 #include "CSSPropertyNames.h"
28 #include "FontFamilyNames.h" 28 #include "FontFamilyNames.h"
29 #include "RuntimeEnabledFeatures.h" 29 #include "RuntimeEnabledFeatures.h"
30 #include "StylePropertyShorthand.h" 30 #include "StylePropertyShorthand.h"
31 #include "bindings/v8/ExceptionState.h" 31 #include "bindings/v8/ExceptionState.h"
32 #include "core/animation/ActiveAnimations.h" 32 #include "core/animation/DocumentAnimations.h"
33 #include "core/animation/AnimationClock.h"
34 #include "core/animation/DocumentTimeline.h"
35 #include "core/css/BasicShapeFunctions.h" 33 #include "core/css/BasicShapeFunctions.h"
36 #include "core/css/CSSArrayFunctionValue.h" 34 #include "core/css/CSSArrayFunctionValue.h"
37 #include "core/css/CSSAspectRatioValue.h" 35 #include "core/css/CSSAspectRatioValue.h"
38 #include "core/css/CSSBorderImage.h" 36 #include "core/css/CSSBorderImage.h"
39 #include "core/css/CSSFilterValue.h" 37 #include "core/css/CSSFilterValue.h"
40 #include "core/css/CSSFontFeatureValue.h" 38 #include "core/css/CSSFontFeatureValue.h"
41 #include "core/css/CSSFontValue.h" 39 #include "core/css/CSSFontValue.h"
42 #include "core/css/CSSFunctionValue.h" 40 #include "core/css/CSSFunctionValue.h"
43 #include "core/css/CSSGridTemplateValue.h" 41 #include "core/css/CSSGridTemplateValue.h"
44 #include "core/css/CSSLineBoxContainValue.h" 42 #include "core/css/CSSLineBoxContainValue.h"
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 if (!styledNode) 1616 if (!styledNode)
1619 return 0; 1617 return 0;
1620 RenderObject* renderer = styledNode->renderer(); 1618 RenderObject* renderer = styledNode->renderer();
1621 RefPtr<RenderStyle> style; 1619 RefPtr<RenderStyle> style;
1622 1620
1623 if (updateLayout) { 1621 if (updateLayout) {
1624 Document& document = styledNode->document(); 1622 Document& document = styledNode->document();
1625 1623
1626 // If a compositor animation is running we may need to service animation s 1624 // If a compositor animation is running we may need to service animation s
1627 // in order to generate an up to date value. 1625 // in order to generate an up to date value.
1628 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && styledNode->isE lementNode()) { 1626 DocumentAnimations::serviceBeforeGetComputedStyle(*styledNode, propertyI D);
1629 const Element* element = toElement(styledNode);
1630 if (const ActiveAnimations* activeAnimations = element->activeAnimat ions()) {
1631 if (activeAnimations->hasActiveAnimationsOnCompositor(propertyID ))
1632 document.serviceAnimations(monotonicallyIncreasingTime());
1633 }
1634 }
1635 1627
1636 document.updateStyleForNodeIfNeeded(styledNode); 1628 document.updateStyleForNodeIfNeeded(styledNode);
1637 1629
1638 // The style recalc could have caused the styled node to be discarded or replaced 1630 // The style recalc could have caused the styled node to be discarded or replaced
1639 // if it was a PseudoElement so we need to update it. 1631 // if it was a PseudoElement so we need to update it.
1640 styledNode = this->styledNode(); 1632 styledNode = this->styledNode();
1641 renderer = styledNode->renderer(); 1633 renderer = styledNode->renderer();
1642 1634
1643 style = computeRenderStyle(propertyID); 1635 style = computeRenderStyle(propertyID);
1644 1636
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3220 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3229 CSSPropertyB ackgroundClip }; 3221 CSSPropertyB ackgroundClip };
3230 3222
3231 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3223 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3232 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3224 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3233 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3225 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3234 return list.release(); 3226 return list.release();
3235 } 3227 }
3236 3228
3237 } // namespace WebCore 3229 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698