Chromium Code Reviews| Index: third_party/WebKit/Source/core/geometry/DOMMatrix.cpp |
| diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp |
| index b87df838606e3c2599dc4e4769fcdb35e2ca82b0..cb27e0a711838f0c669267a7cefd93135d9e0318 100644 |
| --- a/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp |
| +++ b/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp |
| @@ -6,13 +6,21 @@ |
| namespace blink { |
| -DOMMatrix* DOMMatrix::Create(ExceptionState& exception_state) { |
| +DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context, |
| + ExceptionState& exception_state) { |
| return new DOMMatrix(TransformationMatrix()); |
| } |
| -DOMMatrix* DOMMatrix::Create(StringOrUnrestrictedDoubleSequence& init, |
| +DOMMatrix* DOMMatrix::Create(ExecutionContext* execution_context, |
| + StringOrUnrestrictedDoubleSequence& init, |
| ExceptionState& exception_state) { |
| if (init.isString()) { |
| + if (execution_context->IsWorkerOrWorkletGlobalScope()) { |
|
foolip
2017/05/11 18:59:47
To stay pedantically close to the spec and leave n
fserb
2017/05/11 19:13:55
yes! That's the thing we were not sure. Thanks :)
|
| + exception_state.ThrowTypeError( |
| + "String constructor can't be used on workers."); |
| + return nullptr; |
| + } |
| + |
| DOMMatrix* matrix = new DOMMatrix(TransformationMatrix()); |
| matrix->SetMatrixValueFromString(init.getAsString(), exception_state); |
| return matrix; |