-
-
Notifications
You must be signed in to change notification settings - Fork 156
fix(css): align !important cascade semantics + first-paint style sync (Blink) #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
CGQAQ
wants to merge
15
commits into
main
Choose a base branch
from
fix/css-important-semantics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9f7b70b to
bf1243e
Compare
a7ccd73 to
9427512
Compare
9427512 to
332723e
Compare
- Track origin (inline vs sheet) and priority during merges - Propagate inline style importance through UICommand payloads and legacy parsing - Add integration/unit tests for important precedence # Conflicts: # webf/lib/src/dom/element.dart
RuleFeatureSet now tracks usage of ::before/::after/::first-letter alongside ::first-line. StyleEngine consults the global RuleFeatureSet to avoid emitting/sending pseudo style payloads for pseudos that cannot match, and stops descending into display:none subtrees during subtree style recalculation.
StyleEngine::RecalcStyleForSubtree/RecalcStyleForElementOnly now: - Guard against missing ExecutingContext. - Cache StyleResolver/UICommandBuffer for the whole operation. - Switch subtree traversal to an explicit stack and drop unused inherited-state plumbing. - Detect display:none via CSSValueID when possible (fallback to string compare). - Reuse pseudo selector atoms and avoid redundant UTF-8 conversions for href payloads. integration_tests: wait a frame before asserting scrollWidth/clientWidth in translate transform spec. Tests: not run (not requested)
StyleEngine::RecalcStyle previously handled any dirty element that wasn't\nkInlineIndependentStyleChange by calling RecalcStyleForSubtree(*element).\nThis made self-only invalidations (InvalidatesSelf), style="" mutations,\nand animation marks using kLocalStyleChange trigger expensive subtree rule\nmatching and UI style export.\n\nHandle kLocalStyleChange via RecalcStyleForElementOnly and clear the dirty\nbit. Subtree recalcs are now reserved for kSubtreeStyleChange and the\nexplicit ForceRecalcDescendants path.\n\nThis keeps semantics while avoiding unnecessary DOM subtree traversal.
…perties - Introduced `text-wrap` shorthand and its longhands: `text-wrap-mode`, `text-wrap-style`. - Added `white-space-collapse` as a `white-space` longhand. - Enhanced rendering logic to resolve shorthand and longhand properties. - Updated tests to validate property application and inheritance behaviors.
…adedStyleDeclaration` - Updated all instances and references across `style_declaration.dart`, `element.dart`, and related tests. - Enhances clarity by aligning the name with its broader styling role.
…-space-collapse` - Verify `white-space` computation based on the `white-space-collapse` and `text-wrap` properties. - Ensure correct parsing and shorthand/longhand behavior for `text-wrap`. - Test layout effects of toggling `text-wrap-mode`. - Validate behavior of `white-space-collapse: preserve-breaks` preserving line breaks in layout.
332723e to
96d4ed8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes CSS
!importantprecedence inconsistencies across cascade/inline style paths and improves first-paint style synchronization (Blink) to avoid stalegetComputedStyle()/visual mismatches.Key Changes
!importantsemantics across cascade merge (track origin + priority; preserve correct precedence between inline vs stylesheet).ExecutingContext::MaybeCommitFirstPaintStyleSyncand wireDocument::UpdateStyle()to clear first-paint barriers after synchronous updates.text-wrap+white-space-collapse; ignore invalidgapvalues to preserve layout.ElementInlineStyleDeclaration→ElementCascadedStyleDeclaration; gate pseudo emissions; stabilize style export traversal; treatkLocalStyleChangeas element-only; reorganize mutex locking inUICommandPackageRingBuffer::Reset.How To Test
node scripts/run_bridge_unit_test.jscd webf && flutter testcd integration_tests && npm run integration