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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 2106073005: Add fast-path for propagated variable changes (WIP) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@+pointer_events_fastpath_5
Patch Set: Rebase Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 StyleResolverState& state, 113 StyleResolverState& state,
114 const CSSValue& value) { 114 const CSSValue& value) {
115 if (id != CSSPropertyVariable && (value.isVariableReferenceValue() || 115 if (id != CSSPropertyVariable && (value.isVariableReferenceValue() ||
116 value.isPendingSubstitutionValue())) { 116 value.isPendingSubstitutionValue())) {
117 bool omitAnimationTainted = CSSAnimations::isAnimationAffectingProperty(id); 117 bool omitAnimationTainted = CSSAnimations::isAnimationAffectingProperty(id);
118 const CSSValue* resolvedValue = 118 const CSSValue* resolvedValue =
119 CSSVariableResolver::resolveVariableReferences(state, id, value, 119 CSSVariableResolver::resolveVariableReferences(state, id, value,
120 omitAnimationTainted); 120 omitAnimationTainted);
121 applyProperty(id, state, *resolvedValue); 121 applyProperty(id, state, *resolvedValue);
122 122
123 if (!state.style()->hasVariableReferenceFromNonInheritedProperty() && 123 // TODO(sashab): Clear this flag if all properties are set back to
124 !CSSPropertyMetadata::isInheritedProperty(id)) 124 // non-variable references.
125 if (CSSPropertyMetadata::isInheritedProperty(id))
126 state.style()->setHasVariableReferenceFromInheritedProperty();
127 else
125 state.style()->setHasVariableReferenceFromNonInheritedProperty(); 128 state.style()->setHasVariableReferenceFromNonInheritedProperty();
129
126 return; 130 return;
127 } 131 }
128 132
129 DCHECK(!isShorthandProperty(id)) << "Shorthand property id = " << id 133 DCHECK(!isShorthandProperty(id)) << "Shorthand property id = " << id
130 << " wasn't expanded at parsing time"; 134 << " wasn't expanded at parsing time";
131 135
132 bool isInherit = state.parentNode() && value.isInheritedValue(); 136 bool isInherit = state.parentNode() && value.isInheritedValue();
133 bool isInitial = value.isInitialValue() || 137 bool isInitial = value.isInitialValue() ||
134 (!state.parentNode() && value.isInheritedValue()); 138 (!state.parentNode() && value.isInheritedValue());
135 139
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 } 1036 }
1033 } 1037 }
1034 1038
1035 void StyleBuilderFunctions::applyInheritCSSPropertyPosition( 1039 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(
1036 StyleResolverState& state) { 1040 StyleResolverState& state) {
1037 if (!state.parentNode()->isDocumentNode()) 1041 if (!state.parentNode()->isDocumentNode())
1038 state.style()->setPosition(state.parentStyle()->position()); 1042 state.style()->setPosition(state.parentStyle()->position());
1039 } 1043 }
1040 1044
1041 } // namespace blink 1045 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSVariableData.h ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698