| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // NOTE: cssPropertyInfo lookups incur several mallocs. | 190 // NOTE: cssPropertyInfo lookups incur several mallocs. |
| 191 // Successful lookups have the same cost the first time, but are cached. | 191 // Successful lookups have the same cost the first time, but are cached. |
| 192 if (cssPropertyInfo(v8Name.As<v8::String>(), info.GetIsolate())) { | 192 if (cssPropertyInfo(v8Name.As<v8::String>(), info.GetIsolate())) { |
| 193 v8SetReturnValueInt(info, 0); | 193 v8SetReturnValueInt(info, 0); |
| 194 return; | 194 return; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 void V8CSSStyleDeclaration::namedPropertyGetterCustom(v8::Local<v8::Name> name,
const v8::PropertyCallbackInfo<v8::Value>& info) | 198 void V8CSSStyleDeclaration::namedPropertyGetterCustom(v8::Local<v8::Name> name,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 199 { | 199 { |
| 200 if (!name->IsString()) | |
| 201 return; | |
| 202 // First look for API defined attributes on the style declaration object. | |
| 203 if (v8CallBoolean(info.Holder()->HasRealNamedCallbackProperty(info.GetIsolat
e()->GetCurrentContext(), name.As<v8::String>()))) | |
| 204 return; | |
| 205 | |
| 206 // Search the style declaration. | 200 // Search the style declaration. |
| 207 CSSPropertyInfo* propInfo = cssPropertyInfo(name.As<v8::String>(), info.GetI
solate()); | 201 CSSPropertyInfo* propInfo = cssPropertyInfo(name.As<v8::String>(), info.GetI
solate()); |
| 208 | 202 |
| 209 // Do not handle non-property names. | 203 // Do not handle non-property names. |
| 210 if (!propInfo) | 204 if (!propInfo) |
| 211 return; | 205 return; |
| 212 | 206 |
| 213 CSSStyleDeclaration* impl = V8CSSStyleDeclaration::toImpl(info.Holder()); | 207 CSSStyleDeclaration* impl = V8CSSStyleDeclaration::toImpl(info.Holder()); |
| 214 RefPtrWillBeRawPtr<CSSValue> cssValue = impl->getPropertyCSSValueInternal(st
atic_cast<CSSPropertyID>(propInfo->propID)); | 208 RefPtrWillBeRawPtr<CSSValue> cssValue = impl->getPropertyCSSValueInternal(st
atic_cast<CSSPropertyID>(propInfo->propID)); |
| 215 if (cssValue) { | 209 if (cssValue) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 234 ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName
(static_cast<CSSPropertyID>(propInfo->propID)), "CSSStyleDeclaration", info.Hold
er(), info.GetIsolate()); | 228 ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName
(static_cast<CSSPropertyID>(propInfo->propID)), "CSSStyleDeclaration", info.Hold
er(), info.GetIsolate()); |
| 235 impl->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), prop
ertyValue, false, exceptionState); | 229 impl->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), prop
ertyValue, false, exceptionState); |
| 236 | 230 |
| 237 if (exceptionState.throwIfNeeded()) | 231 if (exceptionState.throwIfNeeded()) |
| 238 return; | 232 return; |
| 239 | 233 |
| 240 v8SetReturnValue(info, value); | 234 v8SetReturnValue(info, value); |
| 241 } | 235 } |
| 242 | 236 |
| 243 } // namespace blink | 237 } // namespace blink |
| OLD | NEW |