| 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. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1753 needs_apply_pass); | 1753 needs_apply_pass); |
| 1754 if (apply_animations == kIncludeAnimations) { | 1754 if (apply_animations == kIncludeAnimations) { |
| 1755 ApplyAnimatedProperties<kResolveVariables>( | 1755 ApplyAnimatedProperties<kResolveVariables>( |
| 1756 state, | 1756 state, |
| 1757 state.AnimationUpdate().ActiveInterpolationsForCustomAnimations()); | 1757 state.AnimationUpdate().ActiveInterpolationsForCustomAnimations()); |
| 1758 ApplyAnimatedProperties<kResolveVariables>( | 1758 ApplyAnimatedProperties<kResolveVariables>( |
| 1759 state, | 1759 state, |
| 1760 state.AnimationUpdate().ActiveInterpolationsForCustomTransitions()); | 1760 state.AnimationUpdate().ActiveInterpolationsForCustomTransitions()); |
| 1761 } | 1761 } |
| 1762 // TODO(leviw): stop recalculating every time | 1762 // TODO(leviw): stop recalculating every time |
| 1763 CSSVariableResolver::ResolveVariableDefinitions(state); | 1763 CSSVariableResolver(state).ResolveVariableDefinitions(); |
| 1764 | 1764 |
| 1765 if (RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) { | 1765 if (RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) { |
| 1766 if (CacheCustomPropertiesForApplyAtRules(state, | 1766 if (CacheCustomPropertiesForApplyAtRules(state, |
| 1767 match_result.AuthorRules())) { | 1767 match_result.AuthorRules())) { |
| 1768 ApplyMatchedProperties<kResolveVariables, kUpdateNeedsApplyPass>( | 1768 ApplyMatchedProperties<kResolveVariables, kUpdateNeedsApplyPass>( |
| 1769 state, match_result.AuthorRules(), false, apply_inherited_only, | 1769 state, match_result.AuthorRules(), false, apply_inherited_only, |
| 1770 needs_apply_pass); | 1770 needs_apply_pass); |
| 1771 ApplyMatchedProperties<kResolveVariables, kCheckNeedsApplyPass>( | 1771 ApplyMatchedProperties<kResolveVariables, kCheckNeedsApplyPass>( |
| 1772 state, match_result.AuthorRules(), true, apply_inherited_only, | 1772 state, match_result.AuthorRules(), true, apply_inherited_only, |
| 1773 needs_apply_pass); | 1773 needs_apply_pass); |
| 1774 if (apply_animations == kIncludeAnimations) { | 1774 if (apply_animations == kIncludeAnimations) { |
| 1775 ApplyAnimatedProperties<kResolveVariables>( | 1775 ApplyAnimatedProperties<kResolveVariables>( |
| 1776 state, | 1776 state, |
| 1777 state.AnimationUpdate().ActiveInterpolationsForCustomAnimations()); | 1777 state.AnimationUpdate().ActiveInterpolationsForCustomAnimations()); |
| 1778 ApplyAnimatedProperties<kResolveVariables>( | 1778 ApplyAnimatedProperties<kResolveVariables>( |
| 1779 state, | 1779 state, |
| 1780 state.AnimationUpdate().ActiveInterpolationsForCustomTransitions()); | 1780 state.AnimationUpdate().ActiveInterpolationsForCustomTransitions()); |
| 1781 } | 1781 } |
| 1782 CSSVariableResolver::ResolveVariableDefinitions(state); | 1782 CSSVariableResolver(state).ResolveVariableDefinitions(); |
| 1783 } | 1783 } |
| 1784 } | 1784 } |
| 1785 } | 1785 } |
| 1786 | 1786 |
| 1787 void StyleResolver::ApplyMatchedAnimationProperties( | 1787 void StyleResolver::ApplyMatchedAnimationProperties( |
| 1788 StyleResolverState& state, | 1788 StyleResolverState& state, |
| 1789 const MatchResult& match_result, | 1789 const MatchResult& match_result, |
| 1790 const CacheSuccess& cache_success, | 1790 const CacheSuccess& cache_success, |
| 1791 NeedsApplyPass& needs_apply_pass) { | 1791 NeedsApplyPass& needs_apply_pass) { |
| 1792 DCHECK(!cache_success.IsFullCacheHit()); | 1792 DCHECK(!cache_success.IsFullCacheHit()); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1880 UpdateFont(state); | 1880 UpdateFont(state); |
| 1881 | 1881 |
| 1882 // Many properties depend on the font. If it changes we just apply all | 1882 // Many properties depend on the font. If it changes we just apply all |
| 1883 // properties. | 1883 // properties. |
| 1884 if (cache_success.cached_matched_properties && | 1884 if (cache_success.cached_matched_properties && |
| 1885 cache_success.cached_matched_properties->computed_style | 1885 cache_success.cached_matched_properties->computed_style |
| 1886 ->GetFontDescription() != state.Style()->GetFontDescription()) | 1886 ->GetFontDescription() != state.Style()->GetFontDescription()) |
| 1887 apply_inherited_only = false; | 1887 apply_inherited_only = false; |
| 1888 | 1888 |
| 1889 // Registered custom properties are computed after high priority properties. | 1889 // Registered custom properties are computed after high priority properties. |
| 1890 CSSVariableResolver::ComputeRegisteredVariables(state); | 1890 CSSVariableResolver(state).ComputeRegisteredVariables(); |
| 1891 | 1891 |
| 1892 // Now do the normal priority UA properties. | 1892 // Now do the normal priority UA properties. |
| 1893 ApplyMatchedProperties<kLowPropertyPriority, kCheckNeedsApplyPass>( | 1893 ApplyMatchedProperties<kLowPropertyPriority, kCheckNeedsApplyPass>( |
| 1894 state, match_result.UaRules(), false, apply_inherited_only, | 1894 state, match_result.UaRules(), false, apply_inherited_only, |
| 1895 needs_apply_pass); | 1895 needs_apply_pass); |
| 1896 | 1896 |
| 1897 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyle. | 1897 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyle. |
| 1898 state.CacheUserAgentBorderAndBackground(); | 1898 state.CacheUserAgentBorderAndBackground(); |
| 1899 | 1899 |
| 1900 // Now do the author and user normal priority properties and all the | 1900 // Now do the author and user normal priority properties and all the |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2020 | 2020 |
| 2021 DEFINE_TRACE(StyleResolver) { | 2021 DEFINE_TRACE(StyleResolver) { |
| 2022 visitor->Trace(matched_properties_cache_); | 2022 visitor->Trace(matched_properties_cache_); |
| 2023 visitor->Trace(selector_filter_); | 2023 visitor->Trace(selector_filter_); |
| 2024 visitor->Trace(style_sharing_lists_); | 2024 visitor->Trace(style_sharing_lists_); |
| 2025 visitor->Trace(document_); | 2025 visitor->Trace(document_); |
| 2026 visitor->Trace(tracker_); | 2026 visitor->Trace(tracker_); |
| 2027 } | 2027 } |
| 2028 | 2028 |
| 2029 } // namespace blink | 2029 } // namespace blink |
| OLD | NEW |