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 20 matching lines...) Expand all Loading... |
31 #include "bindings/core/v8/V8CSSStyleDeclaration.h" | 31 #include "bindings/core/v8/V8CSSStyleDeclaration.h" |
32 | 32 |
33 #include "bindings/core/v8/ExceptionState.h" | 33 #include "bindings/core/v8/ExceptionState.h" |
34 #include "bindings/core/v8/V8Binding.h" | 34 #include "bindings/core/v8/V8Binding.h" |
35 #include "core/CSSPropertyNames.h" | 35 #include "core/CSSPropertyNames.h" |
36 #include "core/css/CSSPrimitiveValue.h" | 36 #include "core/css/CSSPrimitiveValue.h" |
37 #include "core/css/CSSPropertyMetadata.h" | 37 #include "core/css/CSSPropertyMetadata.h" |
38 #include "core/css/CSSStyleDeclaration.h" | 38 #include "core/css/CSSStyleDeclaration.h" |
39 #include "core/css/CSSValue.h" | 39 #include "core/css/CSSValue.h" |
40 #include "core/css/parser/CSSParser.h" | 40 #include "core/css/parser/CSSParser.h" |
| 41 #include "core/dom/custom/CEReactionsScope.h" |
41 #include "core/events/EventTarget.h" | 42 #include "core/events/EventTarget.h" |
42 #include "wtf/ASCIICType.h" | 43 #include "wtf/ASCIICType.h" |
43 #include "wtf/PassRefPtr.h" | 44 #include "wtf/PassRefPtr.h" |
44 #include "wtf/RefPtr.h" | 45 #include "wtf/RefPtr.h" |
45 #include "wtf/StdLibExtras.h" | 46 #include "wtf/StdLibExtras.h" |
46 #include "wtf/Vector.h" | 47 #include "wtf/Vector.h" |
47 #include "wtf/text/StringBuilder.h" | 48 #include "wtf/text/StringBuilder.h" |
48 #include "wtf/text/StringConcatenate.h" | 49 #include "wtf/text/StringConcatenate.h" |
49 #include <algorithm> | 50 #include <algorithm> |
50 | 51 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 v8SetReturnValueString(info, result, info.GetIsolate()); | 206 v8SetReturnValueString(info, result, info.GetIsolate()); |
206 } | 207 } |
207 | 208 |
208 void V8CSSStyleDeclaration::namedPropertySetterCustom(v8::Local<v8::Name> name,
v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) | 209 void V8CSSStyleDeclaration::namedPropertySetterCustom(v8::Local<v8::Name> name,
v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) |
209 { | 210 { |
210 CSSStyleDeclaration* impl = V8CSSStyleDeclaration::toImpl(info.Holder()); | 211 CSSStyleDeclaration* impl = V8CSSStyleDeclaration::toImpl(info.Holder()); |
211 CSSPropertyID unresolvedProperty = cssPropertyInfo(name.As<v8::String>()); | 212 CSSPropertyID unresolvedProperty = cssPropertyInfo(name.As<v8::String>()); |
212 if (!unresolvedProperty) | 213 if (!unresolvedProperty) |
213 return; | 214 return; |
214 | 215 |
| 216 CEReactionsScope ceReactionsScope; |
| 217 |
215 TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, propertyValue, value)
; | 218 TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, propertyValue, value)
; |
216 ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName
(resolveCSSPropertyID(unresolvedProperty)), "CSSStyleDeclaration", info.Holder()
, info.GetIsolate()); | 219 ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName
(resolveCSSPropertyID(unresolvedProperty)), "CSSStyleDeclaration", info.Holder()
, info.GetIsolate()); |
217 // TODO(leviw): This API doesn't support custom properties. | 220 // TODO(leviw): This API doesn't support custom properties. |
218 impl->setPropertyInternal(unresolvedProperty, String(), propertyValue, false
, exceptionState); | 221 impl->setPropertyInternal(unresolvedProperty, String(), propertyValue, false
, exceptionState); |
219 | 222 |
220 if (exceptionState.throwIfNeeded()) | 223 if (exceptionState.throwIfNeeded()) |
221 return; | 224 return; |
222 | 225 |
223 v8SetReturnValue(info, value); | 226 v8SetReturnValue(info, value); |
224 } | 227 } |
225 | 228 |
226 } // namespace blink | 229 } // namespace blink |
OLD | NEW |