webcomponents / webcomponents/polyfills

Shady Parts: don't call _applyStyleProperties twice

Open
#348 2 comments 0 reactions 1 assignee Claimed by @aomarks View on GitHub
Focus Area: Standards & Polyfills Package: shadycss Type: Feature wontfix
Dominant language
HTML
Stars
1.2k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

Currently, when an instance consumes a ::part rule that consumes a custom property, and native custom properties are not available, `_applyStyleProperties` ends up getting run twice. Once is the normal case, via `styleElement` when the instance is connected. Then again, after the DOM has stamped and we notice that there are part rules to handle.

It might make sense to skip the first `_applyStyleProperties` if we know that an instance might be receiving a part rule with a custom property.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.