w3c/csswg-drafts

[cssom-view] Expose inner border dimensions

Open

#1.129 geöffnet am 27. März 2017

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)HTML (545 Forks)batch import
Help Wantedcssom-view-1

Repository-Metriken

Stars
 (3.546 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 87T 7h) (24 gemergte PRs in 30 T)

Beschreibung

cf. https://github.com/jquery/jquery/issues/3589#issuecomment-289548410

There seems to be no good method for calculating the dimensions of an element's inner border edge (i.e., content area plus padding plus non-floating scrollbars). One can subtract computed border dimensions from offsetWidth or offsetHeight in the special case of a block-layout HTMLElement, but as far as I can tell it's otherwise impossible.

I think the Element interface should expose something for such calculations, e.g.

  • scrollGutterWidth/scrollGutterHeight (the space lost to scrollbars), or
  • scrollbarWidth/scrollbarHeight (the scrollbar width), along with a method for identifying non-floating scrollbars, or
  • fullClientWidth/fullClientHeight (the dimensions of an inner border edge).

The last one seems most consistent with the rest of CSSOM View.

Contributor Guide