OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 result.append(": ", 2); | 1253 result.append(": ", 2); |
1254 result.append(getPropertyValue(properties[i])); | 1254 result.append(getPropertyValue(properties[i])); |
1255 result.append(';'); | 1255 result.append(';'); |
1256 } | 1256 } |
1257 | 1257 |
1258 return result.toString(); | 1258 return result.toString(); |
1259 } | 1259 } |
1260 | 1260 |
1261 void CSSComputedStyleDeclaration::setCSSText(const String&, ExceptionState& exce
ptionState) | 1261 void CSSComputedStyleDeclaration::setCSSText(const String&, ExceptionState& exce
ptionState) |
1262 { | 1262 { |
1263 exceptionState.throwDOMException(NoModificationAllowedError, "Failed to set
the 'cssText' property on a computed 'CSSStyleDeclaration': computed styles are
read-only."); | 1263 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore read-only."); |
1264 } | 1264 } |
1265 | 1265 |
1266 static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) | 1266 static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) |
1267 { | 1267 { |
1268 ASSERT_ARG(keywordSize, keywordSize); | 1268 ASSERT_ARG(keywordSize, keywordSize); |
1269 ASSERT_ARG(keywordSize, keywordSize <= 8); | 1269 ASSERT_ARG(keywordSize, keywordSize <= 8); |
1270 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); | 1270 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); |
1271 } | 1271 } |
1272 | 1272 |
1273 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
eyword() const | 1273 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
eyword() const |
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3105 return ""; | 3105 return ""; |
3106 } | 3106 } |
3107 | 3107 |
3108 bool CSSComputedStyleDeclaration::isPropertyImplicit(const String&) | 3108 bool CSSComputedStyleDeclaration::isPropertyImplicit(const String&) |
3109 { | 3109 { |
3110 return false; | 3110 return false; |
3111 } | 3111 } |
3112 | 3112 |
3113 void CSSComputedStyleDeclaration::setProperty(const String& name, const String&,
const String&, ExceptionState& exceptionState) | 3113 void CSSComputedStyleDeclaration::setProperty(const String& name, const String&,
const String&, ExceptionState& exceptionState) |
3114 { | 3114 { |
3115 exceptionState.throwDOMException(NoModificationAllowedError, "Failed to set
the '" + name + "' property on a computed 'CSSStyleDeclaration': computed styles
are read-only."); | 3115 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + name + "' property is read-only."); |
3116 } | 3116 } |
3117 | 3117 |
3118 String CSSComputedStyleDeclaration::removeProperty(const String& name, Exception
State& exceptionState) | 3118 String CSSComputedStyleDeclaration::removeProperty(const String& name, Exception
State& exceptionState) |
3119 { | 3119 { |
3120 exceptionState.throwDOMException(NoModificationAllowedError, "Failed to remo
ve the '" + name + "' property from a computed 'CSSStyleDeclaration': computed s
tyles are read-only."); | 3120 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + name + "' property is read-only."); |
3121 return String(); | 3121 return String(); |
3122 } | 3122 } |
3123 | 3123 |
3124 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CS
SPropertyID propertyID) | 3124 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CS
SPropertyID propertyID) |
3125 { | 3125 { |
3126 return getPropertyCSSValue(propertyID); | 3126 return getPropertyCSSValue(propertyID); |
3127 } | 3127 } |
3128 | 3128 |
3129 String CSSComputedStyleDeclaration::getPropertyValueInternal(CSSPropertyID prope
rtyID) | 3129 String CSSComputedStyleDeclaration::getPropertyValueInternal(CSSPropertyID prope
rtyID) |
3130 { | 3130 { |
3131 return getPropertyValue(propertyID); | 3131 return getPropertyValue(propertyID); |
3132 } | 3132 } |
3133 | 3133 |
3134 void CSSComputedStyleDeclaration::setPropertyInternal(CSSPropertyID id, const St
ring&, bool, ExceptionState& exceptionState) | 3134 void CSSComputedStyleDeclaration::setPropertyInternal(CSSPropertyID id, const St
ring&, bool, ExceptionState& exceptionState) |
3135 { | 3135 { |
3136 exceptionState.throwDOMException(NoModificationAllowedError, "This object is
computed, and therefore read-only."); | 3136 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + getPropertyNameString(id) + "' property is r
ead-only."); |
3137 } | 3137 } |
3138 | 3138 |
3139 const HashMap<AtomicString, String>* CSSComputedStyleDeclaration::variableMap()
const | 3139 const HashMap<AtomicString, String>* CSSComputedStyleDeclaration::variableMap()
const |
3140 { | 3140 { |
3141 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); | 3141 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
3142 Node* styledNode = this->styledNode(); | 3142 Node* styledNode = this->styledNode(); |
3143 if (!styledNode) | 3143 if (!styledNode) |
3144 return 0; | 3144 return 0; |
3145 RefPtr<RenderStyle> style = styledNode->computedStyle(styledNode->isPseudoEl
ement() ? NOPSEUDO : m_pseudoElementSpecifier); | 3145 RefPtr<RenderStyle> style = styledNode->computedStyle(styledNode->isPseudoEl
ement() ? NOPSEUDO : m_pseudoElementSpecifier); |
3146 if (!style) | 3146 if (!style) |
(...skipping 18 matching lines...) Expand all Loading... |
3165 return emptyString(); | 3165 return emptyString(); |
3166 HashMap<AtomicString, String>::const_iterator it = variables->find(name); | 3166 HashMap<AtomicString, String>::const_iterator it = variables->find(name); |
3167 if (it == variables->end()) | 3167 if (it == variables->end()) |
3168 return emptyString(); | 3168 return emptyString(); |
3169 return it->value; | 3169 return it->value; |
3170 } | 3170 } |
3171 | 3171 |
3172 bool CSSComputedStyleDeclaration::setVariableValue(const AtomicString& name, con
st String&, ExceptionState& exceptionState) | 3172 bool CSSComputedStyleDeclaration::setVariableValue(const AtomicString& name, con
st String&, ExceptionState& exceptionState) |
3173 { | 3173 { |
3174 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); | 3174 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
3175 exceptionState.throwDOMException(NoModificationAllowedError, "Failed to set
the '" + name + "' property on a computed 'CSSStyleDeclaration': computed styles
are read-only."); | 3175 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + name + "' property is read-only."); |
3176 return false; | 3176 return false; |
3177 } | 3177 } |
3178 | 3178 |
3179 bool CSSComputedStyleDeclaration::removeVariable(const AtomicString&) | 3179 bool CSSComputedStyleDeclaration::removeVariable(const AtomicString&) |
3180 { | 3180 { |
3181 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); | 3181 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
3182 return false; | 3182 return false; |
3183 } | 3183 } |
3184 | 3184 |
3185 bool CSSComputedStyleDeclaration::clearVariables(ExceptionState& exceptionState) | 3185 bool CSSComputedStyleDeclaration::clearVariables(ExceptionState& exceptionState) |
3186 { | 3186 { |
3187 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); | 3187 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
3188 exceptionState.throwDOMException(NoModificationAllowedError, "Failed to clea
r variables from a computed 'CSSStyleDeclaration': computed styles are read-only
."); | 3188 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore variables may not be cleared."); |
3189 return false; | 3189 return false; |
3190 } | 3190 } |
3191 | 3191 |
3192 CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::ComputedCSSVariablesI
terator(const HashMap<AtomicString, String>* variables) | 3192 CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::ComputedCSSVariablesI
terator(const HashMap<AtomicString, String>* variables) |
3193 : m_active(variables) | 3193 : m_active(variables) |
3194 { | 3194 { |
3195 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); | 3195 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
3196 if (m_active) { | 3196 if (m_active) { |
3197 m_it = variables->begin(); | 3197 m_it = variables->begin(); |
3198 m_end = variables->end(); | 3198 m_end = variables->end(); |
(...skipping 27 matching lines...) Expand all Loading... |
3226 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 3226 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
3227 CSSPropertyB
ackgroundClip }; | 3227 CSSPropertyB
ackgroundClip }; |
3228 | 3228 |
3229 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 3229 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
3230 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 3230 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
3231 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 3231 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
3232 return list.release(); | 3232 return list.release(); |
3233 } | 3233 } |
3234 | 3234 |
3235 } // namespace WebCore | 3235 } // namespace WebCore |
OLD | NEW |