Closed Bug 1293768 Opened 8 years ago Closed 6 years ago

stylo: Skip style computation for elements which we can determine at traversal time do not need it

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox57 --- wontfix

People

(Reporter: bholley, Unassigned)

References

(Blocks 1 open bug)

Details

I believe Emilio already has a patch somewhere to avoid computing styles for nodes that are neither elements nor text nodes [1]. If he doesn't, that patch should be a part of this bug.

The main piece I wanted to track here is to detect certain cases where we don't need to construct frames and don't have any children either.


[1] The discussion for what to do about text nodes is in bug 1292729.
 In bug 1293478 comment 4, dbaron writes:

(In reply to David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) from comment #4)
> I think in many of those special cases (e.g., iframe, noscript) we either
> never need the styles for the descendants or we can determine very quickly
> whether we need them.  (We can probably determine pretty quickly for object
> as well.)

I suppose there's always the possibility that somebody might call getComputedStyle, but we can compute lazily in that case.
Yes, we lazily compute style contexts for non-displayed things currently in nsComputedDOMStyle::UpdateCurrentStyleSources.
(In reply to Bobby Holley (:bholley) (busy with Stylo) from bug 1293478 comment #3)
> How easily detectable are the other cases? Are they listed somewhere?

There's no list as far as I know.  The cases I'm familiar with are those where we return SUPPRESS_FCDATA in nsCSSFrameConstructor's FindXXXData methods, but there are probably other places in the frame constructor that don't use FrameConstructionData to drive the decision to not generate a frame.
Priority: -- → P4
Summary: Skip style computation for elements which we can determine at traversal time do not need it → stylo: Skip style computation for elements which we can determine at traversal time do not need it
status-firefox57=wontfix unless someone thinks this bug should block 57
There's nothing left to do here, right Emilio?
Flags: needinfo?(emilio)
Right.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(emilio)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.