Re: [spec-reviews] CSSOM View document.scrollingElement (#51)

> seems like we are essentially baking a jQuery-style browser normalizer ... into the browser. Which means we'll have to support it going forward forever.

Isn't this how browser APIs evolve to some extent?  As frameworks figure out better API surface area to reduce developer confusion and interop problems, we _should_ consider adopting it into the core platform for universal availability?

> The scenario here is a library that intends to work in quirks mode as well as standards mode? Is that a widespread need? If so that would indeed be a good argument. Are libraries currently using tricks like those on display in the polyfill before they use scrollTop, in order to cater to quirks mode?

I don't know how common this is.  Many of the solutions I've seen for this "how do I identify the scrolling element" question involve checking for quirks mode.  Eg. see Closure's code here: https://github.com/google/closure-library/blob/32365aba43acb36c5d693256ef5d4dbe3bddddfe/closure/goog/dom/dom.js#L632

>From what I can see, jQuery deals with this issue by creating unified scrollTop/scrollLeft wrapper APIs which use the window api when appropriate (eg. window.pageXOffset) rather than attempt to use body/documentElement at all.  Eg: https://github.com/jquery/jquery/blob/74ae5444832b2fb966768a97281d2ad8c088bc58/src/offset.js#L170.

> I think you are missing long-term futures like ...

Yes, I agree those outcomes are a risk and I don't have any concrete data / arguments to counter it.  My instinct is that the cost (complexity/confusion) of a precisely defined but extraneous scrollingElement API is relatively low compared to the cost of the other options.  Also that it's worth taking some small breakage to fix this issue, and therefore the benefit (over a suitably long time horizon) outweighs the risk that we'll never fix it.  

But I don't see any obvious way around this being a judgement call.  It sounds like Safari agrees with your judgement ([same sort of argument](https://bugs.webkit.org/show_bug.cgi?id=143609)), while Mozilla, IE and the spec editor's judgement is that it's worth it.  I'm happy to defer to your judgement if TAG should be the one to make the judgement call here.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/spec-reviews/issues/51#issuecomment-93787661

Received on Thursday, 16 April 2015 17:13:49 UTC