Freezes for multiple seconds when clicking a variable in nsFrame.cpp

RESOLVED FIXED

Status

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: mstange, Assigned: new_one)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
STR:
 1. Go to https://dxr.mozilla.org/mozilla-central/source/layout/generic/nsFrame.cpp#169
 2. Click on any word, e.g. on the word "props" at the beginning of the InitBoxMetrics function.

The page freezes for over two seconds until the menu pops up.

As a point of comparison, searchfox highlights on hover without impacting performance at all.
IIRC, there's an inefficient iteration in there. We should switch to something more efficient.
(Assignee)

Comment 2

2 years ago
Actually the freeze happens because our highlighting causes a re-layout (or two, when something is already highlighted), since adding <mark /> wrapper changes the DOM structure.

I'll take this bug, and expect to put up a patch pretty soon.
(Assignee)

Updated

2 years ago
Assignee: nobody → peter.elmers

Comment 4

2 years ago
Commit pushed to master at https://github.com/mozilla/dxr

https://github.com/mozilla/dxr/commit/275f7a2cb5840c67cc4b2a9aa66411c7d156acd4
Avoid reflow on click by unwrapping and removing padding (#559)

Fixes bug 1279001 (probably)

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.