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

feat(css-parser): CSS Parser: namespace at rule #1472

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

denbezrukov
Copy link
Contributor

Summary

namespace at rule.

https://developer.mozilla.org/en-US/docs/Web/CSS/@namespace#specifications

@namespace <namespace-prefix>? [ <string> | <url>] ;

Test Plan

cargo test

Copy link

netlify bot commented Jan 8, 2024

Deploy Preview for biomejs canceled.

Name Link
🔨 Latest commit 08202d4
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/659c2fd9ca67b60008070d3b

@github-actions github-actions bot added A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-CSS Language: CSS labels Jan 8, 2024
Copy link
Contributor

github-actions bot commented Jan 8, 2024

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 49701 49701 0
Passed 48721 48721 0
Failed 980 980 0
Panics 0 0 0
Coverage 98.03% 98.03% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6322 6322 0
Passed 2036 2036 0
Failed 4286 4286 0
Panics 0 0 0
Coverage 32.20% 32.20% 0.00%

ts/babel

Test result main count This PR count Difference
Total 662 662 0
Passed 592 592 0
Failed 70 70 0
Panics 0 0 0
Coverage 89.43% 89.43% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 17646 17646 0
Passed 13452 13452 0
Failed 4192 4192 0
Panics 2 2 0
Coverage 76.23% 76.23% 0.00%

Copy link

codspeed-hq bot commented Jan 8, 2024

CodSpeed Performance Report

Merging #1472 will degrade performances by 21.82%

⚠️ No base runs were found

Falling back to comparing feat/css-namespace (08202d4) with main (c1fdabc)

Summary

❌ 1 regressions
✅ 92 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main feat/css-namespace Change
big5-added.json[uncached] 2.9 ms 3.7 ms -21.82%

Comment on lines +43 to +44
// The problem is that both `url` and `src` are valid identifiers.
parse_regular_identifier(p).ok();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm hoping to figure out how to differentiate "function tokens" from identifiers soon, which the CSS spec defines as just <ident>( with no spaces in between. It'll most likely be the same way that CSS_DIMENSION_VALUE works now, where the lexer returns a special kind that can be converted to the actual kind (in this case, IDENT).

I'd thought about making the parser not skip over whitespace, but i think that just makes all of the steps in the parser more complicated, while re-casting a token to a different kind is effectively free and makes checks incredibly fast, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, having function_tokens would be better.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can go ahead and get started on that. I've got a good idea in mind already.

@denbezrukov denbezrukov merged commit 2ad817a into main Jan 8, 2024
20 of 21 checks passed
@denbezrukov denbezrukov deleted the feat/css-namespace branch January 8, 2024 20:04
@denbezrukov denbezrukov mentioned this pull request Jan 8, 2024
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants