Closed Bug 1847777 Opened 2 years ago Closed 2 years ago

scrollWidth doesn't factor in padding

Categories

(Core :: Layout, defect)

Firefox 116
defect

Tracking

()

RESOLVED DUPLICATE of bug 1768921

People

(Reporter: github, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36

Steps to reproduce:

  1. Create a div with a width, overflow: hidden, a padding, and content that extends beyond the width (but small enough that it doesn't extend outside the padding).
  2. Compare the scrollWidth and clientWidth of the element
  3. Create a div with a width, overflow: hidden, a padding, and content that extends well beyond the width
  4. Compare the scrollWidth and clientWidth of the element in multiple browsers

A CodePen reproduction is available here: https://codepen.io/illandril/pen/dyQLBEM
A screenshot of the results I see in my testing is attached.

Actual results:

  1. scrollWidth is equal to the clientWidth
  2. scrollWidth in Firefox is smaller than Safari and Chrome; clientWidth is equal in Firefox, Safari, and Chrome

Expected results:

  1. scrollWidth is greater than the clientWidth
  2. scrollWidth and clientWidth is identical in all browsers

The Bugbug bot thinks this bug should belong to the 'Core::Layout' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout
Product: Firefox → Core

Ah, yes - this is a duplicate of bug 1768921 - we should no longer "eat" the horizontal padding in calculating scrollable overflow.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1768921
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: