@react-x11/components 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/code/index.d.ts.map +1 -1
  2. package/dist/code/index.js +25 -24
  3. package/dist/code/index.js.map +1 -1
  4. package/dist/code-language/index.d.ts +1 -1
  5. package/dist/code-language/index.d.ts.map +1 -1
  6. package/dist/code-language/index.js +1 -1
  7. package/dist/code-language/index.js.map +1 -1
  8. package/dist/code-language/runs.d.ts +31 -0
  9. package/dist/code-language/runs.d.ts.map +1 -1
  10. package/dist/code-language/runs.js +105 -0
  11. package/dist/code-language/runs.js.map +1 -1
  12. package/dist/codeblock/index.d.ts +13 -0
  13. package/dist/codeblock/index.d.ts.map +1 -1
  14. package/dist/codeblock/index.js +37 -1
  15. package/dist/codeblock/index.js.map +1 -1
  16. package/dist/flow/node.d.ts +14 -6
  17. package/dist/flow/node.d.ts.map +1 -1
  18. package/dist/flow/node.js +82 -64
  19. package/dist/flow/node.js.map +1 -1
  20. package/dist/html/controls.d.ts +26 -7
  21. package/dist/html/controls.d.ts.map +1 -1
  22. package/dist/html/controls.js +28 -3
  23. package/dist/html/controls.js.map +1 -1
  24. package/dist/html/css/cascade.d.ts +32 -10
  25. package/dist/html/css/cascade.d.ts.map +1 -1
  26. package/dist/html/css/cascade.js +89 -31
  27. package/dist/html/css/cascade.js.map +1 -1
  28. package/dist/html/css/color.d.ts +19 -0
  29. package/dist/html/css/color.d.ts.map +1 -1
  30. package/dist/html/css/color.js +86 -0
  31. package/dist/html/css/color.js.map +1 -1
  32. package/dist/html/css/parse.d.ts +11 -0
  33. package/dist/html/css/parse.d.ts.map +1 -1
  34. package/dist/html/css/parse.js +114 -4
  35. package/dist/html/css/parse.js.map +1 -1
  36. package/dist/html/css/style.d.ts +45 -5
  37. package/dist/html/css/style.d.ts.map +1 -1
  38. package/dist/html/css/style.js +363 -14
  39. package/dist/html/css/style.js.map +1 -1
  40. package/dist/html/css/ua.js +22 -5
  41. package/dist/html/css/ua.js.map +1 -1
  42. package/dist/html/css/values.d.ts +10 -1
  43. package/dist/html/css/values.d.ts.map +1 -1
  44. package/dist/html/css/values.js +27 -2
  45. package/dist/html/css/values.js.map +1 -1
  46. package/dist/html/css/vars.d.ts +5 -0
  47. package/dist/html/css/vars.d.ts.map +1 -1
  48. package/dist/html/css/vars.js +2 -2
  49. package/dist/html/css/vars.js.map +1 -1
  50. package/dist/html/dom.d.ts.map +1 -1
  51. package/dist/html/dom.js +35 -2
  52. package/dist/html/dom.js.map +1 -1
  53. package/dist/html/index.d.ts.map +1 -1
  54. package/dist/html/index.js +38 -1
  55. package/dist/html/index.js.map +1 -1
  56. package/dist/html/layout/block.d.ts +11 -2
  57. package/dist/html/layout/block.d.ts.map +1 -1
  58. package/dist/html/layout/block.js +306 -25
  59. package/dist/html/layout/block.js.map +1 -1
  60. package/dist/html/layout/boxes.d.ts +61 -6
  61. package/dist/html/layout/boxes.d.ts.map +1 -1
  62. package/dist/html/layout/boxes.js +65 -16
  63. package/dist/html/layout/boxes.js.map +1 -1
  64. package/dist/html/layout/cache.d.ts +2 -2
  65. package/dist/html/layout/cache.d.ts.map +1 -1
  66. package/dist/html/layout/cache.js +8 -3
  67. package/dist/html/layout/cache.js.map +1 -1
  68. package/dist/html/layout/floats.d.ts +4 -0
  69. package/dist/html/layout/floats.d.ts.map +1 -1
  70. package/dist/html/layout/floats.js +26 -0
  71. package/dist/html/layout/floats.js.map +1 -1
  72. package/dist/html/layout/inline.d.ts +29 -2
  73. package/dist/html/layout/inline.d.ts.map +1 -1
  74. package/dist/html/layout/inline.js +1454 -125
  75. package/dist/html/layout/inline.js.map +1 -1
  76. package/dist/html/node.d.ts +33 -0
  77. package/dist/html/node.d.ts.map +1 -1
  78. package/dist/html/node.js +608 -86
  79. package/dist/html/node.js.map +1 -1
  80. package/dist/html/paint.d.ts +53 -1
  81. package/dist/html/paint.d.ts.map +1 -1
  82. package/dist/html/paint.js +746 -214
  83. package/dist/html/paint.js.map +1 -1
  84. package/dist/html/surfaces.d.ts +7 -2
  85. package/dist/html/surfaces.d.ts.map +1 -1
  86. package/dist/html/surfaces.js +16 -0
  87. package/dist/html/surfaces.js.map +1 -1
  88. package/dist/html/svg.d.ts.map +1 -1
  89. package/dist/html/svg.js +27 -20
  90. package/dist/html/svg.js.map +1 -1
  91. package/dist/internal/codelines.d.ts +42 -0
  92. package/dist/internal/codelines.d.ts.map +1 -0
  93. package/dist/internal/codelines.js +170 -0
  94. package/dist/internal/codelines.js.map +1 -0
  95. package/dist/internal/window.d.ts +22 -0
  96. package/dist/internal/window.d.ts.map +1 -1
  97. package/dist/internal/window.js +35 -8
  98. package/dist/internal/window.js.map +1 -1
  99. package/dist/markdown/index.d.ts.map +1 -1
  100. package/dist/markdown/index.js +98 -26
  101. package/dist/markdown/index.js.map +1 -1
  102. package/dist/rich-text-editor/index.d.ts.map +1 -1
  103. package/dist/rich-text-editor/index.js +3 -8
  104. package/dist/rich-text-editor/index.js.map +1 -1
  105. package/dist/rich-text-editor/markdown.d.ts.map +1 -1
  106. package/dist/rich-text-editor/markdown.js +30 -1
  107. package/dist/rich-text-editor/markdown.js.map +1 -1
  108. package/dist/rich-text-editor/replace.d.ts +13 -0
  109. package/dist/rich-text-editor/replace.d.ts.map +1 -0
  110. package/dist/rich-text-editor/replace.js +64 -0
  111. package/dist/rich-text-editor/replace.js.map +1 -0
  112. package/dist/richtext/node.d.ts +7 -0
  113. package/dist/richtext/node.d.ts.map +1 -1
  114. package/dist/richtext/node.js.map +1 -1
  115. package/dist/terminal-output/index.d.ts.map +1 -1
  116. package/dist/terminal-output/index.js +100 -25
  117. package/dist/terminal-output/index.js.map +1 -1
  118. package/dist/terminal-output/runs.d.ts +4 -1
  119. package/dist/terminal-output/runs.d.ts.map +1 -1
  120. package/dist/terminal-output/runs.js +5 -1
  121. package/dist/terminal-output/runs.js.map +1 -1
  122. package/package.json +5 -3
  123. package/src/code/index.ts +34 -32
  124. package/src/code-language/index.ts +1 -1
  125. package/src/code-language/runs.ts +111 -1
  126. package/src/codeblock/index.ts +48 -1
  127. package/src/flow/node.ts +80 -64
  128. package/src/html/controls.ts +50 -9
  129. package/src/html/css/cascade.ts +134 -43
  130. package/src/html/css/color.ts +87 -0
  131. package/src/html/css/parse.ts +107 -4
  132. package/src/html/css/style.ts +386 -23
  133. package/src/html/css/ua.ts +22 -5
  134. package/src/html/css/values.ts +31 -3
  135. package/src/html/css/vars.ts +2 -2
  136. package/src/html/dom.ts +38 -2
  137. package/src/html/index.ts +39 -1
  138. package/src/html/layout/block.ts +360 -22
  139. package/src/html/layout/boxes.ts +98 -23
  140. package/src/html/layout/cache.ts +8 -3
  141. package/src/html/layout/floats.ts +24 -0
  142. package/src/html/layout/inline.ts +1690 -119
  143. package/src/html/node.ts +648 -101
  144. package/src/html/paint.ts +883 -283
  145. package/src/html/surfaces.ts +21 -1
  146. package/src/html/svg.ts +30 -19
  147. package/src/internal/codelines.ts +200 -0
  148. package/src/internal/window.ts +36 -8
  149. package/src/markdown/index.ts +145 -26
  150. package/src/rich-text-editor/index.ts +3 -11
  151. package/src/rich-text-editor/markdown.ts +36 -1
  152. package/src/rich-text-editor/replace.ts +85 -0
  153. package/src/richtext/node.ts +7 -0
  154. package/src/terminal-output/index.ts +127 -34
  155. package/src/terminal-output/runs.ts +16 -2
