Closed Bug 209807 Opened 21 years ago Closed 21 years ago

[FIXr]input.scrollWidth and input.scrollHeight returning wrong values

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.7beta

People

(Reporter: mozbugs, Assigned: bzbarsky)

References

()

Details

(Keywords: testcase)

Attachments

(3 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030612 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030612 I know this sucks as a bug report. However, I had a javascript that calculated positioning using offsetleft, offsettop which worked fine in 1.3 but is broken now. I know there have been a lot of invalid bugs like this. I'll try to work up a testcase soon. It's just so close to the 1.4 release that I thought I'd put this in now. ( I was using firebird and thought that it might just be fb, but that's not the case. ) Reproducible: Always Steps to Reproduce: 1. 2. 3.
Summary: offsetLeft return wrong values → input.scrollwidth always = 1000
scrollWidth and scrollHeight are returning wrong values... that was the problem added attachment, changed summary.
Summary: input.scrollwidth always = 1000 → input.scrollWidth and input.scrollHeight returning wrong values
(sorry, the 'attachment' is the url.)
Attached file Testcase #1
-> DOM extensions
Assignee: other → dom_bugs
Status: UNCONFIRMED → NEW
Component: Layout → DOM Mozilla Extensions
Ever confirmed: true
Keywords: testcase
OS: Windows 2000 → All
Does this happen for all elements or just input?
Only text and password types are affected. Testcase #2 tests text, password, checkbox, radio, button, div, p, textarea. Ps. Note, the problem affects even unstyled input-text boxes.
The problem here is that nsTextControlFrame implements nsIScrollableViewProvider and the view it returns if it's a single-line text control is totally bogus (see nsTextControlFrame::GetScrollableView). There are two possible fixes to this bug: 1) Always just return mScrollableView 2) Don't QI to nsIScrollableViewProvider if we are not scrollable. roc, do you have any idea what this code is trying to do and why?
This got broken by blake with his patch to bug 62431. Ccing blake and reviewers of the patch. I suspect that approach #2 would fix that bug without causing this bustage. I can't test for sure, because I don't have a mousewheel to test with.
Can someone who has a scrollwheel check that this does not regress bug 62431? Blake, could you take a few mins to do that?
Comment on attachment 141728 [details] [diff] [review] Possible patch, untested OK, this patch fixes the bug. I still can't test its effect on bug 62431, but it should be fine, since the text control will no longer have a scrollview.
Attachment #141728 - Flags: superreview?(roc)
Attachment #141728 - Flags: review?(roc)
Attachment #141728 - Flags: superreview?(roc)
Attachment #141728 - Flags: superreview+
Attachment #141728 - Flags: review?(roc)
Attachment #141728 - Flags: review+
this patch does not change mozilla's behaviour wrt mousewheels on inputs and textareas. tested on current trunk, winxp.
Assignee: general → bzbarsky
Priority: -- → P1
Summary: input.scrollWidth and input.scrollHeight returning wrong values → [FIXr]input.scrollWidth and input.scrollHeight returning wrong values
Target Milestone: --- → mozilla1.7beta
Fix checked in for 1.7b
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: