Re: [csswg-drafts] [cssom-view] scrollIntoView()

(Commenting here instead of creating a duplicate issue.)

https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface

annevk suggests the dictionary defaults for scrollIntoView should be the same as omitting the argument and passing in `true` (which is start-nearest). Currently the dictionary defaults are instead center-center, because in https://www.w3.org/Bugs/Public/show_bug.cgi?id=17152 it was argued to be a common case so there should be a convenient way to get center-center.

Due to legacy we can't change the behavior of omitted argument or passing `true`, but I think we can still change the dictionary defaults since they are not yet interoperably implemented. I also think having the defaults match between dictionary and boolean makes for a less surprising and easier to learn API.


| Test case                               | EdgeHTML | Blink | Gecko | WebKit |
|-----------------------------------------|----------|-------|-------|--------|
| http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5300     | top         | center      | top      |  top      |

Current spec:
```
dictionary ScrollIntoViewOptions : ScrollOptions {
  ScrollLogicalPosition block = "center";
  ScrollLogicalPosition inline = "center";
};
```
Suggested change:
```
dictionary ScrollIntoViewOptions : ScrollOptions {
  ScrollLogicalPosition block = "start";
  ScrollLogicalPosition inline = "nearest";
};
```

Related: https://github.com/w3c/csswg-drafts/issues/1367

-- 
GitHub Notification of comment by zcorpan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1720#issuecomment-322129799 using your GitHub account

Received on Monday, 14 August 2017 08:30:35 UTC