Repository navigation
fix(csslib): preserve Dart style priority and isolate cloned font families - #16
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 | 💚 79 % ⬆️ 4 % |
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.
50a7f36 to
ef1fd77
Compare
Findings
FontExpression.clone()shared its mutableFont.familylist with the original.DartStyleExpression.clone()implementations dropped theprioritymetadata.Declaration.clone()reused the mutabledartStyleAST object instead of cloning it, so mutating the copy could modify the original declaration. It also dropped the IE7 flag, so a*propertyhack inside a mixin lost its*when the mixin was included.Fix
Clone the declaration's Dart style payload and keep the IE7 flag; copy font-family lists; propagate
priorityfor font, margin, border, padding, height and width styles.Regression tests
dart_style_clone_test.dart: detached family lists and declaration styles, preserved priority for all style kinds, mutation independence.mixin_test.dart:*color: redinside a mixin keeps its*after@include.All four tests fail against
main'slib/and pass here.QA
dart format --set-exit-if-changed .,dart analyze --fatal-infosanddart test(186 passed, 1 skipped) are clean inpkgs/csslib.Overlaps
ie7: isIE7inDeclaration.clone()(with its own test and CHANGELOG entry). The two versions conflict textually intree.dart; resolve by keeping this PR'sDeclaration.clone()body.1.0.3-wipCHANGELOG list.