Diff
Modified: trunk/LayoutTests/ChangeLog (251426 => 251427)
--- trunk/LayoutTests/ChangeLog 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/LayoutTests/ChangeLog 2019-10-22 09:43:49 UTC (rev 251427)
@@ -1,3 +1,18 @@
+2019-10-22 Dirk Schulze <k...@webkit.org>
+
+ SVG2: Use DOMMatrix2DInit for setMatrix and createSVGTransformFromMatrix
+ https://bugs.webkit.org/show_bug.cgi?id=191417
+
+ Reviewed by Dean Jackson.
+
+ Extended existing tests to cover change to new argument
+ DOMMatrix2DInit.
+
+ * svg/dom/SVGTransform-expected.txt:
+ * svg/dom/SVGTransform.html:
+ * svg/dom/SVGTransformList-expected.txt:
+ * svg/dom/SVGTransformList.html:
+
2019-10-21 Simon Fraser <simon.fra...@apple.com>
Multiple fast/scrolling/ios tests failing with unexpected scrollbars appearing in result
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/svg/idlharness.window-expected.txt (251426 => 251427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/svg/idlharness.window-expected.txt 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/svg/idlharness.window-expected.txt 2019-10-22 09:43:49 UTC (rev 251427)
@@ -372,7 +372,7 @@
PASS SVGSVGElement interface: operation createSVGMatrix()
PASS SVGSVGElement interface: operation createSVGRect()
PASS SVGSVGElement interface: operation createSVGTransform()
-FAIL SVGSVGElement interface: operation createSVGTransformFromMatrix(DOMMatrix2DInit) assert_equals: property has wrong .length expected 0 but got 1
+PASS SVGSVGElement interface: operation createSVGTransformFromMatrix(DOMMatrix2DInit)
PASS SVGSVGElement interface: operation getElementById(DOMString)
FAIL SVGSVGElement interface: operation suspendRedraw(unsigned long) assert_equals: property has wrong .length expected 1 but got 0
FAIL SVGSVGElement interface: operation unsuspendRedraw(unsigned long) assert_equals: property has wrong .length expected 1 but got 0
@@ -648,7 +648,7 @@
PASS SVGTransform interface: attribute type
PASS SVGTransform interface: attribute matrix
PASS SVGTransform interface: attribute angle
-FAIL SVGTransform interface: operation setMatrix(DOMMatrix2DInit) assert_equals: property has wrong .length expected 0 but got 1
+PASS SVGTransform interface: operation setMatrix(DOMMatrix2DInit)
PASS SVGTransform interface: operation setTranslate(float, float)
PASS SVGTransform interface: operation setScale(float, float)
PASS SVGTransform interface: operation setRotate(float, float, float)
@@ -693,7 +693,7 @@
PASS SVGTransformList interface: operation replaceItem(SVGTransform, unsigned long)
PASS SVGTransformList interface: operation removeItem(unsigned long)
PASS SVGTransformList interface: operation appendItem(SVGTransform)
-FAIL SVGTransformList interface: operation createSVGTransformFromMatrix(DOMMatrix2DInit) assert_equals: property has wrong .length expected 0 but got 1
+PASS SVGTransformList interface: operation createSVGTransformFromMatrix(DOMMatrix2DInit)
PASS SVGTransformList interface: operation consolidate()
PASS SVGTransformList must be primary interface of objects.pattern.patternTransform.baseVal
PASS Stringification of objects.pattern.patternTransform.baseVal
Modified: trunk/LayoutTests/svg/dom/SVGTransform-expected.txt (251426 => 251427)
--- trunk/LayoutTests/svg/dom/SVGTransform-expected.txt 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/LayoutTests/svg/dom/SVGTransform-expected.txt 2019-10-22 09:43:49 UTC (rev 251427)
@@ -49,12 +49,26 @@
PASS transform.matrix.f is 0
Check passing invalid arguments to 'setMatrix'
-PASS transform.setMatrix() threw exception TypeError: Not enough arguments.
-PASS transform.setMatrix(transform) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
-PASS transform.setMatrix(svgElement) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
-PASS transform.setMatrix('aString') threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
-PASS transform.setMatrix(1) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
-PASS transform.setMatrix(false) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
+PASS transform.setMatrix('aString') threw exception TypeError: Type error.
+PASS transform.setMatrix(1) threw exception TypeError: Type error.
+PASS transform.setMatrix(false) threw exception TypeError: Type error.
+Check passing abritary objects, nothing or dictionaries
+PASS transform.setMatrix(transform) is undefined.
+PASS transform.setMatrix(svgElement) is undefined.
+PASS transform.setMatrix({a: 2, b: 0, c: 0, d: 2, e: 10, f: 10}) is undefined.
+PASS transform.matrix.a is 2
+PASS transform.matrix.b is 0
+PASS transform.matrix.c is 0
+PASS transform.matrix.d is 2
+PASS transform.matrix.e is 10
+PASS transform.matrix.f is 10
+PASS transform.setMatrix() is undefined.
+PASS transform.matrix.a is 1
+PASS transform.matrix.b is 0
+PASS transform.matrix.c is 0
+PASS transform.matrix.d is 1
+PASS transform.matrix.e is 0
+PASS transform.matrix.f is 0
Check passing invalid arguments to 'setTranslate'
PASS transform.setTranslate() threw exception TypeError: Not enough arguments.
Modified: trunk/LayoutTests/svg/dom/SVGTransform.html (251426 => 251427)
--- trunk/LayoutTests/svg/dom/SVGTransform.html 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/LayoutTests/svg/dom/SVGTransform.html 2019-10-22 09:43:49 UTC (rev 251427)
@@ -62,12 +62,26 @@
debug("");
debug("Check passing invalid arguments to 'setMatrix'");
-shouldThrow("transform.setMatrix()");
-shouldThrow("transform.setMatrix(transform)");
-shouldThrow("transform.setMatrix(svgElement)");
shouldThrow("transform.setMatrix('aString')");
shouldThrow("transform.setMatrix(1)");
shouldThrow("transform.setMatrix(false)");
+debug("Check passing abritary objects, nothing or dictionaries");
+shouldBeUndefined("transform.setMatrix(transform)");
+shouldBeUndefined("transform.setMatrix(svgElement)");
+shouldBeUndefined("transform.setMatrix({a: 2, b: 0, c: 0, d: 2, e: 10, f: 10})");
+shouldBe("transform.matrix.a", "2");
+shouldBe("transform.matrix.b", "0");
+shouldBe("transform.matrix.c", "0");
+shouldBe("transform.matrix.d", "2");
+shouldBe("transform.matrix.e", "10");
+shouldBe("transform.matrix.f", "10");
+shouldBeUndefined("transform.setMatrix()");
+shouldBe("transform.matrix.a", "1");
+shouldBe("transform.matrix.b", "0");
+shouldBe("transform.matrix.c", "0");
+shouldBe("transform.matrix.d", "1");
+shouldBe("transform.matrix.e", "0");
+shouldBe("transform.matrix.f", "0");
debug("");
debug("Check passing invalid arguments to 'setTranslate'");
Modified: trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt (251426 => 251427)
--- trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt 2019-10-22 09:43:49 UTC (rev 251427)
@@ -5,14 +5,33 @@
Check passing invalid arguments to 'createSVGTransformFromMatrix'
-PASS transform.createSVGTransformFromMatrix() threw exception TypeError: Not enough arguments.
-PASS transform.createSVGTransformFromMatrix(svgElement.createSVGTransform()) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
-PASS transform.createSVGTransformFromMatrix(svgElement) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
-PASS transform.createSVGTransformFromMatrix('aString') threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
-PASS transform.createSVGTransformFromMatrix(1) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
-PASS transform.createSVGTransformFromMatrix(true) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
-PASS transform.createSVGTransformFromMatrix(undefined) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
-PASS transform.createSVGTransformFromMatrix(null) threw exception TypeError: Argument 1 ('matrix') to SVGTransformList.createSVGTransformFromMatrix must be an instance of SVGMatrix.
+PASS transform.createSVGTransformFromMatrix('aString') threw exception TypeError: Type error.
+PASS transform.createSVGTransformFromMatrix(1) threw exception TypeError: Type error.
+PASS transform.createSVGTransformFromMatrix(true) threw exception TypeError: Type error.
+Check passing valid arguments to 'createSVGTransformFromMatrix'
+PASS transform.createSVGTransformFromMatrix(null) did not throw exception.
+PASS transform.createSVGTransformFromMatrix(svgElement.createSVGTransform()) did not throw exception.
+PASS transform.createSVGTransformFromMatrix(svgElement) did not throw exception.
+PASS transform.createSVGTransformFromMatrix(undefined) did not throw exception.
+PASS transform.createSVGTransformFromMatrix() did not throw exception.
+PASS t.matrix.a is 2
+PASS t.matrix.b is 0
+PASS t.matrix.c is 0
+PASS t.matrix.d is 3
+PASS t.matrix.e is 10
+PASS t.matrix.f is 20
+PASS t.matrix.a is 3
+PASS t.matrix.b is 0
+PASS t.matrix.c is 0
+PASS t.matrix.d is 4
+PASS t.matrix.e is 0
+PASS t.matrix.f is 0
+PASS t.matrix.a is 1
+PASS t.matrix.b is 0
+PASS t.matrix.c is 0
+PASS t.matrix.d is 1
+PASS t.matrix.e is 0
+PASS t.matrix.f is 0
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/svg/dom/SVGTransformList.html (251426 => 251427)
--- trunk/LayoutTests/svg/dom/SVGTransformList.html 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/LayoutTests/svg/dom/SVGTransformList.html 2019-10-22 09:43:49 UTC (rev 251427)
@@ -15,14 +15,36 @@
debug("");
debug("Check passing invalid arguments to 'createSVGTransformFromMatrix'");
-shouldThrow("transform.createSVGTransformFromMatrix()");
-shouldThrow("transform.createSVGTransformFromMatrix(svgElement.createSVGTransform())");
-shouldThrow("transform.createSVGTransformFromMatrix(svgElement)");
shouldThrow("transform.createSVGTransformFromMatrix('aString')");
shouldThrow("transform.createSVGTransformFromMatrix(1)");
shouldThrow("transform.createSVGTransformFromMatrix(true)");
-shouldThrow("transform.createSVGTransformFromMatrix(undefined)");
-shouldThrow("transform.createSVGTransformFromMatrix(null)");
+debug("Check passing valid arguments to 'createSVGTransformFromMatrix'");
+shouldNotThrow("transform.createSVGTransformFromMatrix(null)");
+shouldNotThrow("transform.createSVGTransformFromMatrix(svgElement.createSVGTransform())");
+shouldNotThrow("transform.createSVGTransformFromMatrix(svgElement)");
+shouldNotThrow("transform.createSVGTransformFromMatrix(undefined)");
+shouldNotThrow("transform.createSVGTransformFromMatrix()");
+var t = transform.createSVGTransformFromMatrix({a: 2, d: 3, e: 10, f: 20});
+shouldBe("t.matrix.a", "2");
+shouldBe("t.matrix.b", "0");
+shouldBe("t.matrix.c", "0");
+shouldBe("t.matrix.d", "3");
+shouldBe("t.matrix.e", "10");
+shouldBe("t.matrix.f", "20");
+t = transform.createSVGTransformFromMatrix(svgElement.createSVGMatrix().scaleNonUniform(3, 4));
+shouldBe("t.matrix.a", "3");
+shouldBe("t.matrix.b", "0");
+shouldBe("t.matrix.c", "0");
+shouldBe("t.matrix.d", "4");
+shouldBe("t.matrix.e", "0");
+shouldBe("t.matrix.f", "0");
+t = transform.createSVGTransformFromMatrix();
+shouldBe("t.matrix.a", "1");
+shouldBe("t.matrix.b", "0");
+shouldBe("t.matrix.c", "0");
+shouldBe("t.matrix.d", "1");
+shouldBe("t.matrix.e", "0");
+shouldBe("t.matrix.f", "0");
successfullyParsed = true;
</script>
Modified: trunk/Source/WebCore/ChangeLog (251426 => 251427)
--- trunk/Source/WebCore/ChangeLog 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/ChangeLog 2019-10-22 09:43:49 UTC (rev 251427)
@@ -1,3 +1,29 @@
+2019-10-22 Dirk Schulze <k...@webkit.org>
+
+ SVG2: Use DOMMatrix2DInit for setMatrix and createSVGTransformFromMatrix
+ https://bugs.webkit.org/show_bug.cgi?id=191417
+
+ Reviewed by Dean Jackson.
+
+ setMatrix and createSVGTransformFromMatrix used to use SVGMatrix as argument.
+ With SVG 2.0, any DOMPoint2DInit type is supported which inlcudes dictionaries,
+ DOMMatrix, DOMMatrixReadOnly and SVGMatrix (alias of DOMMatrix).
+
+ Extended existing tests.
+
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl:
+ * svg/SVGTransform.h:
+ (WebCore::SVGTransform::setMatrix):
+ * svg/SVGTransform.idl:
+ * svg/SVGTransformList.h:
+ * svg/SVGTransformList.idl:
+ * svg/SVGTransformListValues.cpp:
+ (WebCore::SVGTransformListValues::createSVGTransformFromMatrix const):
+ * svg/SVGTransformListValues.h:
+
2019-10-21 Yusuke Suzuki <ysuz...@apple.com>
[JSC] Thread JSGlobalObject* instead of ExecState*
Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (251426 => 251427)
--- trunk/Source/WebCore/svg/SVGSVGElement.cpp 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp 2019-10-22 09:43:49 UTC (rev 251427)
@@ -24,6 +24,7 @@
#include "SVGSVGElement.h"
#include "CSSHelper.h"
+#include "DOMMatrix2DInit.h"
#include "DOMWrapperWorld.h"
#include "ElementIterator.h"
#include "EventNames.h"
@@ -386,9 +387,22 @@
return SVGTransform::create(SVGTransformValue::SVG_TRANSFORM_MATRIX);
}
-Ref<SVGTransform> SVGSVGElement::createSVGTransformFromMatrix(SVGMatrix& matrix)
+Ref<SVGTransform> SVGSVGElement::createSVGTransformFromMatrix(DOMMatrix2DInit&& matrixInit)
{
- return SVGTransform::create(matrix.value());
+ AffineTransform transform;
+ if (matrixInit.a.hasValue())
+ transform.setA(matrixInit.a.value());
+ if (matrixInit.b.hasValue())
+ transform.setB(matrixInit.b.value());
+ if (matrixInit.c.hasValue())
+ transform.setC(matrixInit.c.value());
+ if (matrixInit.d.hasValue())
+ transform.setD(matrixInit.d.value());
+ if (matrixInit.e.hasValue())
+ transform.setE(matrixInit.e.value());
+ if (matrixInit.f.hasValue())
+ transform.setF(matrixInit.f.value());
+ return SVGTransform::create(transform);
}
AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const
Modified: trunk/Source/WebCore/svg/SVGSVGElement.h (251426 => 251427)
--- trunk/Source/WebCore/svg/SVGSVGElement.h 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/svg/SVGSVGElement.h 2019-10-22 09:43:49 UTC (rev 251427)
@@ -28,6 +28,7 @@
namespace WebCore {
+struct DOMMatrix2DInit;
class SMILTimeContainer;
class SVGAngle;
class SVGLength;
@@ -89,7 +90,7 @@
static Ref<SVGMatrix> createSVGMatrix();
static Ref<SVGRect> createSVGRect();
static Ref<SVGTransform> createSVGTransform();
- static Ref<SVGTransform> createSVGTransformFromMatrix(SVGMatrix&);
+ static Ref<SVGTransform> createSVGTransformFromMatrix(DOMMatrix2DInit&&);
Element* getElementById(const AtomString&);
Modified: trunk/Source/WebCore/svg/SVGSVGElement.idl (251426 => 251427)
--- trunk/Source/WebCore/svg/SVGSVGElement.idl 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/svg/SVGSVGElement.idl 2019-10-22 09:43:49 UTC (rev 251427)
@@ -72,7 +72,7 @@
[NewObject] SVGMatrix createSVGMatrix();
[NewObject] SVGRect createSVGRect();
[NewObject] SVGTransform createSVGTransform();
- [NewObject] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
+ [NewObject] SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInit matrix);
Element getElementById([RequiresExistingAtomString] DOMString elementId);
};
Modified: trunk/Source/WebCore/svg/SVGTransform.h (251426 => 251427)
--- trunk/Source/WebCore/svg/SVGTransform.h 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/svg/SVGTransform.h 2019-10-22 09:43:49 UTC (rev 251427)
@@ -25,6 +25,7 @@
#pragma once
+#include "DOMMatrix2DInit.h"
#include "SVGMatrix.h"
#include "SVGTransformValue.h"
#include "SVGValueProperty.h"
@@ -70,12 +71,25 @@
float angle() { return m_value.angle(); }
const Ref<SVGMatrix>& matrix() { return m_value.matrix(); }
- ExceptionOr<void> setMatrix(SVGMatrix& matrix)
+ ExceptionOr<void> setMatrix(DOMMatrix2DInit&& matrixInit)
{
if (isReadOnly())
return Exception { NoModificationAllowedError };
- m_value.setMatrix(matrix.value());
+ AffineTransform transform;
+ if (matrixInit.a.hasValue())
+ transform.setA(matrixInit.a.value());
+ if (matrixInit.b.hasValue())
+ transform.setB(matrixInit.b.value());
+ if (matrixInit.c.hasValue())
+ transform.setC(matrixInit.c.value());
+ if (matrixInit.d.hasValue())
+ transform.setD(matrixInit.d.value());
+ if (matrixInit.e.hasValue())
+ transform.setE(matrixInit.e.value());
+ if (matrixInit.f.hasValue())
+ transform.setF(matrixInit.f.value());
+ m_value.setMatrix(transform);
commitChange();
return { };
}
Modified: trunk/Source/WebCore/svg/SVGTransform.idl (251426 => 251427)
--- trunk/Source/WebCore/svg/SVGTransform.idl 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/svg/SVGTransform.idl 2019-10-22 09:43:49 UTC (rev 251427)
@@ -35,7 +35,7 @@
readonly attribute SVGMatrix matrix;
readonly attribute unrestricted float angle;
- [MayThrowException] void setMatrix(SVGMatrix matrix);
+ [MayThrowException] void setMatrix(optional DOMMatrix2DInit matrix);
[MayThrowException] void setTranslate(unrestricted float tx, unrestricted float ty);
[MayThrowException] void setScale(unrestricted float sx, unrestricted float sy);
[MayThrowException] void setRotate(unrestricted float angle, unrestricted float cx, unrestricted float cy);
Modified: trunk/Source/WebCore/svg/SVGTransformList.h (251426 => 251427)
--- trunk/Source/WebCore/svg/SVGTransformList.h 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/svg/SVGTransformList.h 2019-10-22 09:43:49 UTC (rev 251427)
@@ -21,6 +21,7 @@
#pragma once
+#include "DOMMatrix2DInit.h"
#include "SVGTransform.h"
#include "SVGTransformable.h"
#include "SVGValuePropertyList.h"
@@ -48,9 +49,11 @@
return adoptRef(*new SVGTransformList(other, access));
}
- ExceptionOr<Ref<SVGTransform>> createSVGTransformFromMatrix(const Ref<SVGMatrix>& matrix)
+ ExceptionOr<Ref<SVGTransform>> createSVGTransformFromMatrix(DOMMatrix2DInit&& matrixInit)
{
- return SVGTransform::create(matrix->value());
+ auto svgTransform = SVGTransform::create();
+ svgTransform->setMatrix(WTFMove(matrixInit));
+ return svgTransform;
}
ExceptionOr<RefPtr<SVGTransform>> consolidate()
Modified: trunk/Source/WebCore/svg/SVGTransformList.idl (251426 => 251427)
--- trunk/Source/WebCore/svg/SVGTransformList.idl 2019-10-22 09:29:22 UTC (rev 251426)
+++ trunk/Source/WebCore/svg/SVGTransformList.idl 2019-10-22 09:43:49 UTC (rev 251427)
@@ -37,6 +37,6 @@
[MayThrowException] SVGTransform appendItem(SVGTransform newItem);
[MayThrowException] setter void (unsigned long index, SVGTransform newItem);
- [MayThrowException, NewObject] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
+ [MayThrowException, NewObject] SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInit matrix);
[MayThrowException] SVGTransform consolidate();
};