Skip to content

Mark SVGGraphicsElement members as supported since ancient times#10564

Merged
Elchi3 merged 1 commit intomdn:mainfrom
foolip:complicate-SVGGraphicsElement
Jun 1, 2021
Merged

Mark SVGGraphicsElement members as supported since ancient times#10564
Elchi3 merged 1 commit intomdn:mainfrom
foolip:complicate-SVGGraphicsElement

Conversation

@foolip
Copy link
Contributor

@foolip foolip commented May 21, 2021

http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9339 was
used to test for support of the interface itself. Results:

  • Chrome 30 (not in 29)
  • Not in IE11
  • Edge 13 => Edge 12 assumed
  • Firefox 20 (not in 19)
  • Not in Opera 12.16
  • Safari 6.2 (not in 6.0) => Safari 6.1 assumed

http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9295 was
used to test for support for the members on concrete interfaces:

<!DOCTYPE html>
<script>
var members = ['transform', 'getBBox', 'getCTM', 'getScreenCTM'];
var instances = {
  SVGAElement: document.createElementNS('http://www.w3.org/2000/svg', 'a'),
  SVGCircleElement: document.createElementNS('http://www.w3.org/2000/svg', 'circle'),
  SVGDefsElement: document.createElementNS('http://www.w3.org/2000/svg', 'defs'),
  SVGEllipseElement: document.createElementNS('http://www.w3.org/2000/svg', 'ellipse'),
  SVGForeignObjectElement: document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject'),
  SVGGElement: document.createElementNS('http://www.w3.org/2000/svg', 'g'),
  SVGImageElement: document.createElementNS('http://www.w3.org/2000/svg', 'image'),
  SVGLineElement: document.createElementNS('http://www.w3.org/2000/svg', 'line'),
  SVGPathElement: document.createElementNS('http://www.w3.org/2000/svg', 'path'),
  SVGPolygonElement: document.createElementNS('http://www.w3.org/2000/svg', 'polygon'),
  SVGPolylineElement: document.createElementNS('http://www.w3.org/2000/svg', 'polyline'),
  SVGRectElement: document.createElementNS('http://www.w3.org/2000/svg', 'rect'),
  SVGSVGElement: document.createElementNS('http://www.w3.org/2000/svg', 'svg'),
  SVGSwitchElement: document.createElementNS('http://www.w3.org/2000/svg', 'switch'),
  SVGSymbolElement: document.createElementNS('http://www.w3.org/2000/svg', 'symbol'),
  SVGUseElement: document.createElementNS('http://www.w3.org/2000/svg', 'use'),
};
for (var iface in instances) {
  var instance = instances[iface];
  for (var i = 0; i < members.length; i++) {
    var member = members[i];
    w(iface + '.' + member + ': ' + (member in instance));
  }
}
</script>

Results:

  • IE9 supports everything except SVGForeignObjectElement,
    SVGSymbolElement and SVGSVGElement.transform
  • Edge 15 supports everything except SVGSymbolElement
  • Chrome 15, Firefox 3, Opera 12.16 and Safari 4 support everything
    except SVGSymbolElement and SVGSVGElement.transform

SVGGraphicsElement was introduced in WebKit here:
https://trac.webkit.org/changeset/152167/webkit
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/Configurations/Version.xcconfig?rev=152167

It combined SVGLocatable and SVGTransformable going back to the initial
SVG support in Safari 3, which also shipped in Chrome 1:
https://trac.webkit.org/browser/webkit/branches/old/Safari-3-branch/WebCore/ksvg2/svg/SVGLocatable.idl
https://trac.webkit.org/browser/webkit/branches/old/Safari-3-branch/WebCore/ksvg2/svg/SVGTransformable.idl

All together, the members are assumed to be supported from when SVG
support was introduced in each browser.

@github-actions github-actions bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label May 21, 2021
@foolip
Copy link
Contributor Author

foolip commented May 21, 2021

I went down this rabbit hole because getting rid of the SVGTests mixin will require adding members to SVGGraphicsElement which are also older than SVGGraphicsElement itself, but not as old as these I think.

Test results from http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9295:

  • IE9 supports everything except SVGForeignObjectElement, SVGSymbolElement and SVGSVGElement.transform
  • Edge 15 supports everything except SVGSymbolElement
  • Chrome 15, Firefox 3, Opera 12.16 and Safari 4 support everything except SVGSymbolElement and SVGSVGElement.transform

