Skip to content

fix(window): honor final duplicate feature values - #2436

Merged
ldm0 merged 1 commit into
lexmount:mainfrom
mertkayacs:fix/window-feature-duplicates
Nov 6, 2026
Merged

ldm0 merged 1 commit into
lexmount:mainfrom
mertkayacs:fix/window-feature-duplicates

Conversation

@mertkayacs

Copy link
Copy Markdown
Contributor

WindowOpenFeatures::parse replayed every raw occurrence of a feature after tokenizing, so an earlier location=yes or toolbar=yes survived a later =no duplicate. The HTML tokenizer keeps only the last value for each name (tokenize the features argument), and popup classification reads from that map. So location=yes,location=no,menubar=yes,scrollbars=yes,status=yes,resizable=yes should open a popup, and Moli opened a normal window.

I dropped the private raw-entry list and parse the existing ordered map, so the last value wins for every feature. The public API doesn't change. The tests cover both duplicate orders for every popup input, plus the sequence above.

Tested:

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test -p moli-window-features
  • cargo test -p moli-renderer-v8 script_vm::tests::browser_api::bar_prop::bar_props_follow_popup_features_and_close -- --exact

The full cargo nextest run didn't fit in the disk space I had, so that one is left to CI.

@ldm0
ldm0 self-requested a review November 6, 2026 02:49
@ldm0

ldm0 commented Nov 6, 2026

Copy link
Copy Markdown
Member

LGTM, thanks!

@ldm0
ldm0 merged commit 1da94d6 into lexmount:main Nov 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants