Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1845)

Unified Diff: third_party/WebKit/Source/core/geometry/DOMMatrix.cpp

Issue 2868953002: Stop accepting string constructor of DOMMatrix on workers (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698