Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Replace CSSOM so new CSS features are supported

Aperta
#318 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
css, javascript
Ambito
frontend, web-dev

Direzione di ricerca

Inizia con l’esempio parseHTML nell’issue e analizza come linkedom integra CSSOM; non sono indicati né un file sorgente né un test. Confronta il comportamento attuale di CSSOM con i parser candidati del benchmark collegato. Il lavoro è completato quando il CSS annidato e altre regole CSS moderne vengono analizzati senza eccezioni, mantenendo accettabili la funzionalità CSS necessaria e le performance.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi,

I noticed that currently linkedom fails to parse styles with nested CSS rules. Here's a sample code:

import {parseHTML} from "linkedom";

const doc = parseHTML(`
<style>
	.parent { .child { color: red; }}
</style>
`).document;
console.log(doc.children[0].sheet);

Looking into it, it seems like this is an issue with CSSOM, which makes sense considering that project stopped receiving updates 5 years ago and is marked as unmaintained. Although I didn't check, I assume other kinds of 'modern' CSS rules will also raise an exception when parsed.

I would like to know if there is interest in replacing it with an up-to-date CSS parser implementation.

Looking online, I found a benchmark that shows that a few other CSS parsers more or less match the performance of CSSOM, which I know is an important factor for this project.

If this is desired I can take a look into changing the backing implementation, probably trying the projects in the order they appear in that benchmark (I don't know which of those provides the functionalities linkedom requires).

Lingua principale
HTML
Stelle
2.1k
Fork
104
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebReflection/linkedom

Tutte le issue di WebReflection/linkedom

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.