Open Bug 859428 Opened 13 years ago Updated 3 years ago

Change the behavior of input.scrollWidth to be like WebKit

Categories

(Core :: DOM: CSS Object Model, enhancement, P5)

20 Branch
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: dtrebbien, Unassigned)

Details

Attachments

(1 file)

Attached file Test case
Firefox and Safari/Chrome/WebKit browsers are currently the only browsers that support text-overflow on text INPUTs. In WebKit browsers, it is possible to determine whether an ellipsis is showing by comparing the INPUT element's scrollWidth and clientWidth. In Firefox, however, it is not possible because input.scrollWidth always equals input.clientWidth. The idea of this enhancement request is to change the behavior of input.scrollWidth to be like WebKit, which apparently returns the width of the input value plus the calculated left and right padding as if applying step 4 from the CSSOM View spec: "Return the computed value of the 'padding-left' property, plus the computed value of the 'padding-right', plus the content width of the element." http://www.w3.org/TR/cssom-view/#dom-element-scrollwidth Chrome 26.0.1410.43, Safari 6.0.3, IE 8, and IE 9 use the WebKit formula for input.scrollWidth. Firefox 20.0 uses the WebKit formula for textarea.scrollHeight, but not input.scrollWidth. Opera 12.15 and IE 10 are like Firefox in that input.scrollWidth equals input.clientWidth, but interestingly IE 10 supports scrollLeft and scrollTop. Attached is a small test case. If opened in Firefox 20.0, you will see an alert with the message "theInput.scrollWidth = 50" and notice that the ellipsis is cutting of the input's value. If opened in Safari 6.0.3 or Chrome 26.0.1410.43, the alert will show that the scrollWidth is ~248px.
Attachment #734733 - Attachment mime type: text/plain → text/html
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: