Skip to content

Commit 08ad98b

Browse files
author
wangnaihe
committed
feat: CSS pseudo-class/attribute selectors, localStorage, TextEncoder, shell apps
- CSS pseudo-class selectors: :hover, :focus, :active, :first-child, :last-child, :nth-child(An+B), :only-child, :empty, :not(), etc. - CSS attribute selectors: [attr], [attr=value], [attr^=], [attr$=], [attr*=], [attr~=], [attr|=] - Value type: bitwise ops, power operator, in operator, property access - localStorage API with JSON file persistence (~/.w3cos/storage/) - TextEncoder/TextDecoder (UTF-8, UTF-16LE/BE, ASCII, BOM handling) - Desktop Shell: add Browser and Editor application views - Update ROADMAP.md and README.md to reflect new capabilities Made-with: Cursor
1 parent 422ef7d commit 08ad98b

File tree

8 files changed

+1431
-27
lines changed

8 files changed

+1431
-27
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,22 @@ Runs directly on hardware ← No runtime
175175
| Flexbox / Grid | ✅ Full |
176176
| Block layout ||
177177
| `position: relative / absolute` ||
178-
| `position: fixed / sticky` | 🔜 |
178+
| `position: fixed / sticky` | |
179179
| `overflow: hidden / scroll` ||
180180
| `z-index` ||
181181
| Units: `px, %, rem, em, vw, vh` ||
182182
| `border-radius`, `opacity` ||
183183
| `box-shadow` ||
184184
| `transform: translate / scale / rotate` ||
185185
| `transition` (easing functions) ||
186-
| `display: inline / inline-block` | 🔜 |
186+
| `@keyframes` animation ||
187+
| `display: inline / inline-block` ||
188+
| `@layer` cascade layers ||
189+
| `@media` queries ||
190+
| Container Queries ||
191+
| Pseudo-classes (`:hover`, `:focus`, `:nth-child`, etc.) ||
192+
| Attribute selectors (`[attr=value]`) ||
193+
| CSS Custom Properties (`var(--x)`) ||
187194
| Mouse events (hover, click) ||
188195

189196

@@ -192,19 +199,23 @@ Runs directly on hardware ← No runtime
192199
```
193200
w3cos/
194201
├── crates/
202+
│ ├── w3cos-core/ # JS-compatible Value type, reactive system, Proxy
195203
│ ├── w3cos-std/ # Type definitions (Style, Component, Color)
196204
│ ├── w3cos-dom/ # W3C DOM API (Document, Element, Events)
197205
│ ├── w3cos-a11y/ # Accessibility tree (ARIA, for AI + screen readers)
198206
│ ├── w3cos-ai-bridge/ # AI agent interface (3-layer access + permissions)
199-
│ ├── w3cos-compiler/ # TS → Rust transpiler
200-
│ ├── w3cos-runtime/ # Layout + Rendering + Window + Events
201-
│ └── w3cos-cli/ # CLI: w3cos build / w3cos run
207+
│ ├── w3cos-compiler/ # TS → Rust transpiler (SWC parser + CSS/SCSS)
208+
│ ├── w3cos-runtime/ # Layout + Rendering + Window + System APIs
209+
│ ├── w3cos-cli/ # CLI: w3cos build / run / dev / init
210+
│ ├── w3cos-shell/ # System-level desktop shell binary
211+
│ ├── w3cos-demo/ # Showcase demo binary
212+
│ └── w3cos-rn-compat/ # React Native API compatibility layer
202213
├── system/
203214
│ ├── buildroot/ # Bootable ISO config
204215
│ ├── rootfs_overlay/ # System init scripts
205216
│ ├── scripts/ # build-iso.sh, run-qemu.sh
206217
│ └── INSTALL.md # Installation guide
207-
├── examples/ # 4 example applications
218+
├── examples/ # 18+ example applications
208219
├── .openclaw/ # OpenClaw + Lobster AI workflow configs
209220
├── .devcontainer/ # One-click dev environment
210221
├── Dockerfile # Container build

ROADMAP.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
- [x] Dynamic dependency generation (needs_core/needs_async/needs_rc/needs_fetch flags)
5151
- [x] Compiler: fetch() → w3cos_runtime::fetch bridge codegen
5252
- [ ] Escape analysis optimization for Rc<RefCell<T>> elision (P5)
53-
- [ ] typeof operator runtime support via Value::type_of()
53+
- [x] typeof operator runtime support via Value::type_of() + standalone type_of() function
5454

5555
## Phase 2 — System APIs & Production Quality ✅
5656
- [x] GPU rendering (Vello + wgpu — replace tiny-skia, CPU fallback via feature flag) (#12)
@@ -140,16 +140,17 @@
140140
## Phase 2.75 — VS Code Compatibility (see docs/vscode-compat.md)
141141
- [ ] Canvas 2D API (CanvasRenderingContext2D) (#32)
142142
- [ ] Selection API (window.getSelection, Range) (#37)
143-
- [ ] CSS pseudo-class selectors (:hover, :focus, :active, :first-child, :nth-child)
144-
- [ ] CSS attribute selectors ([attr], [attr=value])
143+
- [x] CSS pseudo-class selectors (:hover, :focus, :active, :first-child, :last-child, :nth-child, :only-child, :empty, :not(), :disabled, :enabled, :checked)
144+
- [x] CSS attribute selectors ([attr], [attr=value], [attr^=value], [attr$=value], [attr*=value], [attr~=value], [attr|=value])
145145
- [ ] Web Workers
146146
- [ ] WebSocket API
147-
- [ ] localStorage / IndexedDB
147+
- [x] localStorage (Web Storage API with JSON file persistence)
148+
- [ ] IndexedDB
148149
- [ ] w3cos.dialog (open/save/message dialogs)
149150
- [ ] w3cos.ipc (inter-process communication)
150151
- [ ] w3cos.menu (application/context menus)
151152
- [ ] RegExp (full JS spec)
152-
- [ ] TextEncoder / TextDecoder
153+
- [x] TextEncoder / TextDecoder (UTF-8, UTF-16LE/BE, ASCII, BOM handling)
153154

154155
## Phase 3 — Compatibility & Migration
155156
- [ ] React Native app auto-migration tool (`w3cos migrate --from rn`)

0 commit comments

Comments
 (0)