Should interfaces with values really be [NoInterfaceObject]?

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

Received on Sunday, 21 August 2016 21:07:39 UTC