@@ -129,6 +129,19 @@ export interface LineText {
129
129
  * spacer: a unit of the layout that is no text of the document's
130
130
  * (`documentOffsetOf`, `layoutOffsetOf`). */
131
131
  gaps?: number[];
132
+ /**
133
+ * The spaces `pre-wrap` keeps that this fragment's line ends on, which an
134
+ * engine strips from a line's end as though CSS removed them there: each
135
+ * one's offset in the layout's text and where it is, from the layout's
136
+ * origin, beside the line's end in logical order (`hangPreserved`). They
137
+ * are their inline box's, whose background and border cover them, and
138
+ * the ones before a forced break that fit take room on the line.
139
+ */
140
+ hung?: {
141
+ at: number;
142
+ x: number;
143
+ width: number;
144
+ }[];
132
145
  /** Any offset in the layout's own text as a document index — how a run
133
146
  * under the pointer finds the element whose text it is. Per pass: the
134
147
  * layout may be one an earlier pass made (`TextLayoutCache`), and the
@@ -172,6 +185,10 @@ export interface TextLayoutLike {
172
185
  height: number;
173
186
  baseline: number;
174
187
  width: number;
188
+ /** Its width with the white space it ends on kept, in the item it
189
+ * ends: how far it moves the pen where text goes on after it on the
190
+ * same line. ntk's, from 8.17.0; an engine without it leaves it out. */
191
+ advance?: number;
175
192
  ascent: number;
176
193
  descent: number;
177
194
  start: number;
@@ -438,6 +455,13 @@ export declare const TEXT_SHIFTS: WeakMap<LineText, {
438
455
  y: number;
439
456
  }>;
440
457
  export declare const SHIFTED_LINES: WeakSet<LineBox>;
458
+ /** Of a block's lines, by the array they are, those `position: relative`
459
+ * or a translation moved something off — a text in a moved inline box, or
460
+ * an inline-block or an image on it — which is drawn where it went while
461
+ * the line stays where it was: what the paint's cull of a block's lines
462
+ * has to look at past the lines the damage meets (`paintLines`). By the
463
+ * array, so that a layout that makes new lines leaves none of the old. */
464
+ export declare const MOVED_OFF_LINES: WeakMap<LineBox[], Set<LineBox>>;
441
465
  /** How far `vertical-align` raised a text above its line's baseline, and an
442
466
  * inline box's own baseline, where it did: beside the lines and the boxes
443
467
  * for the reason the offsets above are. A line holding a raised text is
@@ -452,6 +476,11 @@ export declare const BOX_RAISES: WeakMap<Box, number>;
452
476
  * line's edge puts it, which is a different height on every line, so its
453
477
  * background, drawn from its baseline, is put there by line. */
454
478
  export declare const LINE_BOX_RAISES: WeakMap<LineBox, Map<Box, number>>;
479
+ /** The face of an inline box with padding above or below its text and
480
+ * nothing to paint behind it, which has no `decoration`: its fragments
481
+ * still reach past its lines by the padding, and count in the scrollable
482
+ * overflow of the block they are in (`computePaintBounds`). */
483
+ export declare const PADDED_FACES: WeakMap<Box, InlineDecoration>;
455
484
  /** The table cells wholly in columns `visibility: collapse` took out of
456
485
  * their table (CSS 2.1 17.5.5), which the paint pass leaves out: a cell is
457
486
  * no descendant of its column and inherits nothing from it, so its own
@@ -482,10 +511,15 @@ export declare const GRID_TRACKS: WeakMap<Box, GridTracks>;
482
511
  * `order` first and the document's after it (CSS Flexbox 5.4), where
483
512
  * `order` moves any: an absolutely positioned child's is 0. */
484
513
  export declare const PAINT_ORDER: WeakMap<Box, Box[]>;
485
- /** The blocks that broke a relatively positioned inline box in pieces,
486
- * under its first piece: its offset moves them too (CSS 2.1 9.2.1.1),
487
- * though they stand outside it (`breakAround`). */
514
+ /** The blocks that broke an inline box in pieces, under its first piece
515
+ * (`breakAround`): a relative offset of the box moves them too (CSS 2.1
516
+ * 9.2.1.1), though they stand outside it, and its rect takes them in, as
517
+ * a browser's does (`elementRect`). */
488
518
  export declare const CUT_BLOCKS: WeakMap<Box, Box[]>;
519
+ /** The element a pseudo-element's box is generated from, which has no
520
+ * element of its own (`Box.pseudo`): whose the images its styles name are,
521
+ * when the host is asked for them. */
522
+ export declare const GENERATED_FROM: WeakMap<Box, Element>;
489
523
  /** The blocks that broke an inline box under full opacity in pieces, and
490
524
  * the opacity they take from it — from each such inline box around them,
491
525
  * multiplied. They stand outside it (CSS 2.1 9.2.1.1) and are still its
@@ -515,9 +549,10 @@ export interface BoxTree {
515
549
  controls: Box[];
516
550
  /** Every box carrying an `href`, for click and hover. */
517
551
  links: Box[];
518
- /** Every element's box with a `background-image` or a border image,
519
- * for the host to be asked for: a document has a handful, and finding
520
- * them was a walk over every box after every build. */
552
+ /** Every box with a `background-image`, a border image or a mask image,
553
+ * an element's or a pseudo-element's, for the host to be asked for: a
554
+ * document has a handful, and finding them was a walk over every box
555
+ * after every build. */
521
556
  backgrounds: Box[];
522
557
  /** Every image generated content names, the element whose
523
558
  * pseudo-element names it, for the host to be asked for, and whether its
@@ -550,6 +585,11 @@ export interface BoxTree {
550
585
  /** Whether any box paints its background through its text
551
586
  * (`background-clip: text`): where none does, no paragraph looks. */
552
587
  clipText: boolean;
588
+ /** The style of the `<html>` a document with neither an `<html>` nor a
589
+ * `<body>` implies around the body the root box stands in for
590
+ * (`Cascade.rootStyle`), whose background is the canvas's; null where
591
+ * the document has either. */
592
+ impliedHtml: ComputedStyle | null;
553
593
  }
