| 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 10 matching lines...) Expand all Loading... |
| 21 * 02110-1301 USA | 21 * 02110-1301 USA |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #include "sky/engine/config.h" | 24 #include "sky/engine/config.h" |
| 25 #include "sky/engine/core/css/CSSComputedStyleDeclaration.h" | 25 #include "sky/engine/core/css/CSSComputedStyleDeclaration.h" |
| 26 | 26 |
| 27 #include "gen/sky/core/CSSPropertyNames.h" | 27 #include "gen/sky/core/CSSPropertyNames.h" |
| 28 #include "gen/sky/core/StylePropertyShorthand.h" | 28 #include "gen/sky/core/StylePropertyShorthand.h" |
| 29 #include "gen/sky/platform/FontFamilyNames.h" | 29 #include "gen/sky/platform/FontFamilyNames.h" |
| 30 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 30 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 31 #include "sky/engine/bindings/core/v8/ExceptionState.h" | 31 #include "sky/engine/bindings2/exception_state.h" |
| 32 #include "sky/engine/core/animation/DocumentAnimations.h" | 32 #include "sky/engine/core/animation/DocumentAnimations.h" |
| 33 #include "sky/engine/core/css/BasicShapeFunctions.h" | 33 #include "sky/engine/core/css/BasicShapeFunctions.h" |
| 34 #include "sky/engine/core/css/CSSAspectRatioValue.h" | 34 #include "sky/engine/core/css/CSSAspectRatioValue.h" |
| 35 #include "sky/engine/core/css/CSSBorderImage.h" | 35 #include "sky/engine/core/css/CSSBorderImage.h" |
| 36 #include "sky/engine/core/css/CSSFilterValue.h" | 36 #include "sky/engine/core/css/CSSFilterValue.h" |
| 37 #include "sky/engine/core/css/CSSFontFeatureValue.h" | 37 #include "sky/engine/core/css/CSSFontFeatureValue.h" |
| 38 #include "sky/engine/core/css/CSSFontValue.h" | 38 #include "sky/engine/core/css/CSSFontValue.h" |
| 39 #include "sky/engine/core/css/CSSFunctionValue.h" | 39 #include "sky/engine/core/css/CSSFunctionValue.h" |
| 40 #include "sky/engine/core/css/CSSLineBoxContainValue.h" | 40 #include "sky/engine/core/css/CSSLineBoxContainValue.h" |
| 41 #include "sky/engine/core/css/CSSPrimitiveValue.h" | 41 #include "sky/engine/core/css/CSSPrimitiveValue.h" |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 result.appendLiteral(": "); | 912 result.appendLiteral(": "); |
| 913 result.append(getPropertyValue(properties[i])); | 913 result.append(getPropertyValue(properties[i])); |
| 914 result.append(';'); | 914 result.append(';'); |
| 915 } | 915 } |
| 916 | 916 |
| 917 return result.toString(); | 917 return result.toString(); |
| 918 } | 918 } |
| 919 | 919 |
| 920 void CSSComputedStyleDeclaration::setCSSText(const String&, ExceptionState& exce
ptionState) | 920 void CSSComputedStyleDeclaration::setCSSText(const String&, ExceptionState& exce
ptionState) |
| 921 { | 921 { |
| 922 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore read-only."); | 922 exceptionState.ThrowDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore read-only."); |
| 923 } | 923 } |
| 924 | 924 |
| 925 static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) | 925 static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) |
| 926 { | 926 { |
| 927 ASSERT_ARG(keywordSize, keywordSize); | 927 ASSERT_ARG(keywordSize, keywordSize); |
| 928 ASSERT_ARG(keywordSize, keywordSize <= 8); | 928 ASSERT_ARG(keywordSize, keywordSize <= 8); |
| 929 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); | 929 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); |
| 930 } | 930 } |
| 931 | 931 |
| 932 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
eyword() const | 932 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
eyword() const |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2272 String CSSComputedStyleDeclaration::getPropertyShorthand(const String&) | 2272 String CSSComputedStyleDeclaration::getPropertyShorthand(const String&) |
| 2273 { | 2273 { |
| 2274 return ""; | 2274 return ""; |
| 2275 } | 2275 } |
| 2276 | 2276 |
| 2277 bool CSSComputedStyleDeclaration::isPropertyImplicit(const String&) | 2277 bool CSSComputedStyleDeclaration::isPropertyImplicit(const String&) |
| 2278 { | 2278 { |
| 2279 return false; | 2279 return false; |
| 2280 } | 2280 } |
| 2281 | 2281 |
| 2282 void CSSComputedStyleDeclaration::setProperty(const String& name, const String&,
const String&, ExceptionState& exceptionState) | 2282 void CSSComputedStyleDeclaration::setProperty(const String& name, const String&,
ExceptionState& exceptionState) |
| 2283 { | 2283 { |
| 2284 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + name + "' property is read-only."); | 2284 exceptionState.ThrowDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + name + "' property is read-only."); |
| 2285 } | 2285 } |
| 2286 | 2286 |
| 2287 String CSSComputedStyleDeclaration::removeProperty(const String& name, Exception
State& exceptionState) | 2287 String CSSComputedStyleDeclaration::removeProperty(const String& name, Exception
State& exceptionState) |
| 2288 { | 2288 { |
| 2289 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + name + "' property is read-only."); | 2289 exceptionState.ThrowDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + name + "' property is read-only."); |
| 2290 return String(); | 2290 return String(); |
| 2291 } | 2291 } |
| 2292 | 2292 |
| 2293 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CS
SPropertyID propertyID) | 2293 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValueInternal(CS
SPropertyID propertyID) |
| 2294 { | 2294 { |
| 2295 return getPropertyCSSValue(propertyID); | 2295 return getPropertyCSSValue(propertyID); |
| 2296 } | 2296 } |
| 2297 | 2297 |
| 2298 String CSSComputedStyleDeclaration::getPropertyValueInternal(CSSPropertyID prope
rtyID) | 2298 String CSSComputedStyleDeclaration::getPropertyValueInternal(CSSPropertyID prope
rtyID) |
| 2299 { | 2299 { |
| 2300 return getPropertyValue(propertyID); | 2300 return getPropertyValue(propertyID); |
| 2301 } | 2301 } |
| 2302 | 2302 |
| 2303 void CSSComputedStyleDeclaration::setPropertyInternal(CSSPropertyID id, const St
ring&, ExceptionState& exceptionState) | 2303 void CSSComputedStyleDeclaration::setPropertyInternal(CSSPropertyID id, const St
ring&, ExceptionState& exceptionState) |
| 2304 { | 2304 { |
| 2305 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + getPropertyNameString(id) + "' property is r
ead-only."); | 2305 exceptionState.ThrowDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + getPropertyNameString(id) + "' property is r
ead-only."); |
| 2306 } | 2306 } |
| 2307 | 2307 |
| 2308 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::valuesForBackgroundShortha
nd() const | 2308 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::valuesForBackgroundShortha
nd() const |
| 2309 { | 2309 { |
| 2310 static const CSSPropertyID propertiesBeforeSlashSeperator[5] = { CSSProperty
BackgroundColor, CSSPropertyBackgroundImage, | 2310 static const CSSPropertyID propertiesBeforeSlashSeperator[5] = { CSSProperty
BackgroundColor, CSSPropertyBackgroundImage, |
| 2311 CSSProperty
BackgroundRepeat, CSSPropertyBackgroundAttachment, | 2311 CSSProperty
BackgroundRepeat, CSSPropertyBackgroundAttachment, |
| 2312 CSSProperty
BackgroundPosition }; | 2312 CSSProperty
BackgroundPosition }; |
| 2313 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 2313 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
| 2314 CSSPropertyB
ackgroundClip }; | 2314 CSSPropertyB
ackgroundClip }; |
| 2315 | 2315 |
| 2316 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 2316 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
| 2317 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 2317 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
| 2318 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 2318 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
| 2319 return list.release(); | 2319 return list.release(); |
| 2320 } | 2320 } |
| 2321 | 2321 |
| 2322 } // namespace blink | 2322 } // namespace blink |
| OLD | NEW |