OLD | NEW |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "core/dom/Text.h" | 75 #include "core/dom/Text.h" |
76 #include "core/dom/shadow/ElementShadow.h" | 76 #include "core/dom/shadow/ElementShadow.h" |
77 #include "core/dom/shadow/ShadowRoot.h" | 77 #include "core/dom/shadow/ShadowRoot.h" |
78 #include "core/frame/FrameView.h" | 78 #include "core/frame/FrameView.h" |
79 #include "core/frame/LocalFrame.h" | 79 #include "core/frame/LocalFrame.h" |
80 #include "core/frame/Settings.h" | 80 #include "core/frame/Settings.h" |
81 #include "core/html/HTMLIFrameElement.h" | 81 #include "core/html/HTMLIFrameElement.h" |
82 #include "core/inspector/InspectorInstrumentation.h" | 82 #include "core/inspector/InspectorInstrumentation.h" |
83 #include "core/layout/GeneratedChildren.h" | 83 #include "core/layout/GeneratedChildren.h" |
84 #include "core/layout/LayoutView.h" | 84 #include "core/layout/LayoutView.h" |
85 #include "core/style/KeyframeList.h" | |
86 #include "core/svg/SVGDocumentExtensions.h" | 85 #include "core/svg/SVGDocumentExtensions.h" |
87 #include "core/svg/SVGElement.h" | 86 #include "core/svg/SVGElement.h" |
88 #include "platform/RuntimeEnabledFeatures.h" | 87 #include "platform/RuntimeEnabledFeatures.h" |
89 #include "wtf/StdLibExtras.h" | 88 #include "wtf/StdLibExtras.h" |
90 | 89 |
91 namespace { | 90 namespace { |
92 | 91 |
93 using namespace blink; | 92 using namespace blink; |
94 | 93 |
95 void setAnimationUpdateIfNeeded(StyleResolverState& state, Element& element) | 94 void setAnimationUpdateIfNeeded(StyleResolverState& state, Element& element) |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 | 626 |
628 setAnimationUpdateIfNeeded(state, *element); | 627 setAnimationUpdateIfNeeded(state, *element); |
629 | 628 |
630 if (state.style()->hasViewportUnits()) | 629 if (state.style()->hasViewportUnits()) |
631 document().setHasViewportUnits(); | 630 document().setHasViewportUnits(); |
632 | 631 |
633 // Now return the style. | 632 // Now return the style. |
634 return state.takeStyle(); | 633 return state.takeStyle(); |
635 } | 634 } |
636 | 635 |
637 PassRefPtr<ComputedStyle> StyleResolver::styleForKeyframe(Element& element, cons
t ComputedStyle& elementStyle, const ComputedStyle* parentStyle, const StyleRule
Keyframe* keyframe, const AtomicString& animationName) | |
638 { | |
639 ASSERT(document().frame()); | |
640 ASSERT(document().settings()); | |
641 ASSERT(!hasPendingAuthorStyleSheets()); | |
642 | |
643 StyleResolverState state(document(), &element, parentStyle); | |
644 | |
645 MatchResult result; | |
646 result.addMatchedProperties(&keyframe->properties()); | |
647 | |
648 ASSERT(!state.style()); | |
649 | |
650 // Create the style | |
651 state.setStyle(ComputedStyle::clone(elementStyle)); | |
652 | |
653 // We don't need to bother with !important. Since there is only ever one | |
654 // decl, there's nothing to override. So just add the first properties. | |
655 // We also don't need to bother with animation properties since the only | |
656 // relevant one is animation-timing-function and we special-case that in | |
657 // CSSAnimations.cpp | |
658 bool inheritedOnly = false; | |
659 applyMatchedProperties<HighPropertyPriority>(state, result, false, result.be
gin(), result.end(), inheritedOnly); | |
660 | |
661 // If our font got dirtied, go ahead and update it now. | |
662 updateFont(state); | |
663 | |
664 // Now do rest of the properties. | |
665 applyMatchedProperties<LowPropertyPriority>(state, result, false, result.beg
in(), result.end(), inheritedOnly); | |
666 | |
667 loadPendingResources(state); | |
668 | |
669 didAccess(); | |
670 | |
671 return state.takeStyle(); | |
672 } | |
673 | |
674 // This function is used by the WebAnimations JavaScript API method animate(). | 636 // This function is used by the WebAnimations JavaScript API method animate(). |
675 // FIXME: Remove this when animate() switches away from resolution-dependent par
sing. | 637 // FIXME: Remove this when animate() switches away from resolution-dependent par
sing. |
676 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap
shot(Element& element, const ComputedStyle* baseStyle, CSSPropertyID property, C
SSValue* value) | 638 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap
shot(Element& element, const ComputedStyle* baseStyle, CSSPropertyID property, C
SSValue* value) |
677 { | 639 { |
678 StyleResolverState state(element.document(), &element); | 640 StyleResolverState state(element.document(), &element); |
679 state.setStyle(baseStyle ? ComputedStyle::clone(*baseStyle) : ComputedStyle:
:create()); | 641 state.setStyle(baseStyle ? ComputedStyle::clone(*baseStyle) : ComputedStyle:
:create()); |
680 return createAnimatableValueSnapshot(state, property, value); | 642 return createAnimatableValueSnapshot(state, property, value); |
681 } | 643 } |
682 | 644 |
683 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap
shot(StyleResolverState& state, CSSPropertyID property, CSSValue* value) | 645 PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnap
shot(StyleResolverState& state, CSSPropertyID property, CSSValue* value) |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 visitor->trace(m_watchedSelectorsRules); | 1430 visitor->trace(m_watchedSelectorsRules); |
1469 visitor->trace(m_treeBoundaryCrossingRules); | 1431 visitor->trace(m_treeBoundaryCrossingRules); |
1470 visitor->trace(m_styleResourceLoader); | 1432 visitor->trace(m_styleResourceLoader); |
1471 visitor->trace(m_styleSharingLists); | 1433 visitor->trace(m_styleSharingLists); |
1472 visitor->trace(m_pendingStyleSheets); | 1434 visitor->trace(m_pendingStyleSheets); |
1473 visitor->trace(m_document); | 1435 visitor->trace(m_document); |
1474 #endif | 1436 #endif |
1475 } | 1437 } |
1476 | 1438 |
1477 } // namespace blink | 1439 } // namespace blink |
OLD | NEW |