Chromium Code Reviews| Index: third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp |
| diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp |
| index 1f33dae2b993faefe2992108a8c4627844348b23..b02d0ea228d68db2a96bdf949d3888f75557d804 100644 |
| --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp |
| +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp |
| @@ -89,6 +89,16 @@ void PaintWorkletGlobalScope::registerPaint(const String& name, const ScriptValu |
| } |
| } |
| + // Parse 'alpha' AKA hasAlphaChannel property. |
| + v8::Local<v8::Value> alphaValue; |
| + if (!v8Call(constructor->Get(context, v8String(isolate, "alpha")), alphaValue)) |
| + return; |
| + if (!isUndefinedOrNull(alphaValue) && !alphaValue->IsBoolean()) { |
| + exceptionState.throwTypeError("The 'alpha' property on the class is not a boolean."); |
| + return; |
| + } |
| + bool hasAlphaChannel = alphaValue->IsBoolean() && v8::Local<v8::Boolean>::Cast(alphaValue)->Value(); |
|
haraken
2016/06/22 00:59:47
Drive-by: 'alphaValue->IsBoolean() &&' won't be ne
Gleb Lanbin
2016/06/22 04:27:46
Done. thanks.
|
| + |
| v8::Local<v8::Value> prototypeValue; |
| if (!v8Call(constructor->Get(context, v8String(isolate, "prototype")), prototypeValue)) |
| return; |
| @@ -121,7 +131,7 @@ void PaintWorkletGlobalScope::registerPaint(const String& name, const ScriptValu |
| v8::Local<v8::Function> paint = v8::Local<v8::Function>::Cast(paintValue); |
| - CSSPaintDefinition* definition = CSSPaintDefinition::create(scriptController()->getScriptState(), constructor, paint, nativeInvalidationProperties, customInvalidationProperties); |
| + CSSPaintDefinition* definition = CSSPaintDefinition::create(scriptController()->getScriptState(), constructor, paint, nativeInvalidationProperties, customInvalidationProperties, hasAlphaChannel); |
| m_paintDefinitions.set(name, definition); |
| // Set the definition on any pending generators. |