So since most of this is supported in all browsers going very far back I'm pretty confident, but I'm not sure about this being supported since Firefox 1.5 since I'm not good at Gecko source archeology. @vinyldarkscratch would you be able to test http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9295 on Firefox 1.5 and see what it looks like?

@foolip foolip force-pushed the complicate-SVGGraphicsElement branch 2 times, most recently from 9ea7d0b to f9b8309 Compare May 31, 2021 15:59
http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9339 was
used to test for support of the interface itself. Results:
 - Chrome 30 (not in 29)
 - Not in IE11
 - Edge 13 => Edge 12 assumed
 - Firefox 20 (not in 19)
 - Not in Opera 12.16
 - Safari 6.2 (not in 6.0) => Safari 6.1 assumed

http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9295 was
used to test for support for the members on concrete interfaces:
```html
<!DOCTYPE html>
<script>
var members = ['transform', 'getBBox', 'getCTM', 'getScreenCTM'];
var instances = {
  SVGAElement: document.createElementNS('http://www.w3.org/2000/svg', 'a'),
  SVGCircleElement: document.createElementNS('http://www.w3.org/2000/svg', 'circle'),
  SVGDefsElement: document.createElementNS('http://www.w3.org/2000/svg', 'defs'),
  SVGEllipseElement: document.createElementNS('http://www.w3.org/2000/svg', 'ellipse'),
  SVGForeignObjectElement: document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject'),
  SVGGElement: document.createElementNS('http://www.w3.org/2000/svg', 'g'),
  SVGImageElement: document.createElementNS('http://www.w3.org/2000/svg', 'image'),
  SVGLineElement: document.createElementNS('http://www.w3.org/2000/svg', 'line'),
  SVGPathElement: document.createElementNS('http://www.w3.org/2000/svg', 'path'),
  SVGPolygonElement: document.createElementNS('http://www.w3.org/2000/svg', 'polygon'),
  SVGPolylineElement: document.createElementNS('http://www.w3.org/2000/svg', 'polyline'),
  SVGRectElement: document.createElementNS('http://www.w3.org/2000/svg', 'rect'),
  SVGSVGElement: document.createElementNS('http://www.w3.org/2000/svg', 'svg'),
  SVGSwitchElement: document.createElementNS('http://www.w3.org/2000/svg', 'switch'),
  SVGSymbolElement: document.createElementNS('http://www.w3.org/2000/svg', 'symbol'),
  SVGUseElement: document.createElementNS('http://www.w3.org/2000/svg', 'use'),
};
for (var iface in instances) {
  var instance = instances[iface];
  for (var i = 0; i < members.length; i++) {
    var member = members[i];
    w(iface + '.' + member + ': ' + (member in instance));
  }
}
</script>
```

Results:
 - IE9 supports everything except SVGForeignObjectElement,
   SVGSymbolElement and SVGSVGElement.transform
 - Edge 15 supports everything except SVGSymbolElement
 - Chrome 15, Firefox 3, Opera 12.16 and Safari 4 support everything
   except SVGSymbolElement and SVGSVGElement.transform

SVGGraphicsElement was introduced in WebKit here:
https://trac.webkit.org/changeset/152167/webkit
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/Configurations/Version.xcconfig?rev=152167

It combined SVGLocatable and SVGTransformable going back to the initial
SVG support in Safari 3, which also shipped in Chrome 1:
https://trac.webkit.org/browser/webkit/branches/old/Safari-3-branch/WebCore/ksvg2/svg/SVGLocatable.idl
https://trac.webkit.org/browser/webkit/branches/old/Safari-3-branch/WebCore/ksvg2/svg/SVGTransformable.idl

All together, the members are assumed to be supported from when SVG
support was introduced in each browser.
@foolip foolip force-pushed the complicate-SVGGraphicsElement branch from f9b8309 to 5375995 Compare May 31, 2021 16:16
@foolip foolip marked this pull request as ready for review May 31, 2021 16:16
@foolip
Copy link
Contributor Author

foolip commented May 31, 2021

@foolip
Copy link
Contributor Author

foolip commented May 31, 2021

@Elchi3 this is going to block demixing SVGTests, since that will add members to SVGGraphicsElement.

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @foolip, looks good to me 👍

@Elchi3 Elchi3 merged commit e621705 into mdn:main Jun 1, 2021
@foolip foolip deleted the complicate-SVGGraphicsElement branch June 1, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants