Repository navigation
fix(css): report extraFields in getComputedStyleForNode - #2805
Merged
Merged
Conversation
lanyue-llk
commented
Nov 12, 2026
lanyue-llk
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent review of af43174
No blocking findings
- Correctness:
computed_style_result(moli-protocol/src/domains/css.rs:526-534) is the single builder for both the legacy path (css.rs:489) and the native path (css/native.rs:169), so every successfulgetComputedStyleForNoderesponse now carriesextraFields. Shape matches the CDP protocol JSON:extraFields: $ref ComputedStyleExtraFields(not optional), with the single required booleanisAppearanceBase. The not-found error path is unchanged. No other CSS command is touched. - Value: hard-coded
falseis correct for moli today. moli does not implementappearance: base/base-select. With v1.1.23 andselect,::picker(select){appearance:base-select},getComputedStyle(select).appearanceisauto,CSS.supports("appearance","base-select")andCSS.supports("appearance","base")are bothfalse, and the::picker(select)computedappearanceisnone. moli recognizes the::picker(select)pseudo-element only for getComputedStyle; it does not render base appearance. So no element can be rendered with base appearance, andfalseagrees with moli's own computed style. If moli later addsappearance: base-select, this constant has to be derived from the computed style at that point. - Test: the assertion added at
css.rs:979-982fails on main, where the field is absent, and passes here. It locks in only Chromium's shape and value for a non-base element. - Cost: one constant field per response. The numbers in the body are within noise and plausible.
- CI: Clippy, Format, Python, Node and Windows checks pass. Nextest, CDP smoke and Build release were still pending when I reviewed.
- Picture: pending.
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
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.

Closes #2783. Replaces part of #731.Problem
CSS.getComputedStyleForNodereturned onlycomputedStyle. Chromium also returnsextraFields: {"isAppearanceBase": false}, and typed CDP clients that treat it as required (e.g. Rustchromiumoxide_cdpGetComputedStyleForNodeReturns) reject moli's response. Repro:DOM.getDocument,DOM.querySelector body,CSS.getComputedStyleForNode {nodeId}.Change
moli-protocol/src/domains/css.rs(computed_style_result): addextraFields: {isAppearanceBase: false}. moli does not implementappearance: base, sofalseis the correct value for every element. The existingcss_loaded_page_methods_target_background_owner_without_activationtest now asserts the field.Verification
Before: debug build of
origin/mainf935014; after: debug build of this branch.cargo fmt --all: clean.cargo clippy -p moli-protocol --all-targets --all-features -- -D warnings: passed.cargo nextest run -p moli-protocol -E 'test(css)': 36 passed.Cost
Debug builds,
/usr/bin/time -l, median of 5 runs (repro: two interleaved rounds):moli serve)moli fetchof a local 46 KB articleOne constant JSON field per
getComputedStyleForNoderesponse; no other path is touched.