554
594
  export interface BuildOptions {
555
595
  cascade: Cascade;
@@ -574,6 +614,21 @@ export interface BuildOptions {
574
614
  export declare function buildBoxes(root: Element | {
575
615
  children: unknown;
576
616
  }, options: BuildOptions): BoxTree;
617
+ /**
618
+ * `text` transformed as `transform` says, where it stands for text laid out
619
+ * already — a first line's, whose `::first-line` transforms it (CSS 2.1
620
+ * 5.12.1): a character at a time where the transform would change its
621
+ * length, which moves every offset after it — `ß` is `SS` in capitals —
622
+ * and that character kept as it is.
623
+ */
624
+ export declare function transformInPlace(text: string, transform: ComputedStyle['textTransform'], lettered?: boolean): string;
625
+ /**
626
+ * Whether a word is under way after `text`, as `capitalize` reads words: its
627
+ * last letter, number or character between words decides, and a text of
628
+ * nothing but joining punctuation leaves it as it was. Asked of every text,
629
+ * from the end, where it is almost always decided by the last character.
630
+ */
631
+ export declare function letteredAfter(text: string, lettered: boolean): boolean;
577
632
  /**
578
633
  * Whether a text is white space alone: CSS's white space, which is the
579
634
  * space, the tab and the three line breaks and nothing else (CSS Text 3,
@@ -1 +1 @@
1
- {"version":3,"file":"boxes.d.ts","sourceRoot":"","sources":["../../../src/html/layout/boxes.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAUvD,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAapD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,M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MAAM,CAAC;IACf;;kCAE8B;IAC9B,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAAC;IAC7C,gEAAgE;IAChE,OAAO,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IAC5C;oCACgC;IAChC,WAAW,CACT,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,aAAa,GACnB;QACD,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,yCAAyC;AACzC,wBAAgB,UAAU,CACxB,IAAI,EAAE,OAAO,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,EACrC,OAAO,EAAE,YAAY,GACpB,OAAO,CAGT;AAkyCD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,CAAC,eAAe,CAAC,EACzC,QAAQ,UAAQ,GACf,MAAM,CAWR;AAoED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAyBtE;AAinBD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7C;AAYD;;;+DAG+D;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAQtD"}
@@ -1,6 +1,6 @@
1
1
  import { attr, childrenOf, isElement, isText, inImpliedHead, NON_RENDERED, tagOf, } from '../dom.js';
2
2
  import { quoteAt } from '../css/content.js';
3
- import { CONTAIN_STYLE, FIRST_LINE_INHERITED, copyStyle, firstLineParent, inherit, } from '../css/style.js';
3
+ import { CONTAIN_STYLE, FIRST_LINE_INHERITED, NO_MASK, copyStyle, firstLineParent, inherit, } from '../css/style.js';
4
4
  import { AUTO } from '../css/values.js';
5
5
  import { svgIntrinsics } from '../svg.js';
6
6
  /**
@@ -220,6 +220,13 @@ export const CONTENT_IMAGES = new WeakMap();
220
220
  export const INLINE_OFFSETS = new WeakMap();
221
221
  export const TEXT_SHIFTS = new WeakMap();
222
222
  export const SHIFTED_LINES = new WeakSet();
223
+ /** Of a block's lines, by the array they are, those `position: relative`
224
+ * or a translation moved something off — a text in a moved inline box, or
225
+ * an inline-block or an image on it — which is drawn where it went while
226
+ * the line stays where it was: what the paint's cull of a block's lines
227
+ * has to look at past the lines the damage meets (`paintLines`). By the
228
+ * array, so that a layout that makes new lines leaves none of the old. */
229
+ export const MOVED_OFF_LINES = new WeakMap();
223
230
  /** How far `vertical-align` raised a text above its line's baseline, and an
224
231
  * inline box's own baseline, where it did: beside the lines and the boxes
225
232
  * for the reason the offsets above are. A line holding a raised text is
@@ -234,6 +241,11 @@ export const BOX_RAISES = new WeakMap();
234
241
  * line's edge puts it, which is a different height on every line, so its
235
242
  * background, drawn from its baseline, is put there by line. */
236
243
  export const LINE_BOX_RAISES = new WeakMap();
244
+ /** The face of an inline box with padding above or below its text and
245
+ * nothing to paint behind it, which has no `decoration`: its fragments
246
+ * still reach past its lines by the padding, and count in the scrollable
247
+ * overflow of the block they are in (`computePaintBounds`). */
248
+ export const PADDED_FACES = new WeakMap();
237
249
  /** The table cells wholly in columns `visibility: collapse` took out of
238
250
  * their table (CSS 2.1 17.5.5), which the paint pass leaves out: a cell is
239
251
  * no descendant of its column and inherits nothing from it, so its own
@@ -254,10 +266,15 @@ export const GRID_TRACKS = new WeakMap();
254
266
  * `order` first and the document's after it (CSS Flexbox 5.4), where
255
267
  * `order` moves any: an absolutely positioned child's is 0. */
256
268
  export const PAINT_ORDER = new WeakMap();
257
- /** The blocks that broke a relatively positioned inline box in pieces,
258
- * under its first piece: its offset moves them too (CSS 2.1 9.2.1.1),
259
- * though they stand outside it (`breakAround`). */
269
+ /** The blocks that broke an inline box in pieces, under its first piece
270
+ * (`breakAround`): a relative offset of the box moves them too (CSS 2.1
271
+ * 9.2.1.1), though they stand outside it, and its rect takes them in, as
272
+ * a browser's does (`elementRect`). */
260
273
  export const CUT_BLOCKS = new WeakMap();
274
+ /** The element a pseudo-element's box is generated from, which has no
275
+ * element of its own (`Box.pseudo`): whose the images its styles name are,
276
+ * when the host is asked for them. */
277
+ export const GENERATED_FROM = new WeakMap();
261
278
  /** The blocks that broke an inline box under full opacity in pieces, and
262
279
  * the opacity they take from it — from each such inline box around them,
263
280
  * multiplied. They stand outside it (CSS 2.1 9.2.1.1) and are still its
@@ -327,7 +344,7 @@ class Builder {
327
344
  run(root) {
328
345
  const cascade = this._options.cascade;
329
346
  cascade.beginSharing();
330
- const rootStyle = cascade.rootStyle(hasBody(root), hasHtml(root));
347
+ const { style: rootStyle, html: impliedHtml } = cascade.rootStyle(hasBody(root), hasHtml(root));
331
348
  const rootBox = new Box('block', null, rootStyle);
332
349
  // a fragment's root stands in for a `<body>`, counters and all
333
350
  this._scopes.open();
@@ -361,6 +378,7 @@ class Builder {
361
378
  nestedOutOfLine: this._nestedOutOfLine,
362
379
  movedInline: this._movedInline,
363
380
  clipText: this._clipText,
381
+ impliedHtml,
364
382
  };
365
383
  }
366
384
  /** `BoxTree.firstLineStyler`, over this build's cascade. */
@@ -534,11 +552,8 @@ class Builder {
534
552
  this._firstLine = true;
535
553
  }
536
554
  }
537
- if (style.backgroundImage ||
538
- style.backgroundImages ||
539
- typeof style.borderImage.source === 'string') {
555
+ if (namesImages(style))
540
556
  this._backgrounds.push(box);
541
- }
542
557
  if (style.position === 'absolute' || style.position === 'fixed')
543
558
  box.outOfFlow = true;
544
559
  else if (style.float !== 'none')
@@ -666,11 +681,8 @@ class Builder {
666
681
  const box = new Box('replaced', el, style);
667
682
  box.replaced = replaced;
668
683
  into.append(box);
669
- if (style.backgroundImage ||
670
- style.backgroundImages ||
671
- typeof style.borderImage.source === 'string') {
684
+ if (namesImages(style))
672
685
  this._backgrounds.push(box);
673
- }
674
686
  if (style.position === 'absolute' || style.position === 'fixed')
675
687
  box.outOfFlow = true;
676
688
  else if (style.float !== 'none')
@@ -800,6 +812,11 @@ class Builder {
800
812
  const box = new Box(boxKindFor(style.display), null, style);
801
813
  box.pseudo = which;
802
814
  into.append(box);
815
+ // its images are its element's to ask for: a `::after` with no content
816
+ // but a background, which designs hang a picture on, drew nothing
817
+ GENERATED_FROM.set(box, el);
818
+ if (namesImages(style))
819
+ this._backgrounds.push(box);
803
820
  // a list item it generates has a marker as an element's has, of the
804
821
  // `list-item` counter it has just counted (CSS 2.1 12.5): outside it,
805
822
  // or at the start of its content
@@ -1161,6 +1178,11 @@ class Builder {
1161
1178
  const letterStyle = cascade.firstLetterStyle(search.rules, style);
1162
1179
  const box = new Box(boxKindFor(letterStyle.display), null, letterStyle);
1163
1180
  box.pseudo = 'first-letter';
1181
+ if (owner) {
1182
+ GENERATED_FROM.set(box, owner);
1183
+ if (namesImages(letterStyle))
1184
+ this._backgrounds.push(box);
1185
+ }
1164
1186
  if (letterStyle.float !== 'none') {
1165
1187
  box.isFloat = true;
1166
1188
  if (into.kind === 'inline')
@@ -1441,6 +1463,26 @@ function transformText(text, transform, lettered = false) {
1441
1463
  return text;
1442
1464
  }
1443
1465
  }
1466
+ /**
1467
+ * `text` transformed as `transform` says, where it stands for text laid out
1468
+ * already — a first line's, whose `::first-line` transforms it (CSS 2.1
1469
+ * 5.12.1): a character at a time where the transform would change its
1470
+ * length, which moves every offset after it — `ß` is `SS` in capitals —
1471
+ * and that character kept as it is.
1472
+ */
1473
+ export function transformInPlace(text, transform, lettered = false) {
1474
+ const whole = transformText(text, transform, lettered);
1475
+ if (whole.length === text.length)
1476
+ return whole;
1477
+ let out = '';
1478
+ let state = lettered;
1479
+ for (const ch of text) {
1480
+ const one = transformText(ch, transform, state);
1481
+ out += one.length === ch.length ? one : ch;
1482
+ state = letteredAfter(ch, state);
1483
+ }
1484
+ return out;
1485
+ }
1444
1486
  /** A letter or a number: what a word's first typographic letter unit is
1445
1487
  * (CSS Text 3, 2.1). */
1446
1488
  const LETTER_UNIT = /[\p{L}\p{N}]/u;
@@ -1513,7 +1555,7 @@ function titleCase(ch) {
1513
1555
  * nothing but joining punctuation leaves it as it was. Asked of every text,
1514
1556
  * from the end, where it is almost always decided by the last character.
1515
1557
  */
1516
- function letteredAfter(text, lettered) {
1558
+ export function letteredAfter(text, lettered) {
1517
1559
  for (let i = text.length - 1; i >= 0; i -= 1) {
1518
1560
  const c = text.charCodeAt(i);
1519
1561
  if (c < 0x80) {
@@ -1962,8 +2004,7 @@ function breakAround(inline) {
1962
2004
  for (let i = 0; i < pieces.length; i += 1) {
1963
2005
  pieces[i].cut = (i > 0 ? 1 : 0) | (i < pieces.length - 1 ? 2 : 0);
1964
2006
  }
1965
- if (isRelative(inline.style))
1966
- CUT_BLOCKS.set(pieces[0], blocks);
2007
+ CUT_BLOCKS.set(pieces[0], blocks);
1967
2008
  const fade = inline.style.opacity;
1968
2009
  if (fade < 1) {
1969
2010
  for (const block of blocks) {
@@ -1972,6 +2013,14 @@ function breakAround(inline) {
1972
2013
  }
1973
2014
  return out;
1974
2015
  }
2016
+ /** Whether a style names an image for its box to be drawn with: a
2017
+ * background's, a border's, or a mask's. */
2018
+ function namesImages(style) {
2019
+ return (!!style.backgroundImage ||
2020
+ !!style.backgroundImages ||
2021
+ typeof style.borderImage.source === 'string' ||
2022
+ style.mask !== NO_MASK);
2023
+ }
1975
2024
  function anonymousStyles(initial) {
1976
2025
  const made = new WeakMap();
1977
2026
  return (parent, display) => {