[cssom] Shortest serialization principle with multiple minimal possibilities
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
https://drafts.csswg.org/cssom/#serialize-a-css-value
If component values can be omitted or replaced with a shorter representation without changing the meaning of the value, omit/replace them.
But there are 2 different minimal ways to represent list-style: outside none disc:
list-style: outsidelist-style: disc
And there are 3 different minimal ways to represent border: medium none currentcolor:
border: mediumborder: noneborder: currentcolor
And there are 4 different minimal ways to represent text-decoration: none solid currentcolor auto:
text-decoration: nonetext-decoration: solidtext-decoration: currentcolortext-decoration: auto
And so on with lots of shorthands. Which minimal serialization should be picked?
var {style} = document.createElement("div");
style.listStyle = "outside none disc";
style.listStyle; // Firefox: "outside". Blink/WebKit: "outside none disc"
style.border = "medium none currentcolor";
style.border; // Firefox: "medium none". Blink/WebKit: "medium none currentcolor"
style.textDecoration = "none solid currentcolor auto";
style.textDecoration; // Firefox: "none". Blink: "none solid currentcolor". WebKit: "" (CSS3 syntax not implemented)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CSSOM “serialize a CSS value” section linked in the issue and compare its shortest-serialization rule with the listed list-style, border, and text-decoration examples. The work is done when the specification clearly defines which serialization to choose when multiple minimal representations have the same meaning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100