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

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

Issue 2089593002: Add expansion of shorthands with custom properties to longhands using a pending substition value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renames, signature update and master merge Created 4 years, 5 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) 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. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 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. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/css/CSSBasicShapeValues.h" 44 #include "core/css/CSSBasicShapeValues.h"
45 #include "core/css/CSSCounterValue.h" 45 #include "core/css/CSSCounterValue.h"
46 #include "core/css/CSSCursorImageValue.h" 46 #include "core/css/CSSCursorImageValue.h"
47 #include "core/css/CSSCustomPropertyDeclaration.h" 47 #include "core/css/CSSCustomPropertyDeclaration.h"
48 #include "core/css/CSSFunctionValue.h" 48 #include "core/css/CSSFunctionValue.h"
49 #include "core/css/CSSGradientValue.h" 49 #include "core/css/CSSGradientValue.h"
50 #include "core/css/CSSGridTemplateAreasValue.h" 50 #include "core/css/CSSGridTemplateAreasValue.h"
51 #include "core/css/CSSHelper.h" 51 #include "core/css/CSSHelper.h"
52 #include "core/css/CSSImageSetValue.h" 52 #include "core/css/CSSImageSetValue.h"
53 #include "core/css/CSSPathValue.h" 53 #include "core/css/CSSPathValue.h"
54 #include "core/css/CSSPendingSubstitutionValue.h"
54 #include "core/css/CSSPrimitiveValueMappings.h" 55 #include "core/css/CSSPrimitiveValueMappings.h"
55 #include "core/css/CSSPropertyMetadata.h" 56 #include "core/css/CSSPropertyMetadata.h"
56 #include "core/css/CSSURIValue.h" 57 #include "core/css/CSSURIValue.h"
57 #include "core/css/CSSValuePair.h" 58 #include "core/css/CSSValuePair.h"
58 #include "core/css/CSSVariableReferenceValue.h" 59 #include "core/css/CSSVariableReferenceValue.h"
59 #include "core/css/StylePropertySet.h" 60 #include "core/css/StylePropertySet.h"
60 #include "core/css/StyleRule.h" 61 #include "core/css/StyleRule.h"
61 #include "core/css/resolver/CSSVariableResolver.h" 62 #include "core/css/resolver/CSSVariableResolver.h"
62 #include "core/css/resolver/ElementStyleResources.h" 63 #include "core/css/resolver/ElementStyleResources.h"
63 #include "core/css/resolver/FilterOperationResolver.h" 64 #include "core/css/resolver/FilterOperationResolver.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return true; 106 return true;
106 default: 107 default:
107 return false; 108 return false;
108 } 109 }
109 } 110 }
110 111
111 } // namespace 112 } // namespace
112 113
113 void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, co nst CSSValue& value) 114 void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, co nst CSSValue& value)
114 { 115 {
115 if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariab le && value.isVariableReferenceValue()) { 116 if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariab le
116 CSSVariableResolver::resolveAndApplyVariableReferences(state, id, toCSSV ariableReferenceValue(value)); 117 && (value.isVariableReferenceValue() || value.isPendingSubstitutionValue ())) {
118
119 const CSSValue* resolvedValue = value.isVariableReferenceValue() ?
120 CSSVariableResolver::resolveVariableReferences(state, id, toCSSVaria bleReferenceValue(value)) :
121 CSSVariableResolver::resolvePendingSubstitutions(state, id, toCSSPen dingSubstitutionValue(value));
122 applyProperty(id, state, *resolvedValue);
123
117 if (!state.style()->hasVariableReferenceFromNonInheritedProperty() && !C SSPropertyMetadata::isInheritedProperty(id)) 124 if (!state.style()->hasVariableReferenceFromNonInheritedProperty() && !C SSPropertyMetadata::isInheritedProperty(id))
118 state.style()->setHasVariableReferenceFromNonInheritedProperty(); 125 state.style()->setHasVariableReferenceFromNonInheritedProperty();
119 return; 126 return;
120 } 127 }
121 128
122 DCHECK(!isShorthandProperty(id)) << "Shorthand property id = " << id << " wa sn't expanded at parsing time"; 129 DCHECK(!isShorthandProperty(id)) << "Shorthand property id = " << id << " wa sn't expanded at parsing time";
123 130
124 bool isInherit = state.parentNode() && value.isInheritedValue(); 131 bool isInherit = state.parentNode() && value.isInheritedValue();
125 bool isInitial = value.isInitialValue() || (!state.parentNode() && value.isI nheritedValue()); 132 bool isInitial = value.isInitialValue() || (!state.parentNode() && value.isI nheritedValue());
126 133
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 } 880 }
874 } 881 }
875 882
876 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState& state) 883 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState& state)
877 { 884 {
878 if (!state.parentNode()->isDocumentNode()) 885 if (!state.parentNode()->isDocumentNode())
879 state.style()->setPosition(state.parentStyle()->position()); 886 state.style()->setPosition(state.parentStyle()->position());
880 } 887 }
881 888
882 } // namespace blink 889 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698