Closed Bug 785284 Opened 12 years ago Closed 7 years ago

tabbrowser and scrollbox calls getBoundingClientRect causing sync layout

Categories

(Firefox :: Tabbed Browser, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1356705

People

(Reporter: BenWa, Unassigned)

Details

(Whiteboard: [Snappy:p1][sps])

MXR search:
http://mxr.mozilla.org/mozilla-central/search?string=getBoundingClientRect&find=%2Fbrowser%2Fbase%2Fcontent&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central

I'm seeing tabbrowser.xml and scrollbox.xml cause some sync layout because of calls to getBoundingClientRect which is relatively a very expensive operation for a what looks like a simple getter.

Profile:
http://people.mozilla.com/~bgirard/cleopatra/?report=830af9dcdc0c1f36df7222a0da8a63827d8b0de5
I don't think I understand this bug. Are you suggesting that we should use something else than getBoundingClientRect, something that doesn't flush layout while still getting us the data we need?
Yes, I'm not familiar with the code enough to know what the use case is for getBoundingClientRect but it would be ideal to avoid using it if it's not strictly required.
Whiteboard: [Snappy][sps] → [Snappy:p1][sps]
Bug 878801 introduced nsIDOMWindowUtils.getBoundsWithoutFlushing(). We should investigate what possibilities we have and where we could replace getBoundingClientRect() calls.
For scrolling tabs into view and similar operations, we actually need up-to-date data.
We could look if some of this information can be cached by tabbrowser after the previous last operation finishes (e.g. width of tabs)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.