Automattic / Automattic/data-liberation-agent
Tolerate malformed captured CSS during responsive export
- Dominant language
- TypeScript
- Stars
- 31
- Forks
- 3
- Avg merge
- 10h 14m
- Merged PRs (30d)
- 81
Description
## Problem
A Wix mobile DOM can contain a malformed declaration in an inline stylesheet. Browser CSS recovery preserves declarations following the malformed fragment, while DLA fails the entire export when responsive style scoping passes the sheet to PostCSS.
## Minimal reproduction
```css
#Cntnr2 {
--shd: 0 1px 4px rgba(0,0,0,0.6););
--brw: 0px;
}
```
A browser retains the following `--brw` declaration. The current `scopeCss()` path throws `CssSyntaxError: Unknown word )`, blocking export.
## Acceptance
- Valid CSS remains byte-for-byte/behaviorally scoped as before.
- Malformed captured declaration fragments do not prevent responsive export.
- Browser-recovered declarations after the malformed fragment are retained and receive the normal scope.
- The repair is generic, parser-compatible, and covered by focused tests.
## AI assistance
OpenAI `gpt-5.6-terra` via OpenCode investigated the retained capture, verified browser recovery, and drafted this issue. Chris Huber directs the work.
Contributor guide
Research direction
Start at the scopeCss() path that passes captured stylesheets to PostCSS, then reproduce the malformed declaration shown in the issue. Add focused tests for valid CSS, malformed fragments, and declarations following the fragment; done means responsive export succeeds and recovered declarations receive the normal scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, typescript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100