Skip to content

Commit

Permalink
Make CSSToggleMap.set("none", ...) throw SyntaxError.
Browse files Browse the repository at this point in the history
This implements the one change in the spec edit at
tabatkins/css-toggle@c034d41
that we didn't already implement.  (The spec edit was fixing an issue
that I filed, and I'd already implemented the other changes in the spec
edit, but hadn't thought about this case.)

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ic205ee56cd2fac9508688f3e58ecfc5db2d45268
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3859688
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1039926}
  • Loading branch information
dbaron authored and chromium-wpt-export-bot committed Aug 26, 2022
1 parent a9974ce commit 8ba3353
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions css/css-toggle/toggle-api.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
assert_equals(b.toggles.get("newtoggle"), undefined, 'b.toggles.get("newtoggle") after rename');
assert_equals(b.toggles.get("newname"), t, 'b.toggles.get("newname") after rename');

assert_throws_dom("SyntaxError", () => { a.toggles.set("none", t); },
"setting toggle_name to 'none'");
assert_equals(a.toggles.size, 0, "a.toggles.size after failed set");
assert_equals(b.toggles.size, 1, "b.toggles.size after failed set");
assert_equals(b.toggles.get("newname"), t, "b.toggles.get after failed set");

// TODO(https://crbug.com/1250716): Should the toggle on a be
// re-created at some point? If so, when?

Expand Down

0 comments on commit 8ba3353

Please sign in to comment.