Blink286

blink::StyleEngine


Listen Later

style invalidation & resolution (recalc). 
Given DOM/style changes since the last frame, StyleEngine computes updated ComputedStyles, manages active stylesheets/media query state, and marks the right subtrees dirty for style/layout. This sets up accurate inputs to layout. (Chromium Git Repositories)

Key fields

* StyleResolver* resolver_ — the style resolver used to compute ComputedStyles; created lazily. (Chromium Git Repositories)

* PendingInvalidations pending_invalidations_ — tracks nodes needing restyle due to stylesheet/DOM/class/attribute changes. (Chromium Git Repositories)

Most important methods (and how they push pixels forward)

* StyleResolver& EnsureResolver() — makes sure a resolver is ready before recalc. (Chromium Git Repositories)

* void UpdateActiveStyle() — updates active sheets/media‑query driven state before resolving. (Chromium Git Repositories)

* void RecalcStyle(StyleRecalcChange) — does the actual style recalc walk, marking what changed for layout/paint. (Chromium Git Repositories)

* A large set of ...ChangedForElement(...) and ScheduleInvalidations...(...) helpers — turn DOM/sheet churn into precise invalidations (minimizing layout/paint cost). (Chromium Git Repositories)

Hands off to: Layout (LayoutNG) with up‑to‑date ComputedStyle.

...more
View all episodesView all episodes
Download on the App Store

Blink286By Free Debreuil