[META] Investigate replacing the JS CSS lexer
Categories
(DevTools :: Inspector, task, P3)
Tracking
(Not tracked)
People
(Reporter: jryans, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
(Keywords: meta, Whiteboard: [designer-tools][stylo-])
Attachments
(1 obsolete file)
| Reporter | ||
Updated•8 years ago
|
Comment 1•8 years ago
|
||
| Reporter | ||
Updated•8 years ago
|
Comment 2•8 years ago
|
||
Updated•7 years ago
|
| Reporter | ||
Comment 3•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Comment 4•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 5•2 years ago
|
||
In some early analysis for Bug 1836873 , I came across our JS-written CSS lexer again, which I guess should be modified to account for the new syntax added for CSS Nesting.
I was wondering if that would be a good time to try to revive this specific bug instead of replicating work that was already done on the platform.
Another solution that we could consider is to allow (privileged) JS to directly call the Stylo Lexer, so we won't have to go through the WASM conversion (at the time this bug was created, we wanted to get rid of privileged code in DevTools, but this isn't the case anymore).
Emilio, what do you think about this? Does this sounds like something that would be hard to do/not worth the benefit?
Comment 6•2 years ago
|
||
What kind of API would you need from the platform? cssparser is rather standalone so compiling to wasm shouldn't be hard in theory... But if a WebIDL/XPIDL api is simpler that's fine too. Do you just want a tokenized range of source text? Something else
| Assignee | ||
Comment 7•2 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)
What kind of API would you need from the platform? cssparser is rather standalone so compiling to wasm shouldn't be hard in theory... But if a WebIDL/XPIDL api is simpler that's fine too. Do you just want a tokenized range of source text? Something else
Yeah a tokenizer would be great so we can replace https://searchfox.org/mozilla-central/rev/27e4816536c891d85d63695025f2549fd7976392/devtools/shared/css/parsing-utils.js#42-111
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 8•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 9•1 year ago
|
||
I have a somewhat working c++/rust implementation to iterate over the tokens so I could see the impact on getRuleText, which currently uses the lexer (won't be the case after Bug 1882964 , but this is an easy way to assert the impact):
- before https://share.firefox.dev/496zknG , ~530ms
- after https://share.firefox.dev/3vp3Zir ~140ms , so almost 4 times faster
Comment 10•1 year ago
|
||
Comment on attachment 9387991 [details]
Bug 1410184 - [devtools] Add InspectorUtils.getCSSParser method. r=emilio.
Revision D202909 was moved to bug 1887638. Setting attachment 9387991 [details] to obsolete.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 11•1 year ago
|
||
All blockers are now fixed
Description
•