- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Tue, 22 Dec 2015 09:20:08 -0800
- To: "Robert O'Callahan" <robert@ocallahan.org>
- Cc: Simon Pieters <simonp@opera.com>, Trav Stone <travtrilogi@gmail.com>, Rick Byers <rbyers@chromium.org>, "www-style@w3.org" <www-style@w3.org>, Emil A Eklund <eae@chromium.org>, Boris Zbarsky <bzbarsky@mit.edu>
On Mon, Dec 21, 2015 at 7:29 PM, Robert O'Callahan <robert@ocallahan.org> wrote:
> On Mon, Dec 21, 2015 at 9:33 PM, Simon Pieters <simonp@opera.com> wrote:
>> Or if there's a border, then getBoundingClientRect includes the border.
>> But getBoxQuads() lets you select the content box... An alternative would be
>> to extend getBoxQuads() with a way to get the "content minus scrollbars"
>> box.
>>
>> elm.getBoxQuads({box: 'scroll'})[0].getBounds().width
>>
>> It's more wordy than elm.scrollWidth (and elm.getScrollRect().width),
>> although you can support transformed boxes.
>
> I'd prefer to add new box types to CSSBoxType rather than add new methods to
> expose them independently.
Agreed - we created the nice, powerful, generalized method for a
reason. Adding independent methods, even if it results in slightly
shorter code, means the new functionality doesn't interoperate - you
can't get the coords relative to something else, for instance.
~TJ
Received on Tuesday, 22 December 2015 17:20:56 UTC