WebKit Bugzilla
Attachment 373525 Details for
Bug 199526
: [SVG2]: Add length, item getter and item setter to all SVG lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199526-20190705124502.patch (text/plain), 16.49 KB, created by
Said Abou-Hallawa
on 2019-07-05 12:45:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2019-07-05 12:45:03 PDT
Size:
16.49 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 247168) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,26 @@ >+2019-07-05 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ SVG2: Add length, item getter and item setter to all SVG lists >+ https://bugs.webkit.org/show_bug.cgi?id=199526 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implement the SVG2 specs for SVG lists: >+ https://svgwg.org/svg2-draft/types.html#TermListInterface. >+ >+ Test: svg/dom/SVGList-SVG2.xhtml >+ >+ * svg/SVGLengthList.idl: >+ * svg/SVGNumberList.idl: >+ * svg/SVGPathSegList.h: >+ * svg/SVGPathSegList.idl: >+ * svg/SVGPointList.idl: >+ * svg/SVGStringList.idl: >+ * svg/SVGTransformList.idl: >+ * svg/properties/SVGList.h: >+ (WebCore::SVGList::length const): >+ (WebCore::SVGList::setItem): >+ > 2019-07-05 Youenn Fablet <youenn@apple.com> > > [iOS] Local capture MediaStreamTrack does not render in portrait mode >Index: Source/WebCore/svg/SVGLengthList.idl >=================================================================== >--- Source/WebCore/svg/SVGLengthList.idl (revision 247157) >+++ Source/WebCore/svg/SVGLengthList.idl (working copy) >@@ -27,13 +27,15 @@ > [ > SkipVTableValidation > ] interface SVGLengthList { >+ readonly attribute unsigned long length; > readonly attribute unsigned long numberOfItems; > > [MayThrowException] void clear(); >- [MayThrowException] SVGLength initialize(SVGLength item); >- [MayThrowException] SVGLength getItem(unsigned long index); >- [MayThrowException] SVGLength insertItemBefore(SVGLength item, unsigned long index); >- [MayThrowException] SVGLength replaceItem(SVGLength item, unsigned long index); >+ [MayThrowException] SVGLength initialize(SVGLength newItem); >+ [MayThrowException] getter SVGLength getItem(unsigned long index); >+ [MayThrowException] SVGLength insertItemBefore(SVGLength newItem, unsigned long index); >+ [MayThrowException] SVGLength replaceItem(SVGLength newItem, unsigned long index); > [MayThrowException] SVGLength removeItem(unsigned long index); >- [MayThrowException] SVGLength appendItem(SVGLength item); >+ [MayThrowException] SVGLength appendItem(SVGLength newItem); >+ [MayThrowException] setter void (unsigned long index, SVGLength newItem); > }; >Index: Source/WebCore/svg/SVGNumberList.idl >=================================================================== >--- Source/WebCore/svg/SVGNumberList.idl (revision 247157) >+++ Source/WebCore/svg/SVGNumberList.idl (working copy) >@@ -25,13 +25,15 @@ > */ > > interface SVGNumberList { >+ readonly attribute unsigned long length; > readonly attribute unsigned long numberOfItems; > > [MayThrowException] void clear(); >- [MayThrowException] SVGNumber initialize(SVGNumber item); >- [MayThrowException] SVGNumber getItem(unsigned long index); >- [MayThrowException] SVGNumber insertItemBefore(SVGNumber item, unsigned long index); >- [MayThrowException] SVGNumber replaceItem(SVGNumber item, unsigned long index); >+ [MayThrowException] SVGNumber initialize(SVGNumber newItem); >+ [MayThrowException] getter SVGNumber getItem(unsigned long index); >+ [MayThrowException] SVGNumber insertItemBefore(SVGNumber newItem, unsigned long index); >+ [MayThrowException] SVGNumber replaceItem(SVGNumber newItem, unsigned long index); > [MayThrowException] SVGNumber removeItem(unsigned long index); >- [MayThrowException] SVGNumber appendItem(SVGNumber item); >+ [MayThrowException] SVGNumber appendItem(SVGNumber newItem); >+ [MayThrowException] setter void (unsigned long index, SVGNumber newItem); > }; >Index: Source/WebCore/svg/SVGPathSegList.h >=================================================================== >--- Source/WebCore/svg/SVGPathSegList.h (revision 247157) >+++ Source/WebCore/svg/SVGPathSegList.h (working copy) >@@ -58,6 +58,8 @@ public: > return *this; > } > >+ unsigned length() const { return numberOfItems(); } >+ > unsigned numberOfItems() const > { > const_cast<SVGPathSegList*>(this)->ensureItems(); >Index: Source/WebCore/svg/SVGPathSegList.idl >=================================================================== >--- Source/WebCore/svg/SVGPathSegList.idl (revision 247157) >+++ Source/WebCore/svg/SVGPathSegList.idl (working copy) >@@ -25,13 +25,15 @@ > */ > > interface SVGPathSegList { >+ readonly attribute unsigned long length; > readonly attribute unsigned long numberOfItems; > > [MayThrowException] void clear(); > [MayThrowException] SVGPathSeg initialize(SVGPathSeg newItem); >- [MayThrowException] SVGPathSeg getItem(unsigned long index); >+ [MayThrowException] getter SVGPathSeg getItem(unsigned long index); > [MayThrowException] SVGPathSeg insertItemBefore(SVGPathSeg newItem, unsigned long index); > [MayThrowException] SVGPathSeg replaceItem(SVGPathSeg newItem, unsigned long index); > [MayThrowException] SVGPathSeg removeItem(unsigned long index); > [MayThrowException] SVGPathSeg appendItem(SVGPathSeg newItem); >+ [MayThrowException] setter void (unsigned long index, SVGPathSeg newItem); > }; >Index: Source/WebCore/svg/SVGPointList.idl >=================================================================== >--- Source/WebCore/svg/SVGPointList.idl (revision 247157) >+++ Source/WebCore/svg/SVGPointList.idl (working copy) >@@ -24,13 +24,15 @@ > */ > > interface SVGPointList { >+ readonly attribute unsigned long length; > readonly attribute unsigned long numberOfItems; > > [MayThrowException] void clear(); >- [MayThrowException] SVGPoint initialize(SVGPoint item); >- [MayThrowException] SVGPoint getItem(unsigned long index); >- [MayThrowException] SVGPoint insertItemBefore(SVGPoint item, unsigned long index); >- [MayThrowException] SVGPoint replaceItem(SVGPoint item, unsigned long index); >+ [MayThrowException] SVGPoint initialize(SVGPoint newItem); >+ [MayThrowException] getter SVGPoint getItem(unsigned long index); >+ [MayThrowException] SVGPoint insertItemBefore(SVGPoint newItem, unsigned long index); >+ [MayThrowException] SVGPoint replaceItem(SVGPoint newItem, unsigned long index); > [MayThrowException] SVGPoint removeItem(unsigned long index); >- [MayThrowException] SVGPoint appendItem(SVGPoint item); >+ [MayThrowException] SVGPoint appendItem(SVGPoint newItem); >+ [MayThrowException] setter void (unsigned long index, SVGPoint newItem); > }; >Index: Source/WebCore/svg/SVGStringList.idl >=================================================================== >--- Source/WebCore/svg/SVGStringList.idl (revision 247157) >+++ Source/WebCore/svg/SVGStringList.idl (working copy) >@@ -24,13 +24,15 @@ > */ > > interface SVGStringList { >+ readonly attribute unsigned long length; > readonly attribute unsigned long numberOfItems; > > [MayThrowException] void clear(); >- [MayThrowException] DOMString initialize(DOMString item); >- [MayThrowException] DOMString getItem(unsigned long index); >- [MayThrowException] DOMString insertItemBefore(DOMString item, unsigned long index); >- [MayThrowException] DOMString replaceItem(DOMString item, unsigned long index); >+ [MayThrowException] DOMString initialize(DOMString newItem); >+ [MayThrowException] getter DOMString getItem(unsigned long index); >+ [MayThrowException] DOMString insertItemBefore(DOMString newItem, unsigned long index); >+ [MayThrowException] DOMString replaceItem(DOMString newItem, unsigned long index); > [MayThrowException] DOMString removeItem(unsigned long index); >- [MayThrowException] DOMString appendItem(DOMString item); >+ [MayThrowException] DOMString appendItem(DOMString newItem); >+ [MayThrowException] setter void (unsigned long index, DOMString newItem); > }; >Index: Source/WebCore/svg/SVGTransformList.idl >=================================================================== >--- Source/WebCore/svg/SVGTransformList.idl (revision 247157) >+++ Source/WebCore/svg/SVGTransformList.idl (working copy) >@@ -25,15 +25,17 @@ > */ > > interface SVGTransformList { >+ readonly attribute unsigned long length; > readonly attribute unsigned long numberOfItems; > > [MayThrowException] void clear(); >- [MayThrowException] SVGTransform initialize(SVGTransform item); >- [MayThrowException] SVGTransform getItem(unsigned long index); >- [MayThrowException] SVGTransform insertItemBefore(SVGTransform item, unsigned long index); >- [MayThrowException] SVGTransform replaceItem(SVGTransform item, unsigned long index); >+ [MayThrowException] SVGTransform initialize(SVGTransform newItem); >+ [MayThrowException] getter SVGTransform getItem(unsigned long index); >+ [MayThrowException] SVGTransform insertItemBefore(SVGTransform newItem, unsigned long index); >+ [MayThrowException] SVGTransform replaceItem(SVGTransform newItem, unsigned long index); > [MayThrowException] SVGTransform removeItem(unsigned long index); >- [MayThrowException] SVGTransform appendItem(SVGTransform item); >+ [MayThrowException] SVGTransform appendItem(SVGTransform newItem); >+ [MayThrowException] setter void (unsigned long index, SVGTransform newItem); > > [MayThrowException, NewObject] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix); > [MayThrowException] SVGTransform consolidate(); >Index: Source/WebCore/svg/properties/SVGList.h >=================================================================== >--- Source/WebCore/svg/properties/SVGList.h (revision 247157) >+++ Source/WebCore/svg/properties/SVGList.h (working copy) >@@ -33,6 +33,8 @@ namespace WebCore { > template<typename ItemType> > class SVGList : public SVGProperty { > public: >+ unsigned length() const { return numberOfItems(); } >+ > unsigned numberOfItems() const > { > return m_items.size(); >@@ -127,6 +129,14 @@ public: > return item; > } > >+ ExceptionOr<void> setItem(unsigned index, ItemType&& newItem) >+ { >+ auto result = replaceItem(WTFMove(newItem), index); >+ if (result.hasException()) >+ return result.releaseException(); >+ return { }; >+ } >+ > // Parsers and animators need to have a direct access to the items. > Vector<ItemType>& items() { return m_items; } > const Vector<ItemType>& items() const { return m_items; } >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 247157) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2019-07-05 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ SVG2: Add length, item getter and item setter to all SVG lists >+ https://bugs.webkit.org/show_bug.cgi?id=199526 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * svg/dom/SVGList-SVG2-expected.txt: Added. >+ * svg/dom/SVGList-SVG2.xhtml: Added. >+ > 2019-07-05 Antoine Quint <graouts@apple.com> > > [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover >Index: LayoutTests/svg/dom/SVGList-SVG2-expected.txt >=================================================================== >--- LayoutTests/svg/dom/SVGList-SVG2-expected.txt (nonexistent) >+++ LayoutTests/svg/dom/SVGList-SVG2-expected.txt (working copy) >@@ -0,0 +1,52 @@ >+ABC >+This is a test of the simple SVGNumberList API parts. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Test list length/numberOfItems >+PASS text1.x.baseVal.length is 2 >+PASS text1.x.baseVal.numberOfItems is 2 >+PASS text1.rotate.baseVal.length is 3 >+PASS text1.rotate.baseVal.numberOfItems is 3 >+ >+Test item getter >+PASS text1.x.baseVal.getItem(0).value is 50 >+PASS text1.x.baseVal[0].value is 50 >+PASS text1.x.baseVal.getItem(1).value is 100 >+PASS text1.x.baseVal[1].value is 100 >+PASS text1.x.baseVal.getItem(2) threw exception IndexSizeError: The index is not in the allowed range.. >+PASS text1.x.baseVal[2] is undefined. >+ >+PASS text1.rotate.baseVal.getItem(0).value is 90 >+PASS text1.rotate.baseVal[0].value is 90 >+PASS text1.rotate.baseVal.getItem(1).value is 180 >+PASS text1.rotate.baseVal[1].value is 180 >+PASS text1.rotate.baseVal.getItem(2).value is 270 >+PASS text1.rotate.baseVal[2].value is 270 >+PASS text1.rotate.baseVal.getItem(3) threw exception IndexSizeError: The index is not in the allowed range.. >+PASS text1.rotate.baseVal[3] is undefined. >+ >+Test item setter >+PASS text1.x.baseVal[0] = length1 is length1 >+PASS text1.x.baseVal[1] = length2 is length2 >+PASS text1.x.baseVal.getItem(0).value is 40 >+PASS text1.x.baseVal[0].value is 40 >+PASS text1.x.baseVal.getItem(1).value is 80 >+PASS text1.x.baseVal[1].value is 80 >+PASS text1.x.baseVal[2] = length2 threw exception IndexSizeError: The index is not in the allowed range.. >+ >+PASS text1.rotate.baseVal[0] = number1 is number1 >+PASS text1.rotate.baseVal[1] = number2 is number2 >+PASS text1.rotate.baseVal[2] = number3 is number3 >+PASS text1.rotate.baseVal.getItem(0).value is 45 >+PASS text1.rotate.baseVal[0].value is 45 >+PASS text1.rotate.baseVal.getItem(1).value is 90 >+PASS text1.rotate.baseVal[1].value is 90 >+PASS text1.rotate.baseVal.getItem(2).value is 135 >+PASS text1.rotate.baseVal[2].value is 135 >+PASS text1.rotate.baseVal[3] = number3 threw exception IndexSizeError: The index is not in the allowed range.. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/svg/dom/SVGList-SVG2.xhtml >=================================================================== >--- LayoutTests/svg/dom/SVGList-SVG2.xhtml (nonexistent) >+++ LayoutTests/svg/dom/SVGList-SVG2.xhtml (working copy) >@@ -0,0 +1,82 @@ >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<script>window.enablePixelTesting = true;</script> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body> >+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200"> >+ <text id="text1" x="50 100" rotate="90 180 270">ABC</text> >+</svg> >+ >+<p id="description"></p> >+<div id="console"></div> >+<script type="text/javascript"> >+<![CDATA[ >+ description("This is a test of the simple SVGNumberList API parts."); >+ >+ if (window.testRunner) >+ testRunner.dumpAsText(); >+ >+ var svg = document.getElementById("svg"); >+ var text1 = document.getElementById("text1"); >+ >+ var length1 = svg.createSVGLength(); >+ var length2 = svg.createSVGLength(); >+ var number1 = svg.createSVGNumber(); >+ var number2 = svg.createSVGNumber(); >+ var number3 = svg.createSVGNumber(); >+ length1.value = 40; >+ length2.value = 80; >+ number1.value = 45; >+ number2.value = 90; >+ number3.value = 135; >+ >+ debug("Test list length/numberOfItems"); >+ shouldBe("text1.x.baseVal.length", "2"); >+ shouldBe("text1.x.baseVal.numberOfItems", "2"); >+ shouldBe("text1.rotate.baseVal.length", "3"); >+ shouldBe("text1.rotate.baseVal.numberOfItems", "3"); >+ >+ debug(""); >+ debug("Test item getter"); >+ shouldBe("text1.x.baseVal.getItem(0).value", "50"); >+ shouldBe("text1.x.baseVal[0].value", "50"); >+ shouldBe("text1.x.baseVal.getItem(1).value", "100"); >+ shouldBe("text1.x.baseVal[1].value", "100"); >+ shouldThrow("text1.x.baseVal.getItem(2)"); >+ shouldBeUndefined("text1.x.baseVal[2]"); >+ debug(""); >+ shouldBe("text1.rotate.baseVal.getItem(0).value", "90"); >+ shouldBe("text1.rotate.baseVal[0].value", "90"); >+ shouldBe("text1.rotate.baseVal.getItem(1).value", "180"); >+ shouldBe("text1.rotate.baseVal[1].value", "180"); >+ shouldBe("text1.rotate.baseVal.getItem(2).value", "270"); >+ shouldBe("text1.rotate.baseVal[2].value", "270"); >+ shouldThrow("text1.rotate.baseVal.getItem(3)"); >+ shouldBeUndefined("text1.rotate.baseVal[3]"); >+ >+ debug(""); >+ debug("Test item setter"); >+ shouldBe("text1.x.baseVal[0] = length1", "length1"); >+ shouldBe("text1.x.baseVal[1] = length2", "length2"); >+ shouldBe("text1.x.baseVal.getItem(0).value", "40"); >+ shouldBe("text1.x.baseVal[0].value", "40"); >+ shouldBe("text1.x.baseVal.getItem(1).value", "80"); >+ shouldBe("text1.x.baseVal[1].value", "80"); >+ shouldThrow("text1.x.baseVal[2] = length2"); >+ debug(""); >+ shouldBe("text1.rotate.baseVal[0] = number1", "number1"); >+ shouldBe("text1.rotate.baseVal[1] = number2", "number2"); >+ shouldBe("text1.rotate.baseVal[2] = number3", "number3"); >+ shouldBe("text1.rotate.baseVal.getItem(0).value", "45"); >+ shouldBe("text1.rotate.baseVal[0].value", "45"); >+ shouldBe("text1.rotate.baseVal.getItem(1).value", "90"); >+ shouldBe("text1.rotate.baseVal[1].value", "90"); >+ shouldBe("text1.rotate.baseVal.getItem(2).value", "135"); >+ shouldBe("text1.rotate.baseVal[2].value", "135"); >+ shouldThrow("text1.rotate.baseVal[3] = number3"); >+]]> >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199526
:
373525
|
373529
|
373534
|
373538
|
373539
|
373540
|
373551
|
377376
|
377385
|
377413