[CSSOM View] Extensions to Element.scrollLeft and Element.scrollTop are not valid WebIDL

In the "Extensions to the Element Interface" section
(http://www.w3.org/TR/cssom-view/#extensions-to-the-element-interface),
the scrollTop and
scrollLeft attributes have been extended:

  attribute (double or ScrollOptionsVertical) scrollTop;
  attribute (double or ScrollOptionsHorizontal) scrollLeft;

The ScrollOptionsVertical and ScrollOptionsHorizontal dictionaries
include the x and y position with the intent of setting the position
and ScrollOptions simultaneously:

  dictionary ScrollOptionsHorizontal : ScrollOptions {
    double x;
  };
  dictionary ScrollOptionsVertical : ScrollOptions  {
    double y;
  };

As the scrollLeft and scrollTop attributes are described in the CSSOM
View specification as always returning double values while the setter
functions receive either a double or dictionary value.  Setting an
attribute with one datatype and returning a value with another data
type is not allowed by the WebIDL specification.

I have created a bug for this issue:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26294

I would like to suggest that the scrollTop and scrollLeft attributes
remain as double data type only, and that a separate method be added
to the Element interface for scrolling with ScrollOptions:

  void scrollTo(double x, double y, optional ScrollOptions options);

Calling this method would be equivalent to setting both the scrollTop
and scrollLeft attributes while simultanously specifying the
ScrollOptions.

- Kearwood "Kip" Gilbert

Received on Wednesday, 23 July 2014 00:39:32 UTC