Chromium Code Reviews| Index: third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
| diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
| index 876729c9d273ea17eb17a8eaa8c750d523d9b25e..97e587e9009c2c9df8eb377df6dcf85d161deb14 100644 |
| --- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
| +++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
| @@ -92,14 +92,23 @@ bool DOMMatrixReadOnly::ValidateAndFixup(DOMMatrixInit& other, |
| return true; |
| } |
| -DOMMatrixReadOnly* DOMMatrixReadOnly::Create(ExceptionState& exception_state) { |
| +DOMMatrixReadOnly* DOMMatrixReadOnly::Create( |
| + ExecutionContext* execution_context, |
| + ExceptionState& exception_state) { |
| return new DOMMatrixReadOnly(TransformationMatrix()); |
| } |
| DOMMatrixReadOnly* DOMMatrixReadOnly::Create( |
| + ExecutionContext* execution_context, |
| StringOrUnrestrictedDoubleSequence& init, |
| ExceptionState& exception_state) { |
| if (init.isString()) { |
| + if (execution_context->IsWorkerOrWorkletGlobalScope()) { |
|
Justin Novosad
2017/05/09 15:28:19
The spec says to throw if the global object is not
fserb
2017/05/11 19:13:55
foolip got that! :)
|
| + exception_state.ThrowTypeError( |
| + "String constructor can't be used on workers."); |
|
Justin Novosad
2017/05/09 15:29:07
This message is unclear. Are we constructing a St
fserb
2017/05/11 19:13:55
changed.
|
| + return nullptr; |
| + } |
| + |
| DOMMatrixReadOnly* matrix = new DOMMatrixReadOnly(TransformationMatrix()); |
| matrix->SetMatrixValueFromString(init.getAsString(), exception_state); |
| return matrix; |