W3C home > Mailing lists > Public > www-style@w3.org > July 2014

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

From: Kip Gilbert <kgilbert@mozilla.com>
Date: Tue, 22 Jul 2014 17:39:01 -0700
Message-ID: <53CF0425.9060506@mozilla.com>
To: www-style@w3c.org
In the "Extensions to the Element Interface" section
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:


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

- Kearwood "Kip" Gilbert
Received on Wednesday, 23 July 2014 00:39:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC