Skip to content

Commit c258fba

Browse files
committed
Separate snapshot and version
1 parent 426ee58 commit c258fba

16 files changed

Lines changed: 39 additions & 31 deletions

index.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,15 @@ <h1>Filter:</h1>
112112
<option value="whatwg" title="All specifications managed by the Web Hypertext Application Technology Working Group (WHATWG)">WHATWG</option>
113113
<option value="others" title="All specifications managed by other standardization groups">Others</option>
114114
</optgroup>
115-
<optgroup label="CSS snapshots">
116-
<option value="css2.2" title="Everything included in CSS 2.2">CSS 2.2</option>
115+
<optgroup label="Versions">
116+
<option value="v2.2" title="Everything included in CSS 2.2">CSS 2.2</option>
117+
<option value="v3" title="Everything included in CSS 3">Level 3 Specs</option>
118+
<option value="v4" title="Everything included in CSS 4">Level 4 Specs</option>
119+
<option value="v5" title="Everything included in CSS 5">Level 5 Specs</option>
120+
<option value="v6" title="Everything included in CSS 6">Level 6 Specs</option>
121+
</optgroup>
122+
<optgroup label="Snapshots">
123+
<!-- <option v-for="year in snapshots" :value="year" :title="`All specifications marked as official part of the CSS ${year} snapshot`">{{ year }}</option> -->
117124
<option value="css2007" title="All specifications marked as official part of the CSS 2007 snapshot">CSS 2007</option>
118125
<option value="css2010" title="All specifications marked as official part of the CSS 2010 snapshot">CSS 2010</option>
119126
<option value="css2015" title="All specifications marked as official part of the CSS 2015 snapshot">CSS 2015</option>

src/classes/Spec.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ export default class Spec extends AbstractFeature {
9191
return this.def.status;
9292
}
9393

94+
get version () {
95+
if (this.def.version) {
96+
return this.def.version;
97+
}
98+
99+
if (/\d$/.test(this.id)) {
100+
return Number(this.id.match(/\d+$/)?.[0]);
101+
}
102+
}
103+
94104
get firstSnapshot () {
95105
return this.def.firstSnapshot;
96106
}
@@ -133,7 +143,8 @@ export default class Spec extends AbstractFeature {
133143

134144
matchesFilter (filter) {
135145
if (!filter) {
136-
return this.firstSnapshot !== 2.2;
146+
// TODO this makes no sense outside CSS
147+
return !this.version || this.version > 2.2;
137148
}
138149

139150
if (filter === 'all') {
@@ -145,6 +156,10 @@ export default class Spec extends AbstractFeature {
145156
return this.status === filter;
146157
}
147158

159+
if (filter.match(/^v\d/)) {
160+
return this.version === Number(filter.substring(1));
161+
}
162+
148163
if (filter.match(/^css\d/)) {
149164
if (!this.firstSnapshot) {
150165
return false;

tests/css2-box.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export default {
2626
dev: 'css2/',
2727
},
2828
status: 'stable',
29-
firstSnapshot: 2.2,
30-
lastSnapshot: 2.2,
29+
version: 2.2,
3130
properties: {
3231
border: {
3332
link: '#border-shorthand-properties',

tests/css2-cascade.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
dev: 'css2/',
77
},
88
status: 'stable',
9-
firstSnapshot: 2.2,
10-
lastSnapshot: 2.2,
9+
version: 2.2,
1110
values: {
1211
properties: ['color', 'border-color'],
1312
inherit: {

tests/css2-colors.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
dev: 'css2/',
77
},
88
status: 'stable',
9-
firstSnapshot: 2.2,
10-
lastSnapshot: 2.2,
9+
version: 2.2,
1110
properties: {
1211
'background-attachment': {
1312
link: '#propdef-background-attachment',

tests/css2-fonts.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
dev: 'css2/',
77
},
88
status: 'stable',
9-
firstSnapshot: 2.2,
10-
lastSnapshot: 2.2,
9+
version: 2.2,
1110
properties: {
1211
'font-family': {
1312
link: '#font-family-prop',

tests/css2-generate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
dev: 'css2/',
77
},
88
status: 'stable',
9-
firstSnapshot: 2.2,
10-
lastSnapshot: 2.2,
9+
version: 2.2,
1110
properties: {
1211
content: {
1312
links: {

tests/css2-media.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
dev: 'css2/',
77
},
88
status: 'stable',
9-
firstSnapshot: 2.2,
10-
lastSnapshot: 2.2,
9+
version: 2.2,
1110
mediaqueries: {
1211
Syntax: {
1312
link: '#at-media-rule',

tests/css2-page.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
dev: 'css2/',
77
},
88
status: 'stable',
9-
firstSnapshot: 2.2,
10-
lastSnapshot: 2.2,
9+
version: 2.2,
1110
atrules: {
1211
'@page': {
1312
link: '#page-box',

tests/css2-selectors.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
dev: 'css2/',
77
},
88
status: 'stable',
9-
firstSnapshot: 2.2,
10-
lastSnapshot: 2.2,
9+
version: 2.2,
1110
selectors: {
1211
'Universal selector': {
1312
link: '#universal-selector',

0 commit comments

Comments
 (0)