Open Bug 557655 Opened 14 years ago Updated 2 years ago

consider not doing history lookups until paint time

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

People

(Reporter: dbaron, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [visited-privacy])

Given the changes made in bug 147777, we could (with the use of an extra style context bit) move towards a model where we don't do history lookups for links until we paint.  This would have the advantage of not paying the performance cost of history lookups for offscreen links during page load, but the disadvantage of having the asynchronous link coloring delay when scrolling.  (We could probably also come up with an in-between solution in which lookups for offscreen links are deferred until things are less busy.)
(In reply to comment #0)
> (We could probably also come up with an in-between solution in which lookups
> for offscreen links are deferred until things are less busy.)
I really like this solution!
That sounds great if we can quickly detect the state of being "offscreen".
The idea wouldn't be to have code to detect being offscreen, but just not to try to do the lookup at all until we try to paint, which would mean a slightly later start for the async lookup.
... to be more specific, until somebody calls GetVisitedDependentColor on the style context, which would be called by a bunch of callers when elements are painted, and also by other callers (getVisitedDependentComputedStyle, which is test-only).
I was specifically referring to the parenthetical of comment 0.
Yeah, I was by "offscreen" I meant "not painted".  In other words, the parenthetical would work by putting all links in the "low priority" queue when we create the content node and bumping them to "high priority" if we paint them.
Whiteboard: [visited-privacy]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.