Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm test
- run: npx --yes --package @playwright/cli@0.1.17 playwright install --with-deps chromium webkit firefox
- run: npm run test:browser:runtime
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/test/png.test.mjs

# Generated and machine-local files
/dist/
/.playwright-cli/
/output/
/node_modules/
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Call `refreshAdoptedStyleSheet()` again with the same standard source passed to
- `border-radius` and `corner-shape` shorthands and longhands, physical and logical corners, elliptical percentages, the implemented `calc()` subset, overlap reduction, and opposite-concave constraints.
- Solid colors, static same-origin or CORS raster layers and atlas crops, and non-repeating linear, radial, and conic gradients within the implemented grammar.
- Admitted background stacks with sizing, positioning, repetition, origin, and clip. The explicit runtime also admits one opaque scroll-attached raster using `multiply` over one opaque `rgb()` or hex color.
- One-color solid borders with unequal widths, one zero-offset zero-blur inset shadow with non-negative spread, and one fully contained solid outline on an empty paint-owned host.
- One-color solid borders with unequal widths when the clipped inner edge remains one non-self-intersecting contour, one zero-offset zero-blur inset shadow with non-negative spread, and one fully contained solid outline on an empty paint-owned host.
- Observed generic elements and a lower-overhead caller-clocked prepared path for retained renderers.
- Automatic variables, direct corner-shape `@supports` declarations, media rules, named layers, stateful selectors, recursive imports, and explicitly registered open roots within the source boundary above.

Expand Down Expand Up @@ -170,6 +170,7 @@ cornerfill.destroy();
- The fallback owns the host background, supported border, radius, shadow, and outline paint. Author `!important` declarations that prevent that ownership are rejected.
- Descendant overflow clipping, shaped hit testing, replaced-content clipping, multi-fragment boxes, and shaped `backdrop-filter` clipping are not available. Pseudo-elements remain on the host but do not gain a shaped overflow clip.
- Outer shadows, outlines outside the border box, `border-shape`, `border-image`, per-side border colors, and non-solid border styles are not implemented.
- Rare combinations of concave corners, radii, and unequal border widths can make the clipped inner border edge self-intersect and require multiple contours. Cornerfill refuses those elements before mutating their paint surface instead of approximating the border.
- Animated CSS images, cross-origin images without CORS, general `image-set()` selection, repeating gradients, and gradient interpolation spaces or hints are outside the supported paint grammar.
- General background blending is not supported. Automatic mode cannot prove raster opacity, so the bounded `multiply` path is explicit-runtime only.
- Automatic discovery supports one physical or logical declaration family at a time. Mixed families and keyframe-driven fallback paint are rejected. The explicit value API can resolve physical and logical declarations together.
Expand All @@ -183,10 +184,13 @@ Cornerfill refuses unsupported cases instead of painting a result with different
## Development

```sh
npm run build
npm test
npm run test:browser:runtime
```

TypeScript `.mts` modules are the source of truth. The build writes browser-ready `.mjs` files and matching declarations to `dist/`.

## License

Cornerfill is [MIT licensed](LICENSE).
8 changes: 4 additions & 4 deletions bench/runtime-regression.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { qualifyNativeCornerShape } from "../src/native.mjs";
import { qualifyNativeCornerShape } from "../dist/native.mjs";

const backend = new URL(location.href).searchParams.get("backend") ?? "static-data-url";
const results = [];
Expand Down Expand Up @@ -152,7 +152,7 @@ await test("automatic install consumes standard corner-shape CSS and tears down"
escaped.className = "cornerfill:escaped";
document.body.append(toggle);
document.body.append(element, dynamic, inline, focus, media);
const { cornerfill: auto } = await import("../src/auto.mjs");
const { cornerfill: auto } = await import("../dist/auto.mjs");
await auto.ready;
rootImportResources = Object.freeze(performance.getEntriesByType("resource")
.map(({ name }) => new URL(name).pathname));
Expand Down Expand Up @@ -334,8 +334,8 @@ await test("automatic install consumes standard corner-shape CSS and tears down"
link.remove();
});

({ installCornerfill } = await import("../src/index.mjs"));
({ installCornerfillAuto } = await import("../src/auto-runtime.mjs"));
({ installCornerfill } = await import("../dist/runtime.mjs"));
({ installCornerfillAuto } = await import("../dist/auto-runtime.mjs"));

await test("automatic stylesheet refresh is serialized, stale-safe, and retryable", async () => {
globalThis.__CORNERFILL_TEST_STAGE__ = "stylesheet setup";
Expand Down
Loading
Loading