Diff
Modified: trunk/LayoutTests/ChangeLog (251526 => 251527)
--- trunk/LayoutTests/ChangeLog 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/ChangeLog 2019-10-24 03:42:59 UTC (rev 251527)
@@ -1,3 +1,20 @@
+2019-10-23 Said Abou-Hallawa <sabouhall...@apple.com>
+
+ [SVG2] Fix SVGSVGElement to conform with SVG2
+ https://bugs.webkit.org/show_bug.cgi?id=203278
+
+ Reviewed by Simon Fraser.
+
+ * svg/custom/immutable-properties-expected.txt:
+ * svg/custom/immutable-properties.html:
+ SVGSVGElement.viewport has to be removed.
+
+ * svg/custom/intersection-list-null-expected.txt: Removed.
+ * svg/custom/intersection-list-null.svg: Removed.
+ The specs state that the SVGElement argument to checkIntersection() and
+ checkEnclosure() is not optional. This test was testing the argument
+ optional case.
+
2019-10-23 Wenson Hsieh <wenson_hs...@apple.com>
[iOS 13] imported/mozilla/svg/text/textpath-selection.svg is flaky
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (251526 => 251527)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-10-24 03:42:59 UTC (rev 251527)
@@ -1,3 +1,14 @@
+2019-10-23 Said Abou-Hallawa <sabouhall...@apple.com>
+
+ [SVG2] Fix SVGSVGElement to conform with SVG2
+ https://bugs.webkit.org/show_bug.cgi?id=203278
+
+ Reviewed by Simon Fraser.
+
+ * web-platform-tests/svg/historical-expected.txt:
+ * web-platform-tests/svg/idlharness.window-expected.txt:
+ Some sub-tests are passing now with this change.
+
2019-10-23 Simon Fraser <simon.fra...@apple.com>
Import the css/css-values web platform tests
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/svg/historical-expected.txt (251526 => 251527)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/svg/historical-expected.txt 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/svg/historical-expected.txt 2019-10-24 03:42:59 UTC (rev 251527)
@@ -29,12 +29,12 @@
FAIL SVGGraphicsElement.prototype.hasExtension must be removed assert_false: expected false got true
FAIL SVGGraphicsElement.prototype.requiredFeatures must be removed assert_false: expected false got true
FAIL SVGSVGElement.prototype.currentView must be removed assert_false: expected false got true
-FAIL SVGSVGElement.prototype.pixelUnitToMillimeterX must be removed assert_false: expected false got true
-FAIL SVGSVGElement.prototype.pixelUnitToMillimeterY must be removed assert_false: expected false got true
-FAIL SVGSVGElement.prototype.screenPixelToMillimeterX must be removed assert_false: expected false got true
-FAIL SVGSVGElement.prototype.screenPixelToMillimeterY must be removed assert_false: expected false got true
+PASS SVGSVGElement.prototype.pixelUnitToMillimeterX must be removed
+PASS SVGSVGElement.prototype.pixelUnitToMillimeterY must be removed
+PASS SVGSVGElement.prototype.screenPixelToMillimeterX must be removed
+PASS SVGSVGElement.prototype.screenPixelToMillimeterY must be removed
FAIL SVGSVGElement.prototype.useCurrentView must be removed assert_false: expected false got true
-FAIL SVGSVGElement.prototype.viewport must be removed assert_false: expected false got true
+PASS SVGSVGElement.prototype.viewport must be removed
PASS SVGViewElement.prototype.viewTarget must be removed
PASS SVGPathElement.prototype.getPointAtLength must be moved to SVGGeometryElement.prototype
PASS SVGPathElement.prototype.getTotalLength must be moved to SVGGeometryElement.prototype
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/svg/idlharness.window-expected.txt (251526 => 251527)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/svg/idlharness.window-expected.txt 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/svg/idlharness.window-expected.txt 2019-10-24 03:42:59 UTC (rev 251527)
@@ -360,8 +360,8 @@
PASS SVGSVGElement interface: attribute height
PASS SVGSVGElement interface: attribute currentScale
PASS SVGSVGElement interface: attribute currentTranslate
-FAIL SVGSVGElement interface: operation getIntersectionList(DOMRectReadOnly, SVGElement) assert_equals: property has wrong .length expected 2 but got 1
-FAIL SVGSVGElement interface: operation getEnclosureList(DOMRectReadOnly, SVGElement) assert_equals: property has wrong .length expected 2 but got 1
+PASS SVGSVGElement interface: operation getIntersectionList(DOMRectReadOnly, SVGElement)
+PASS SVGSVGElement interface: operation getEnclosureList(DOMRectReadOnly, SVGElement)
PASS SVGSVGElement interface: operation checkIntersection(SVGElement, DOMRectReadOnly)
PASS SVGSVGElement interface: operation checkEnclosure(SVGElement, DOMRectReadOnly)
PASS SVGSVGElement interface: operation deselectAll()
Modified: trunk/LayoutTests/svg/custom/immutable-properties-expected.txt (251526 => 251527)
--- trunk/LayoutTests/svg/custom/immutable-properties-expected.txt 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/svg/custom/immutable-properties-expected.txt 2019-10-24 03:42:59 UTC (rev 251527)
@@ -3,9 +3,6 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS viewport.x is 0
-PASS viewport.x is 100
-PASS svgDoc.documentElement.viewport.x is 0
PASS zoomRectScreen.x is 0
PASS zoomRectScreen.x is 100
PASS zoomEvent.zoomRectScreen.x is 0
Modified: trunk/LayoutTests/svg/custom/immutable-properties.html (251526 => 251527)
--- trunk/LayoutTests/svg/custom/immutable-properties.html 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/svg/custom/immutable-properties.html 2019-10-24 03:42:59 UTC (rev 251527)
@@ -11,15 +11,6 @@
var svgDoc = document.implementation.createDocument("http://www.w3.org/2000/svg", "svg", null);
-// 'viewport' attribute is immutable (Spec: The object itself and its contents are both readonly.)
-var viewport = svgDoc.documentElement.viewport;
-
-shouldBe("viewport.x", "0");
-viewport.x = 100;
-
-shouldBe("viewport.x", "100");
-shouldBe("svgDoc.documentElement.viewport.x", "0");
-
// Every attribute of SVGZoomEvent is immutable (Spec: The object itself and its contents are both readonly.)
var zoomEvent = svgDoc.createEvent("SVGZoomEvents");
Deleted: trunk/LayoutTests/svg/custom/intersection-list-null-expected.txt (251526 => 251527)
--- trunk/LayoutTests/svg/custom/intersection-list-null-expected.txt 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/svg/custom/intersection-list-null-expected.txt 2019-10-24 03:42:59 UTC (rev 251527)
@@ -1 +0,0 @@
-PASS
Deleted: trunk/LayoutTests/svg/custom/intersection-list-null.svg (251526 => 251527)
--- trunk/LayoutTests/svg/custom/intersection-list-null.svg 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/LayoutTests/svg/custom/intersection-list-null.svg 2019-10-24 03:42:59 UTC (rev 251527)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg id="root" xmlns="http://www.w3.org/2000/svg" _onload_="runTest()">
- <script>
- function runTest() {
- if (window.testRunner)
- testRunner.dumpAsText();
- var root = document.documentElement;
- root.checkIntersection(null, root.createSVGRect());
- root.checkEnclosure(null, root.createSVGRect());
- }
- </script>
- <!-- This test passes if it does not crash. -->
- <text>PASS</text>
-</svg>
Modified: trunk/Source/WebCore/ChangeLog (251526 => 251527)
--- trunk/Source/WebCore/ChangeLog 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/Source/WebCore/ChangeLog 2019-10-24 03:42:59 UTC (rev 251527)
@@ -1,3 +1,38 @@
+2019-10-23 Said Abou-Hallawa <sabouhall...@apple.com>
+
+ [SVG2] Fix SVGSVGElement to conform with SVG2
+ https://bugs.webkit.org/show_bug.cgi?id=203278
+
+ Reviewed by Simon Fraser.
+
+ The interface of SVGSVGElement is defined here:
+ https://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement
+
+ -- Delete the viewport attribute.
+ -- Delete the attributes contentScriptType and contentStyleType.
+ -- Delete pixelUnitxxx() and screenPixelxxx() functions.
+ -- Make the SVGElement argument to checkIntersection() and
+ checkEnclosure() be non-optional.
+
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::checkIntersection):
+ (WebCore::SVGSVGElement::checkEnclosure):
+ (WebCore::SVGSVGElement::contentScriptType const): Deleted.
+ (WebCore::SVGSVGElement::setContentScriptType): Deleted.
+ (WebCore::SVGSVGElement::contentStyleType const): Deleted.
+ (WebCore::SVGSVGElement::setContentStyleType): Deleted.
+ (WebCore::SVGSVGElement::viewport const): Deleted.
+ (WebCore::SVGSVGElement::pixelUnitToMillimeterX const): Deleted.
+ (WebCore::SVGSVGElement::pixelUnitToMillimeterY const): Deleted.
+ (WebCore::SVGSVGElement::screenPixelToMillimeterX const): Deleted.
+ (WebCore::SVGSVGElement::screenPixelToMillimeterY const): Deleted.
+ (WebCore::SVGSVGElement::suspendRedraw): Deleted.
+ (WebCore::SVGSVGElement::unsuspendRedraw): Deleted.
+ (WebCore::SVGSVGElement::unsuspendRedrawAll): Deleted.
+ (WebCore::SVGSVGElement::forceRedraw): Deleted.
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl:
+
2019-10-23 Chris Dumez <cdu...@apple.com>
Unreviewed build fix after r251509.
Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (251526 => 251527)
--- trunk/Source/WebCore/svg/SVGSVGElement.cpp 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp 2019-10-24 03:42:59 UTC (rev 251527)
@@ -94,58 +94,6 @@
SVGGraphicsElement::didMoveToNewDocument(oldDocument, newDocument);
}
-const AtomString& SVGSVGElement::contentScriptType() const
-{
- static NeverDestroyed<AtomString> defaultScriptType { "text/ecmascript" };
- const AtomString& type = attributeWithoutSynchronization(SVGNames::contentScriptTypeAttr);
- return type.isNull() ? defaultScriptType.get() : type;
-}
-
-void SVGSVGElement::setContentScriptType(const AtomString& type)
-{
- setAttributeWithoutSynchronization(SVGNames::contentScriptTypeAttr, type);
-}
-
-const AtomString& SVGSVGElement::contentStyleType() const
-{
- static NeverDestroyed<AtomString> defaultStyleType { "text/css" };
- const AtomString& type = attributeWithoutSynchronization(SVGNames::contentStyleTypeAttr);
- return type.isNull() ? defaultStyleType.get() : type;
-}
-
-void SVGSVGElement::setContentStyleType(const AtomString& type)
-{
- setAttributeWithoutSynchronization(SVGNames::contentStyleTypeAttr, type);
-}
-
-Ref<SVGRect> SVGSVGElement::viewport() const
-{
- // FIXME: Not implemented.
- return SVGRect::create();
-}
-
-float SVGSVGElement::pixelUnitToMillimeterX() const
-{
- // There are 25.4 millimeters in an inch.
- return 25.4f / cssPixelsPerInch;
-}
-
-float SVGSVGElement::pixelUnitToMillimeterY() const
-{
- // There are 25.4 millimeters in an inch.
- return 25.4f / cssPixelsPerInch;
-}
-
-float SVGSVGElement::screenPixelToMillimeterX() const
-{
- return pixelUnitToMillimeterX();
-}
-
-float SVGSVGElement::screenPixelToMillimeterY() const
-{
- return pixelUnitToMillimeterY();
-}
-
SVGViewSpec& SVGSVGElement::currentView()
{
if (!m_viewSpec)
@@ -281,23 +229,6 @@
SVGGraphicsElement::svgAttributeChanged(attrName);
}
-unsigned SVGSVGElement::suspendRedraw(unsigned)
-{
- return 0;
-}
-
-void SVGSVGElement::unsuspendRedraw(unsigned)
-{
-}
-
-void SVGSVGElement::unsuspendRedrawAll()
-{
-}
-
-void SVGSVGElement::forceRedraw()
-{
-}
-
Ref<NodeList> SVGSVGElement::collectIntersectionOrEnclosureList(SVGRect& rect, SVGElement* referenceElement, bool (*checkFunction)(SVGElement&, SVGRect&))
{
Vector<Ref<Element>> elements;
@@ -330,20 +261,16 @@
return collectIntersectionOrEnclosureList(rect, referenceElement, checkEnclosureWithoutUpdatingLayout);
}
-bool SVGSVGElement::checkIntersection(RefPtr<SVGElement>&& element, SVGRect& rect)
+bool SVGSVGElement::checkIntersection(Ref<SVGElement>&& element, SVGRect& rect)
{
- if (!element)
- return false;
element->document().updateLayoutIgnorePendingStylesheets();
- return checkIntersectionWithoutUpdatingLayout(*element, rect);
+ return checkIntersectionWithoutUpdatingLayout(element, rect);
}
-bool SVGSVGElement::checkEnclosure(RefPtr<SVGElement>&& element, SVGRect& rect)
+bool SVGSVGElement::checkEnclosure(Ref<SVGElement>&& element, SVGRect& rect)
{
- if (!element)
- return false;
element->document().updateLayoutIgnorePendingStylesheets();
- return checkEnclosureWithoutUpdatingLayout(*element, rect);
+ return checkEnclosureWithoutUpdatingLayout(element, rect);
}
void SVGSVGElement::deselectAll()
Modified: trunk/Source/WebCore/svg/SVGSVGElement.h (251526 => 251527)
--- trunk/Source/WebCore/svg/SVGSVGElement.h 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/Source/WebCore/svg/SVGSVGElement.h 2019-10-24 03:42:59 UTC (rev 251527)
@@ -42,22 +42,6 @@
class SVGSVGElement final : public SVGGraphicsElement, public SVGFitToViewBox, public SVGZoomAndPan {
WTF_MAKE_ISO_ALLOCATED(SVGSVGElement);
public: // DOM
- const AtomString& contentScriptType() const;
- void setContentScriptType(const AtomString&);
-
- const AtomString& contentStyleType() const;
- void setContentStyleType(const AtomString&);
-
- Ref<SVGRect> viewport() const;
-
- float pixelUnitToMillimeterX() const;
- float pixelUnitToMillimeterY() const;
- float screenPixelToMillimeterX() const;
- float screenPixelToMillimeterY() const;
-
- bool useCurrentView() const { return m_useCurrentView; }
- SVGViewSpec& currentView();
-
float currentScale() const;
void setCurrentScale(float);
@@ -64,23 +48,14 @@
SVGPoint& currentTranslate() { return m_currentTranslate; }
FloatPoint currentTranslateValue() const { return m_currentTranslate->value(); }
- unsigned suspendRedraw(unsigned maxWaitMilliseconds);
- void unsuspendRedraw(unsigned suspendHandleId);
- void unsuspendRedrawAll();
- void forceRedraw();
+ bool useCurrentView() const { return m_useCurrentView; }
+ SVGViewSpec& currentView();
- void pauseAnimations();
- void unpauseAnimations();
- bool animationsPaused() const;
- bool hasActiveAnimation() const;
-
- float getCurrentTime() const;
- void setCurrentTime(float);
-
Ref<NodeList> getIntersectionList(SVGRect&, SVGElement* referenceElement);
Ref<NodeList> getEnclosureList(SVGRect&, SVGElement* referenceElement);
- static bool checkIntersection(RefPtr<SVGElement>&&, SVGRect&);
- static bool checkEnclosure(RefPtr<SVGElement>&&, SVGRect&);
+ static bool checkIntersection(Ref<SVGElement>&&, SVGRect&);
+ static bool checkEnclosure(Ref<SVGElement>&&, SVGRect&);
+
void deselectAll();
static Ref<SVGNumber> createSVGNumber();
@@ -94,6 +69,18 @@
Element* getElementById(const AtomString&);
+ void pauseAnimations();
+ void unpauseAnimations();
+ bool animationsPaused() const;
+ bool hasActiveAnimation() const;
+ float getCurrentTime() const;
+ void setCurrentTime(float);
+
+ unsigned suspendRedraw(unsigned) { return 0; }
+ void unsuspendRedraw(unsigned) { }
+ void unsuspendRedrawAll() { }
+ void forceRedraw() { }
+
public:
static Ref<SVGSVGElement> create(const QualifiedName&, Document&);
static Ref<SVGSVGElement> create(Document&);
Modified: trunk/Source/WebCore/svg/SVGSVGElement.idl (251526 => 251527)
--- trunk/Source/WebCore/svg/SVGSVGElement.idl 2019-10-24 03:25:35 UTC (rev 251526)
+++ trunk/Source/WebCore/svg/SVGSVGElement.idl 2019-10-24 03:42:59 UTC (rev 251527)
@@ -2,7 +2,7 @@
* Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmerm...@kde.org>
* Copyright (C) 2004, 2005, 2010 Rob Buis <b...@kde.org>
* Copyright (C) 2006 Samuel Weinig <sam.wei...@gmail.com>
- * Copyright (C) 2006 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2019 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -28,41 +28,22 @@
JSGenerateToNativeObject,
ExportMacro=WEBCORE_EXPORT,
] interface SVGSVGElement : SVGGraphicsElement {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
- attribute DOMString contentScriptType;
- attribute DOMString contentStyleType;
- [NewObject] readonly attribute SVGRect viewport;
- readonly attribute unrestricted float pixelUnitToMillimeterX;
- readonly attribute unrestricted float pixelUnitToMillimeterY;
- readonly attribute unrestricted float screenPixelToMillimeterX;
- readonly attribute unrestricted float screenPixelToMillimeterY;
+ [SameObject] readonly attribute SVGAnimatedLength x;
+ [SameObject] readonly attribute SVGAnimatedLength y;
+ [SameObject] readonly attribute SVGAnimatedLength width;
+ [SameObject] readonly attribute SVGAnimatedLength height;
+
+ attribute unrestricted float currentScale;
+ [SameObject] readonly attribute SVGPoint currentTranslate;
+
readonly attribute boolean useCurrentView;
readonly attribute SVGViewSpec currentView;
- attribute unrestricted float currentScale;
- readonly attribute SVGPoint currentTranslate;
- unsigned long suspendRedraw(optional unsigned long maxWaitMilliseconds = 0);
- void unsuspendRedraw(optional unsigned long suspendHandleId = 0);
- void unsuspendRedrawAll();
- void forceRedraw();
- void pauseAnimations();
- void unpauseAnimations();
- boolean animationsPaused();
- unrestricted float getCurrentTime();
- void setCurrentTime(optional unrestricted float seconds = NaN);
+ NodeList getIntersectionList(SVGRect rect, SVGElement? referenceElement);
+ NodeList getEnclosureList(SVGRect rect, SVGElement? referenceElement);
+ boolean checkIntersection(SVGElement element, SVGRect rect);
+ boolean checkEnclosure(SVGElement element, SVGRect rect);
- // FIXME: referenceElement should not be optional.
- NodeList getIntersectionList(SVGRect rect, optional SVGElement? referenceElement = null);
-
- // FIXME: referenceElement should not be optional.
- NodeList getEnclosureList(SVGRect rect, optional SVGElement? referenceElement = null);
-
- boolean checkIntersection(SVGElement? element, SVGRect rect); // element should not be nullable.
- boolean checkEnclosure(SVGElement? element, SVGRect rect); // element should not be nullable.
-
void deselectAll();
[NewObject] SVGNumber createSVGNumber();
@@ -75,6 +56,20 @@
[NewObject] SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInit matrix);
Element getElementById([RequiresExistingAtomString] DOMString elementId);
+
+ // SVG animations extensions
+ // https://svgwg.org/specs/animations/#InterfaceSVGSVGElement
+ void pauseAnimations();
+ void unpauseAnimations();
+ boolean animationsPaused();
+ unrestricted float getCurrentTime();
+ void setCurrentTime(optional unrestricted float seconds = NaN);
+
+ // Deprecated SVG redrawing
+ unsigned long suspendRedraw(optional unsigned long maxWaitMilliseconds = 0);
+ void unsuspendRedraw(optional unsigned long suspendHandleId = 0);
+ void unsuspendRedrawAll();
+ void forceRedraw();
};
SVGSVGElement implements SVGFitToViewBox;