Repository navigation
fix(csslib): preserve group expressions and declaration flags in clones - #15
Conversation
PR HealthPublish ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with
API leaks
|
| Package | Leaked API symbol | Leaking sources |
|---|---|---|
| csslib | Messages | csslib/parser.dart::Analyzer::new::_messages messages.dart::Messages::mergeMessages::newMessages csslib/parser.dart::TopLevelIncludes::expand::messages csslib/parser.dart::TopLevelIncludes::new::_messages csslib/parser.dart::DeclarationIncludes::expand::messages csslib/parser.dart::DeclarationIncludes::new::_messages csslib/parser.dart::InheritExtends::new::_messages csslib/parser.dart::PolyFill::new::_messages |
This check can be disabled by tagging the PR with skip-leaking-check.
Unused Dependencies ✔️
| Package | Status |
|---|---|
| csslib | ✔️ All dependencies utilized correctly. |
For details on how to fix these, see dependency_validator.
This check can be disabled by tagging the PR with skip-unused-dependencies-check.
License Headers ✔️
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
| Files |
|---|
| no missing headers |
All source files should start with a license header.
Unrelated files missing license headers
| Files |
|---|
| pkgs/html/test/differential_test.dart |
| pkgs/html/test/dom_parsing_test.dart |
| pkgs/html/test/mxss_test.dart |
| pkgs/html/test/noah_ark_clause_limit_test.dart |
This check can be disabled by tagging the PR with skip-license-check.
Coverage ✔️
| File | Coverage |
|---|---|
| pkgs/csslib/lib/src/tree.dart | 💚 75 % ⬆️ 0 % |
This check for test coverage is informational (issues shown here will not fail the PR).
This check can be disabled by tagging the PR with skip-coverage-check.
1ecc365 to
7f4fae0
Compare
Problem
GroupTerm.clone()returned an empty group, losing its entire expression.Declaration.clone()did not propagate the legacy IE7 flag, so*zoombecamezoomwhen cloned.VarDefinition.clone()reset the analyzer'sbadUsagestate.These clones are used by the analyzer when expanding
@includeof declaration mixins, so@mixin m { *zoom: 1; width: (2 5); } div { @include m; }compiled tozoom: 1; width: ();.Fix
Deep-clone all literal terms in
GroupTerm, preserveisIE7in declaration clones and carry the variable'sbadUsagestate. Public APIs and source spans are unchanged.Tests
declaration_group_clone_test.dartcovers group roundtrip with list independence,*zoom: 1 !important, variable invalid-usage state, and the end-to-end mixin include case. All four tests fail onmainand pass with this change. Changelog entry added.QA
dart format --output=none --set-exit-if-changed .,dart analyze --fatal-infosanddart test(186 passed, 1 skipped) are clean inpkgs/csslib.Overlap: #16 rewrites
Declaration.clone()and also addsie7: isIE7; the textual conflict resolves to #16's version. CHANGELOG conflicts with the other csslib PRs of this round are list-order only.