Should interfaces with values really be [NoInterfaceObject]?

Robert Longson <[email protected]> Sun, 21 Aug 2016 22:07:10 +0100
Newsgroups gmane.comp.web.svg
Message-ID <CAOu7Uv5mtWS2cFVrOGOA4XswoWAigFs8+XsGmX+LPdkWtCF8=Q@mail.gmail.com>
--001a1143aee6a74a4b053a9b50c4
Content-Type: text/plain; charset=UTF-8

SVG 2 has this webidl definition of SVGZoomAndPan


[NoInterfaceObject]
interface *SVGZoomAndPan* {

  // Zoom and Pan Types
  const unsigned short SVG_ZOOMANDPAN_UNKNOWN
<https://www.w3.org/TR/SVG2/types.html#__svg__SVGZoomAndPan__SVG_ZOOMANDPAN_UNKNOWN>
= 0;
  const unsigned short SVG_ZOOMANDPAN_DISABLE
<https://www.w3.org/TR/SVG2/types.html#__svg__SVGZoomAndPan__SVG_ZOOMANDPAN_DISABLE>
= 1;
  const unsigned short SVG_ZOOMANDPAN_MAGNIFY
<https://www.w3.org/TR/SVG2/types.html#__svg__SVGZoomAndPan__SVG_ZOOMANDPAN_MAGNIFY>
= 2;

  attribute unsigned short zoomAndPan
<https://www.w3.org/TR/SVG2/types.html#__svg__SVGZoomAndPan__zoomAndPan>;
};

Without the NoInterfaceObject one could write something like

   if (element.zoomAndPan == SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE)

While one now has to write it as

   if (element.zoomAndPan == SVGSVGElement.SVG_ZOOMANDPAN_DISABLE)

The same applies to SVGUnitTypes. Do we mind about keeping backwards
compatibility with any existing usages like this. We found when making
this change that our own unit tests fail on SVGUnitTypes usage for
instance.

Robert

--001a1143aee6a74a4b053a9b50c4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><pre class=3D"">SVG 2 has this webidl definition of SVGZoo=
mAndPan<br></pre><pre class=3D""><br>[NoInterfaceObject]
interface <b>SVGZoomAndPan</b> {

  // Zoom and Pan Types
  const unsigned short <a href=3D"https://www.w3.org/TR/SVG2/types.html#__s=
vg__SVGZoomAndPan__SVG_ZOOMANDPAN_UNKNOWN">SVG_ZOOMANDPAN_UNKNOWN</a> =3D 0=
;
  const unsigned short <a href=3D"https://www.w3.org/TR/SVG2/types.html#__s=
vg__SVGZoomAndPan__SVG_ZOOMANDPAN_DISABLE">SVG_ZOOMANDPAN_DISABLE</a> =3D 1=
;
  const unsigned short <a href=3D"https://www.w3.org/TR/SVG2/types.html#__s=
vg__SVGZoomAndPan__SVG_ZOOMANDPAN_MAGNIFY">SVG_ZOOMANDPAN_MAGNIFY</a> =3D 2=
;

  attribute unsigned short <a href=3D"https://www.w3.org/TR/SVG2/types.html=
#__svg__SVGZoomAndPan__zoomAndPan">zoomAndPan</a>;
};<br><br></pre><pre class=3D"">Without the NoInterfaceObject one could wri=
te something like<br><br>   if (element.zoomAndPan =3D=3D SVGZoomAndPan.SVG=
_ZOOMANDPAN_DISABLE)<br><br></pre><pre class=3D"">While one now has to writ=
e it as <br><br>   if (element.zoomAndPan =3D=3D SVGSVGElement.SVG_ZOOMANDP=
AN_DISABLE)<br><br></pre><pre class=3D"">The same applies to SVGUnitTypes. =
Do we mind about keeping backwards<br>compatibility with any existing usage=
s like this. We found when making<br>this change that our own unit tests fa=
il on SVGUnitTypes usage for<br>instance.<br></pre><pre class=3D"">Robert<b=
r></pre></div>

--001a1143aee6a74a4b053a9b50c4--