Skip to content
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

Deprecate bogus combinators #1740

Merged
merged 2 commits into from Jul 18, 2022
Merged

Deprecate bogus combinators #1740

merged 2 commits into from Jul 18, 2022

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Jul 14, 2022

@nex3 nex3 force-pushed the complex-component branch 4 times, most recently from 44a8ea2 to 015599a Compare July 15, 2022 01:53
@nex3 nex3 marked this pull request as ready for review July 15, 2022 22:47
@nex3 nex3 requested a review from jathak July 15, 2022 22:47
CHANGELOG.md Outdated Show resolved Hide resolved
lib/src/ast/selector/combinator.dart Show resolved Hide resolved
const AnySelectorVisitor();

bool visitComplexSelector(ComplexSelector complex) => complex.components
.any((component) => visitCompoundSelector(component.selector));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this calls visitCompoundSelector directly instead of component.selector.accept(this)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just avoids an unnecessary layer of calls, especially since highly polymorphic calls like accept() tend to be particularly difficult for JIT VMs to optimize.

dependency_overrides:
source_span:
git:
url: https://github.com/dart-lang/source_span
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this PR also be marked as blocked on dart-lang/source_span#86?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't release with a Git dependency, but it's fine to have one for -dev versions.

@nex3 nex3 merged commit 4b53c16 into main Jul 18, 2022
@nex3 nex3 deleted the complex-component branch July 18, 2022 23:16
var selector = pseudo.selector;
if (selector == null) return false;

// The CSS spec specifically allows leading combinators in `:has()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS spec allows 1 leading combinator.

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.

None yet

3 participants