Closed Bug 483552 Opened 16 years ago Closed 16 years ago

ensureElementIsVisible on scrollBoxObject doesn't take border into account

Categories

(Toolkit :: UI Widgets, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: Natch, Assigned: dao)

References

Details

(Keywords: testcase)

Attachments

(2 files, 7 obsolete files)

Calling foo.scrollBoxObject.ensureElementIsVisible may still leave the borders out of the visible area. See bug 475203.
To be more precise, it seems that the scrollBoxObject itself is 2 pixels off to the left, when testing a scroll-up the tab to the left has 2 pixels still hidden, and when testing a scroll-down the tab to the right is scrolled 2 pixels too much.
Gonna try working up a testcase...
Keywords: testcase-wanted
Attached file testcase (obsolete) —
Here's a testcase showing the off by 2 thing with a bunch of hbox'es in an arrowscrollbox, needs priveleges to get to the native anon stuff.
Comment on attachment 367536 [details] testcase Scratch that, it doesn't actually need privileges. :)
Attachment #367536 - Attachment description: testcase - requires priveleges → testcase
Requesting blocking, because this makes it impossible to scroll the leftmost tab all the way (both when clicking on the tab itself and when using the mousewheel). This bug is only there when smoothScroll is set to false. The only way to scroll it all the way is by clicking on the left arrow button.
Flags: blocking1.9.1?
Blocks: 475203
Is it generally bad that I can QueryInterface on a scrollbox to its' scrollBoxObject without any permission escalation? Or is QueryInterface harmless?
This is not a regression, right? It's always been broken?
(In reply to comment #7) > This is not a regression, right? It's always been broken? Right. At least since 3.0.
Flags: wanted1.9.1-
Flags: blocking1.9.1?
Flags: blocking1.9.1-
Attached file testcase 2
Attachment #367536 - Attachment is obsolete: true
Assignee: nobody → dao
Status: NEW → ASSIGNED
Attachment #370378 - Flags: review?(enndeakin)
Attachment #370379 - Flags: review?(gavin.sharp)
This fixes bug 485938 and bug 485841.
Blocks: 485938, 485841
the previous patch removed a code block that shouldn't have been removed (but updated to not use the scrollBoxObject)
Attachment #370379 - Attachment is obsolete: true
Attachment #370380 - Flags: review?(gavin.sharp)
Attachment #370379 - Flags: review?(gavin.sharp)
- <field name="_scrollBoxObject">null</field> - <property name="scrollBoxObject" readonly="true"> Don't remove this. It's listed in the documentation. Also, removing this caused you to change the tests to use internal properties which shouldn't be done if it isn't necessary. + <property name="visibleSize" readonly="true"> + <getter><![CDATA[ + return this.getAttribute("orient") == "horizontal" ? + this._scrollbox.clientWidth : + this._scrollbox.clientHeight; The default orientation is horizontal though so if orient isn't specified this will be incorrect. Same with the other properties. Also, this.orient should be ok here. I'm not sure I like the idea of adding more properties, but I'm not as concerned as it only affects the arrowscrollbox which is fairly specialized. I assume you tested large menus too? We should at least give the new properties names that correspond more with the source names. scrollRect -> scrollClientRect or something.
Attached patch toolkit part, v2 (obsolete) — Splinter Review
I've tested this with the bookmarks menu.
Attachment #370378 - Attachment is obsolete: true
Attachment #370448 - Flags: review?(enndeakin)
Attachment #370378 - Flags: review?(enndeakin)
Attached patch browser part, v3 (obsolete) — Splinter Review
s/scrollRect/scrollClientRect/
Attachment #370380 - Attachment is obsolete: true
Attachment #370449 - Flags: review?(gavin.sharp)
Attachment #370380 - Flags: review?(gavin.sharp)
Comment on attachment 370448 [details] [diff] [review] toolkit part, v2 I'd actually meant to change all the properties, so that it was clearer how they related to what they retrieved: visibleSize -> scrollClientSize scrolledSized -> scrollSize I'm not too concerned about the first, but I think scrollSize should be used to mirror scrollPosition (rather that scrolled with an 'ed')
Attachment #370448 - Flags: review?(enndeakin) → review+
changed the property names as suggested
Attachment #370448 - Attachment is obsolete: true
Attached patch browser part, v4 (obsolete) — Splinter Review
Attachment #370449 - Attachment is obsolete: true
Attachment #371725 - Flags: review?(gavin.sharp)
Attachment #370449 - Flags: review?(gavin.sharp)
Component: XUL → XUL Widgets
Flags: wanted1.9.1-
Product: Core → Toolkit
QA Contact: xptoolkit.widgets → xul.widgets
Attachment #371723 - Attachment description: toolkit part, v3 → toolkit part, v3 (checked in)
Backed out of m-c; the tree has unexplained leak orange.
could this have caused Bug 487946 ?
Comment on attachment 371725 [details] [diff] [review] browser part, v4 moving this to bug 485841
Attachment #371725 - Attachment is obsolete: true
Attachment #371725 - Flags: review?(gavin.sharp)
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Blocks: 517863
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: