Closed Bug 485841 Opened 15 years ago Closed 15 years ago

Get rid of some timeouts and avoid boxObject where appropriate in tabbrowser

Categories

(Firefox :: Tabbed Browser, defect)

3.5 Branch
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3.6a1

People

(Reporter: dao, Assigned: dao)

References

Details

Attachments

(1 file, 3 obsolete files)

Example A:
1. open lots of tabs
2. scroll to the end of the tabstrip
3. select the tab that's visible on the left end of the tabstrip, so that the last tab will be partially hidden
4. close the last tab using middle click
--or--
2. select the last tab
3. scroll a bit, so that the the tab that's visible on the left end of the tabstrip becomes fully visible and the last tab becomes partially hidden
4. close the last tab using the close button or accel+w
--> the closed tab leaves a gap that should have been filled

Example B:
1. enable session restoring ("When Minfield starts: Show my tabs and windows from last time"...)
2. open lots of tabs
3. select the last tab
4. exit the browser
5. start the browser
--> the selected tab isn't fully visible, it's cut off by the width of the right scrolling button
Depends on: 483552
Attached patch patch (obsolete) — Splinter Review
Attachment #372424 - Flags: review?(gavin.sharp)
Morphing a bit, since the flushing that's interesting for the examples from comment 0 has been done in bug 483552. The patch here is still needed to fully fix the cases.
Summary: Need to flush layout for some operations on the tabstrip → Get rid of some timeouts and avoid boxObject where appropriate in tabbrowser
Attached patch patch (obsolete) — Splinter Review
updated to trunk
Attachment #372424 - Attachment is obsolete: true
Attachment #374830 - Flags: review?(gavin.sharp)
Attachment #372424 - Flags: review?(gavin.sharp)
Attached patch patch (obsolete) — Splinter Review
updated to latest trunk
Attachment #374830 - Attachment is obsolete: true
Attachment #375192 - Flags: review?(gavin.sharp)
Attachment #374830 - Flags: review?(gavin.sharp)
Gavin: ping?
There are a few places in that patch that use rect.left+rect.width (or clientWidth) instead of just using rect.right.

How did you determine that the setTimeout wasn't necessary for the adjustTabstrip/updateScrollButtonsDisabledState calls?

Looks good to me otherwise, but Neil Deakin may be a better reviewer for this since I think he's more familiar with the differences between client* properties and boxObjects.
(In reply to comment #6)
> There are a few places in that patch that use rect.left+rect.width (or
> clientWidth) instead of just using rect.right.

I see this only in one place, but I'll double-check.

> How did you determine that the setTimeout wasn't necessary for the
> adjustTabstrip/updateScrollButtonsDisabledState calls?

clientWidth in adjustTabstrip flushes layout, and so does _updateScrollButtonsDisabledState as of bug 483552.
(In reply to comment #7)
> (In reply to comment #6)
> > There are a few places in that patch that use rect.left+rect.width (or
> > clientWidth) instead of just using rect.right.
> 
> I see this only in one place, but I'll double-check.

>+                                     ib.getBoundingClientRect().left + ib.clientWidth -

>+                  newMargin = tabRect.left - rect.left + tabRect.width;

>+                  newMargin = rect.left - tabRect.left + rect.width;

>+                  newMargin = rect.left - tabRect.left + rect.width - tabRect.width;
Attached patch patch v2Splinter Review
what Gavin said
Attachment #375192 - Attachment is obsolete: true
Attachment #387231 - Flags: review?(enndeakin)
Attachment #375192 - Flags: review?(gavin.sharp)
Comment on attachment 387231 [details] [diff] [review]
patch v2

> Looks good to me otherwise, but Neil Deakin may be a better reviewer for this
> since I think he's more familiar with the differences between client*
> properties and boxObjects.

The difference is that getBoundingClientRect returns border-boxes, and boxObject.x/y does something odd where it excludes the border, (but boxObject.width/height does not).

Regardless, you may wish to test with larger borders on tabs, tabstrip, etc, just in case some theme has that.
Attachment #387231 - Flags: review?(enndeakin) → review+
http://hg.mozilla.org/mozilla-central/rev/3b6affa995be
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.6a1
leak test boxes are acting up, backed out...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Landed in various steps:

http://hg.mozilla.org/mozilla-central/rev/be001dd56987
http://hg.mozilla.org/mozilla-central/rev/c4fe058e760c
http://hg.mozilla.org/mozilla-central/rev/03a6732c66b3 [1]
http://hg.mozilla.org/mozilla-central/rev/af27eba56973 [2]
http://hg.mozilla.org/mozilla-central/rev/9e51ab5a80ee

1: this leaks
2: this fixed the leak, somehow
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Verified fixed with the steps in comment 0. Looks good on 1.9.2 with builds on all platforms like

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2b3pre) Gecko/20091112 Namoroka/3.6b3pre (.NET CLR 3.5.30729) ID:20091112051557
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: