A canvas scope can be a promise, not only a sanitiser's contract
Node::Canvas carries a class and an id because a re-scoped creator
stylesheet needs both. The same is true of a block the app draws itself and
has published a name for: MNW's guide tells creators the buy block is
.mnw-buy, the file list .mnw-files and the item block .mnw-item, with worked
CSS against them, and a renderer that prefixed or renamed those would
silently stop every creator page that styles one.
So an empty markup with only within is an ordinary shape rather than a
degenerate one: described content, under a name the app has promised. The
two uses share the whole of what the member is, which is why they are one
member. What they do not share is risk, and the doc says so: markup is
opaque and dangerous, a name is neither.
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
- Claude-Session
- https://claude.ai/code/session_01WHu5vBgpCULUFXsEJBHryC
2 files changed,
+26 insertions,
-8 deletions
| 6211 |
6211 |
|
"winnow 1.0.4",
|
| 6212 |
6212 |
|
]
|
| 6213 |
6213 |
|
|
|
6214 |
+ |
[[patch.unused]]
|
|
6215 |
+ |
name = "quasi-type"
|
|
6216 |
+ |
version = "0.1.3"
|
|
6217 |
+ |
|
|
6218 |
+ |
[[patch.unused]]
|
|
6219 |
+ |
name = "synckit-client"
|
|
6220 |
+ |
version = "0.10.0"
|
|
6221 |
+ |
|
| 6214 |
6222 |
|
[[patch.unused]]
|
| 6215 |
6223 |
|
name = "kberg"
|
| 6216 |
6224 |
|
version = "0.1.0"
|
| 6226 |
6234 |
|
[[patch.unused]]
|
| 6227 |
6235 |
|
name = "tagtree"
|
| 6228 |
6236 |
|
version = "0.4.1"
|
| 6229 |
|
- |
|
| 6230 |
|
- |
[[patch.unused]]
|
| 6231 |
|
- |
name = "quasi-type"
|
| 6232 |
|
- |
version = "0.1.3"
|
| 6233 |
|
- |
|
| 6234 |
|
- |
[[patch.unused]]
|
| 6235 |
|
- |
name = "synckit-client"
|
| 6236 |
|
- |
version = "0.10.0"
|
| 7279 |
7279 |
|
/// Both optional, and both empty is a canvas that isolates nothing -- markup
|
| 7280 |
7280 |
|
/// dropped into the page with no sheet aimed at it, which is a real shape for
|
| 7281 |
7281 |
|
/// an app whose stylesheet is its own.
|
|
7282 |
+ |
///
|
|
7283 |
+ |
/// # An empty [`markup`](Self::markup) is the other half of the same idea
|
|
7284 |
+ |
///
|
|
7285 |
+ |
/// The scope is here because a class or an id can be a *contract with a
|
|
7286 |
+ |
/// stylesheet the app did not write*, and creator markup is only one way to
|
|
7287 |
+ |
/// arrive at one. The other is a block the app draws itself and has published
|
|
7288 |
+ |
/// a name for: MNW's guide tells creators that the buy block is `.mnw-buy`,
|
|
7289 |
+ |
/// the file list `.mnw-files` and the item block `.mnw-item`, with worked CSS
|
|
7290 |
+ |
/// against them. Those names are as load-bearing as the canvas id and for the
|
|
7291 |
+ |
/// same reason -- somebody outside the app has already written selectors
|
|
7292 |
+ |
/// against them -- and a renderer that prefixed or renamed them would silently
|
|
7293 |
+ |
/// stop every creator page that styles one.
|
|
7294 |
+ |
///
|
|
7295 |
+ |
/// So a canvas holding no markup and only [`within`](Self::within) is an
|
|
7296 |
+ |
/// ordinary shape: described content, under a name the app has promised. What
|
|
7297 |
+ |
/// the two uses share is the whole of what this member is, which is why they
|
|
7298 |
+ |
/// are one member and not two. What they do not share is risk: markup is
|
|
7299 |
+ |
/// opaque and dangerous, and a name is neither.
|
| 7282 |
7300 |
|
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
| 7283 |
7301 |
|
pub struct Canvas {
|
| 7284 |
7302 |
|
/// The markup, as whoever produced it left it.
|