| OLD | NEW |
| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CS
SValue* value) | 110 void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CS
SValue* value) |
| 111 { | 111 { |
| 112 if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariab
le && value->isVariableReferenceValue()) { | 112 if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariab
le && value->isVariableReferenceValue()) { |
| 113 CSSVariableResolver::resolveAndApplyVariableReferences(state, id, *toCSS
VariableReferenceValue(value)); | 113 CSSVariableResolver::resolveAndApplyVariableReferences(state, id, *toCSS
VariableReferenceValue(value)); |
| 114 if (!state.style()->hasVariableReferenceFromNonInheritedProperty() && !C
SSPropertyMetadata::isInheritedProperty(id)) | 114 if (!state.style()->hasVariableReferenceFromNonInheritedProperty() && !C
SSPropertyMetadata::isInheritedProperty(id)) |
| 115 state.style()->setHasVariableReferenceFromNonInheritedProperty(); | 115 state.style()->setHasVariableReferenceFromNonInheritedProperty(); |
| 116 return; | 116 return; |
| 117 } | 117 } |
| 118 | 118 |
| 119 ASSERT_WITH_MESSAGE(!isShorthandProperty(id), "Shorthand property id = %d wa
sn't expanded at parsing time", id); | 119 DCHECK(!isShorthandProperty(id)) << "Shorthand property id = " << id << " wa
sn't expanded at parsing time"; |
| 120 | 120 |
| 121 bool isInherit = state.parentNode() && value->isInheritedValue(); | 121 bool isInherit = state.parentNode() && value->isInheritedValue(); |
| 122 bool isInitial = value->isInitialValue() || (!state.parentNode() && value->i
sInheritedValue()); | 122 bool isInitial = value->isInitialValue() || (!state.parentNode() && value->i
sInheritedValue()); |
| 123 | 123 |
| 124 ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial ->
!isInherit | 124 ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial ->
!isInherit |
| 125 ASSERT(!isInherit || (state.parentNode() && state.parentStyle())); // isInhe
rit -> (state.parentNode() && state.parentStyle()) | 125 ASSERT(!isInherit || (state.parentNode() && state.parentStyle())); // isInhe
rit -> (state.parentNode() && state.parentStyle()) |
| 126 | 126 |
| 127 if (!state.applyPropertyToRegularStyle() && (!state.applyPropertyToVisitedLi
nkStyle() || !isValidVisitedLinkProperty(id))) { | 127 if (!state.applyPropertyToRegularStyle() && (!state.applyPropertyToVisitedLi
nkStyle() || !isValidVisitedLinkProperty(id))) { |
| 128 // Limit the properties that can be applied to only the ones honored by
:visited. | 128 // Limit the properties that can be applied to only the ones honored by
:visited. |
| 129 return; | 129 return; |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 } | 842 } |
| 843 } | 843 } |
| 844 | 844 |
| 845 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) | 845 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) |
| 846 { | 846 { |
| 847 if (!state.parentNode()->isDocumentNode()) | 847 if (!state.parentNode()->isDocumentNode()) |
| 848 state.style()->setPosition(state.parentStyle()->position()); | 848 state.style()->setPosition(state.parentStyle()->position()); |
| 849 } | 849 } |
| 850 | 850 |
| 851 } // namespace blink | 851 } // namespace blink |
| OLD | NEW |