Re: [cssom-view] Propose to add attrs for getting max/min value of scroll coordinate attrs

On Wed, 21 Oct 2015 10:11:40 +0200, Xidorn Quan <quanxunzhen@gmail.com>  
wrote:

> I propose adding the following readonly attributes to Window:
> scrollMinX, scrollMaxX, scrollMinY, scrollMaxY, and the following
> readonly attributes to Element: scrollLeftMin, scrollLeftMax,
> scrollTopMin, scrollTopMax.
>
> These attributes, as their names indicate, return the max/min possible
> value can be returned from their corresponding attributes in the given
> context. They can be useful for authors to implement their own
> scrolling indicators.
>
> Previous discussion about scrollMaxX/Y can be found here:
> * https://lists.w3.org/Archives/Public/www-style/2012Jun/0525.html
> * https://lists.w3.org/Archives/Public/www-style/2013Apr/0473.html
>
> The previous discussion only covers scrollMax*, but given the current
> spec, scrollLeft and scrollX can be negative in RTL and vertical-rl
> documents, and in which case, the maximum values would always be zero,
> so we would need the Min ones. Since we do not have any bottom-to-top
> mode in spec, scrollMinY and scrollTopMin may not be useful, but we
> could add them for completeness.
>
> Gecko has shipped the Max ones since long ago, and we are currently
> adding the Min ones for internal use (not going to expose to the web
> before they get specified, though).
>
> Thoughts?

Since the experiment to change scrollWidth and clientWidth to  
'unrestricted double' failed, I support adding these.

(FWIW, scrollLeft and some other things have successfully shipped as  
'unrestricted double' in Chrome and Opera for a while now. It appears they  
are 'long' in Gecko currently.)

-- 
Simon Pieters
Opera Software

Received on Thursday, 22 October 2015 08:52:53 UTC