@react-x11/components 0.14.0 → 0.16.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.
- package/dist/code-editor/node.d.ts +13 -0
- package/dist/code-editor/node.d.ts.map +1 -1
- package/dist/code-editor/node.js +23 -5
- package/dist/code-editor/node.js.map +1 -1
- package/dist/html/css/cascade.d.ts +209 -23
- package/dist/html/css/cascade.d.ts.map +1 -1
- package/dist/html/css/cascade.js +873 -175
- package/dist/html/css/cascade.js.map +1 -1
- package/dist/html/css/color.d.ts +25 -0
- package/dist/html/css/color.d.ts.map +1 -1
- package/dist/html/css/color.js +307 -19
- package/dist/html/css/color.js.map +1 -1
- package/dist/html/css/content.d.ts +11 -6
- package/dist/html/css/content.d.ts.map +1 -1
- package/dist/html/css/content.js +171 -12
- package/dist/html/css/content.js.map +1 -1
- package/dist/html/css/parse.d.ts.map +1 -1
- package/dist/html/css/parse.js +62 -9
- package/dist/html/css/parse.js.map +1 -1
- package/dist/html/css/shapes.d.ts +62 -0
- package/dist/html/css/shapes.d.ts.map +1 -0
- package/dist/html/css/shapes.js +214 -0
- package/dist/html/css/shapes.js.map +1 -0
- package/dist/html/css/style.d.ts +42 -5
- package/dist/html/css/style.d.ts.map +1 -1
- package/dist/html/css/style.js +75 -27
- package/dist/html/css/style.js.map +1 -1
- package/dist/html/css/ua.js +15 -0
- package/dist/html/css/ua.js.map +1 -1
- package/dist/html/css/values.d.ts +5 -0
- package/dist/html/css/values.d.ts.map +1 -1
- package/dist/html/css/values.js +18 -9
- package/dist/html/css/values.js.map +1 -1
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +7 -0
- package/dist/html/index.js.map +1 -1
- package/dist/html/layout/block.d.ts +38 -7
- package/dist/html/layout/block.d.ts.map +1 -1
- package/dist/html/layout/block.js +160 -50
- package/dist/html/layout/block.js.map +1 -1
- package/dist/html/layout/boxes.d.ts +29 -2
- package/dist/html/layout/boxes.d.ts.map +1 -1
- package/dist/html/layout/boxes.js +159 -20
- package/dist/html/layout/boxes.js.map +1 -1
- package/dist/html/layout/css-grid.d.ts.map +1 -1
- package/dist/html/layout/css-grid.js +69 -19
- package/dist/html/layout/css-grid.js.map +1 -1
- package/dist/html/layout/flex.d.ts.map +1 -1
- package/dist/html/layout/flex.js +1648 -225
- package/dist/html/layout/flex.js.map +1 -1
- package/dist/html/layout/inline.d.ts +15 -3
- package/dist/html/layout/inline.d.ts.map +1 -1
- package/dist/html/layout/inline.js +23 -8
- package/dist/html/layout/inline.js.map +1 -1
- package/dist/html/layout/table.d.ts +27 -1
- package/dist/html/layout/table.d.ts.map +1 -1
- package/dist/html/layout/table.js +907 -323
- package/dist/html/layout/table.js.map +1 -1
- package/dist/html/node.d.ts +36 -4
- package/dist/html/node.d.ts.map +1 -1
- package/dist/html/node.js +174 -37
- package/dist/html/node.js.map +1 -1
- package/dist/html/paint.d.ts +4 -1
- package/dist/html/paint.d.ts.map +1 -1
- package/dist/html/paint.js +769 -204
- package/dist/html/paint.js.map +1 -1
- package/dist/html/resources.js +14 -1
- package/dist/html/resources.js.map +1 -1
- package/dist/html/svg.d.ts +50 -17
- package/dist/html/svg.d.ts.map +1 -1
- package/dist/html/svg.js +501 -83
- package/dist/html/svg.js.map +1 -1
- package/dist/html/widgets.d.ts.map +1 -1
- package/dist/html/widgets.js +57 -4
- package/dist/html/widgets.js.map +1 -1
- package/package.json +3 -3
- package/src/code-editor/node.ts +24 -5
- package/src/html/css/cascade.ts +987 -176
- package/src/html/css/color.ts +345 -18
- package/src/html/css/content.ts +173 -15
- package/src/html/css/parse.ts +60 -8
- package/src/html/css/shapes.ts +273 -0
- package/src/html/css/style.ts +123 -30
- package/src/html/css/ua.ts +15 -0
- package/src/html/css/values.ts +23 -9
- package/src/html/index.ts +7 -0
- package/src/html/layout/block.ts +169 -56
- package/src/html/layout/boxes.ts +198 -24
- package/src/html/layout/css-grid.ts +89 -22
- package/src/html/layout/flex.ts +1863 -219
- package/src/html/layout/inline.ts +27 -7
- package/src/html/layout/table.ts +989 -333
- package/src/html/node.ts +204 -37
- package/src/html/paint.ts +999 -252
- package/src/html/resources.ts +13 -1
- package/src/html/svg.ts +600 -78
- package/src/html/widgets.ts +61 -4
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Element } from 'domhandler';
|
|
2
2
|
import type { TextRun } from '../../richtext/index.js';
|
|
3
|
+
import { ShapeCopies } from '../css/cascade.js';
|
|
3
4
|
import type { Cascade, KeptStyles, SelectionStyle } from '../css/cascade.js';
|
|
4
5
|
import type { CollapsedTable } from './collapse.js';
|
|
6
|
+
import type { ShapeStyles } from '../css/shapes.js';
|
|
5
7
|
import type { IntrinsicSize } from '../svg.js';
|
|
6
8
|
import type { ComputedStyle } from '../css/style.js';
|
|
7
9
|
import type { GridLines } from './grid-lines.js';
|
|
@@ -16,12 +18,16 @@ export interface Marker {
|
|
|
16
18
|
/** Its own style where a `::marker` rule gives it one; the item's where
|
|
17
19
|
* none does. */
|
|
18
20
|
style: ComputedStyle | null;
|
|
19
|
-
/** The image it is, `list-style-image`'s,
|
|
20
|
-
*
|
|
21
|
+
/** The image it is, `list-style-image`'s, where that has arrived, at its
|
|
22
|
+
* size in device pixels — its own, or the one a marker image with none
|
|
23
|
+
* is given (`Builder._markerImageSize`); its text is then not drawn.
|
|
24
|
+
* `gap` is the room between it and the content, in device pixels
|
|
25
|
+
* (`MARKER_IMAGE_GAP`). */
|
|
21
26
|
image?: {
|
|
22
27
|
url: string;
|
|
23
28
|
width: number;
|
|
24
29
|
height: number;
|
|
30
|
+
gap: number;
|
|
25
31
|
};
|
|
26
32
|
/** Its text is its own — a string `list-style-type`, a `::marker`'s
|
|
27
33
|
* `content` — and ends at the content's edge, with no gap a number
|
|
@@ -578,6 +584,13 @@ export declare const COLUMN_ROWS: WeakMap<LineText, {
|
|
|
578
584
|
export declare const columned: {
|
|
579
585
|
any: boolean;
|
|
580
586
|
};
|
|
587
|
+
/** What the document's rules give the elements inside an inline `<svg>`
|
|
588
|
+
* (`Cascade.shapeStyles`), null where they give none. */
|
|
589
|
+
export type ShapeStyler = (box: Box) => ShapeStyles | null;
|
|
590
|
+
/** What `BoxTree.shapeStyler` answered for each drawing's box it has been
|
|
591
|
+
* asked of, which are the ones painted: a box restyled where it is has
|
|
592
|
+
* its answer put here again (`HtmlViewNode._hoverInPlace`). */
|
|
593
|
+
export declare const SHAPE_STYLES: WeakMap<Box, ShapeStyles | null>;
|
|
581
594
|
/** The element a pseudo-element's box is generated from, which has no
|
|
582
595
|
* element of its own (`Box.pseudo`): whose the images its styles name are,
|
|
583
596
|
* when the host is asked for them. */
|
|
@@ -644,6 +657,16 @@ export interface BoxTree {
|
|
|
644
657
|
* one: worked out as a selection is first painted over it, not as the
|
|
645
658
|
* tree is built, since most builds are never selected in. */
|
|
646
659
|
selectionStyler: SelectionStyler | null;
|
|
660
|
+
/** What the rules give the elements in each inline `<svg>`
|
|
661
|
+
* (`ShapeStyler`), which have no boxes and no styles, where any rule
|
|
662
|
+
* could reach one: worked out as a drawing is first painted, since a
|
|
663
|
+
* page of icons shows few of them at once. */
|
|
664
|
+
shapeStyler: ShapeStyler | null;
|
|
665
|
+
/** What the drawings of this build share in `Cascade.shapeStyles`: the
|
|
666
|
+
* document's elements by their ids, indexed when first asked, where a
|
|
667
|
+
* `<use>` finds the icon a sprite has for it; and what the rules matched
|
|
668
|
+
* in each copy a `<use>` makes. Null where `shapeStyler` is. */
|
|
669
|
+
shapeCopies: ShapeCopies | null;
|
|
647
670
|
/** Whether a float or an out-of-flow box sits in an inline box: where
|
|
648
671
|
* none does, layout looks for them among a block's own children and
|
|
649
672
|
* goes through no inline box to find them. */
|
|
@@ -680,6 +703,10 @@ export interface BuildOptions {
|
|
|
680
703
|
imageSize(el: Element): IntrinsicSize | null;
|
|
681
704
|
/** The same for an image named by url — generated content's. */
|
|
682
705
|
urlSize?(url: string): IntrinsicSize | null;
|
|
706
|
+
/** How far a style's first face reaches above its baseline, in device
|
|
707
|
+
* pixels: what a list marker's image with no size of its own is sized
|
|
708
|
+
* by (`_markerImageSize`). Where it is not known, 0.8em. */
|
|
709
|
+
faceAscent?(style: ComputedStyle): number | undefined;
|
|
683
710
|
/** The size a real widget wants, so the box in the flow is the size the
|
|
684
711
|
* control will be drawn at. */
|
|
685
712
|
controlSize(el: Element, kind: ReplacedKind, style: ComputedStyle): {
|
|
@@ -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,EACV,OAAO,EAEP,UAAU,EACV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAcpD,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,MAAM,MAAM,OAAO,GACf,OAAO,GACP,QAAQ,GACR,MAAM,GACN,UAAU,GACV,MAAM,GACN,OAAO,GACP,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,eAAe,GACf,QAAQ,GACR,OAAO,CAAC;AAOZ;6BAC6B;AAC7B,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV;qBACiB;IACjB,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B;8DAC0D;IAC1D,KAAK,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EA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G;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,KAC9B,aAAa,CAAC;AA0InB;;;;;;;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,8 +1,22 @@
|
|
|
1
1
|
import { attr, childrenOf, isElement, isText, inImpliedHead, NON_RENDERED, tagOf, } from '../dom.js';
|
|
2
|
+
import { ShapeCopies, languageOf, metaColorScheme } from '../css/cascade.js';
|
|
2
3
|
import { quoteAt } from '../css/content.js';
|
|
3
4
|
import { CONTAIN_STYLE, FIRST_LINE_INHERITED, NO_MASK, copyStyle, firstLineParent, inherit, } from '../css/style.js';
|
|
4
5
|
import { AUTO } from '../css/values.js';
|
|
5
|
-
import { svgIntrinsics } from '../svg.js';
|
|
6
|
+
import { concreteSize, svgIntrinsics } from '../svg.js';
|
|
7
|
+
/**
|
|
8
|
+
* The room between a list marker's image and the item's content, in CSS
|
|
9
|
+
* pixels: between the image and the content's edge outside the item, and
|
|
10
|
+
* after the image inside it. CSS 2.1 (12.5.1) leaves where a marker goes
|
|
11
|
+
* to the user agent, and this is Blink's `kCMarkerPaddingPx`
|
|
12
|
+
* (`ListMarker::InlineMarginsForOutside` and `…ForInside`), which WebKit
|
|
13
|
+
* has too. Outside, ours was the gap a bullet has, 0.4em — 16 pixels at
|
|
14
|
+
* 40px text where Chrome has 7 — and inside the space a marker's text ends
|
|
15
|
+
* in, a space's width. Blink writes it into the marker's margins unzoomed,
|
|
16
|
+
* so at a device scale of 2 Chrome's is 7 device pixels; here it is 7 CSS
|
|
17
|
+
* pixels at any scale, so that a page at 2x is the page at 1x doubled.
|
|
18
|
+
*/
|
|
19
|
+
const MARKER_IMAGE_GAP = 7;
|
|
6
20
|
/**
|
|
7
21
|
* One box. Fields are assigned rather than passed so the shape stays
|
|
8
22
|
* monomorphic — every box has every field, which is what keeps the property
|
|
@@ -295,6 +309,10 @@ export const COLUMN_ROWS = new WeakMap();
|
|
|
295
309
|
/** Whether any layout has broken a box between columns: what the walks
|
|
296
310
|
* that would ask the three maps above of every box ask first. */
|
|
297
311
|
export const columned = { any: false };
|
|
312
|
+
/** What `BoxTree.shapeStyler` answered for each drawing's box it has been
|
|
313
|
+
* asked of, which are the ones painted: a box restyled where it is has
|
|
314
|
+
* its answer put here again (`HtmlViewNode._hoverInPlace`). */
|
|
315
|
+
export const SHAPE_STYLES = new WeakMap();
|
|
298
316
|
/** The element a pseudo-element's box is generated from, which has no
|
|
299
317
|
* element of its own (`Box.pseudo`): whose the images its styles name are,
|
|
300
318
|
* when the host is asked for them. */
|
|
@@ -310,6 +328,29 @@ export function buildBoxes(root, options) {
|
|
|
310
328
|
const builder = new Builder(options);
|
|
311
329
|
return builder.run(root);
|
|
312
330
|
}
|
|
331
|
+
/** A document's first element with an id: one walk of it, the first time
|
|
332
|
+
* an id is asked for (`ShapeCopies`). */
|
|
333
|
+
function idIndex(root) {
|
|
334
|
+
let index = null;
|
|
335
|
+
return (id) => {
|
|
336
|
+
if (!index) {
|
|
337
|
+
index = new Map();
|
|
338
|
+
const stack = [...root.children].reverse();
|
|
339
|
+
for (let node = stack.pop(); node; node = stack.pop()) {
|
|
340
|
+
if (!isElement(node))
|
|
341
|
+
continue;
|
|
342
|
+
const own = node.attribs.id;
|
|
343
|
+
if (own && !index.has(own))
|
|
344
|
+
index.set(own, node);
|
|
345
|
+
const children = node.children;
|
|
346
|
+
for (let i = children.length - 1; i >= 0; i -= 1) {
|
|
347
|
+
stack.push(children[i]);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return index.get(id) ?? null;
|
|
352
|
+
};
|
|
353
|
+
}
|
|
313
354
|
/**
|
|
314
355
|
* How deep the box tree may go. Everything downstream of the builder — the
|
|
315
356
|
* fix-up pass, layout, paint, the accessor walks — recurses on box depth, so
|
|
@@ -317,8 +358,17 @@ export function buildBoxes(root, options) {
|
|
|
317
358
|
* output, a runaway template) from a stack overflow five phases later.
|
|
318
359
|
* Blink's parser flattens at 512 for the same reason; content past the cap
|
|
319
360
|
* is dropped, which beats the alternative of crashing the application.
|
|
361
|
+
*
|
|
320
362
|
* The parser keeps a document to 256 elements (`dom.ts`), so what reaches
|
|
321
|
-
* this
|
|
363
|
+
* this is the anonymous boxes a table builds round them, which the builder
|
|
364
|
+
* counts as it goes (`wrappersAround`), since the fix-up makes them after
|
|
365
|
+
* it. Counted as elements, a `display: table-cell` box in another was one
|
|
366
|
+
* level where it is four boxes — a table, a row group, a row and the cell
|
|
367
|
+
* — and every pass pays for a box: painting one takes some 800 bytes of
|
|
368
|
+
* the stack. Two hundred and fifty cells deep, a thousand boxes, layout
|
|
369
|
+
* and paint each ran out of the 984 KB V8 gives the main thread, and the
|
|
370
|
+
* document came out blank. 512 boxes paint in under half of it, and are a
|
|
371
|
+
* cell in a cell 128 deep.
|
|
322
372
|
*/
|
|
323
373
|
const MAX_DEPTH = 512;
|
|
324
374
|
/** The sharing key the root box's children share under: one root style per
|
|
@@ -368,8 +418,13 @@ class Builder {
|
|
|
368
418
|
run(root) {
|
|
369
419
|
const cascade = this._options.cascade;
|
|
370
420
|
cascade.beginSharing(this._options.kept ?? null);
|
|
421
|
+
cascade.pageColorScheme = metaColorScheme(root);
|
|
371
422
|
const { style: rootStyle, html: impliedHtml } = cascade.rootStyle(hasBody(root), hasHtml(root));
|
|
372
423
|
const rootBox = new Box('block', null, rootStyle);
|
|
424
|
+
// the root standing in for a `<body>` has its background clipped to
|
|
425
|
+
// the document's text as the body's would be
|
|
426
|
+
if (rootStyle.backgroundClipText)
|
|
427
|
+
this._clipText = true;
|
|
373
428
|
// a fragment's root stands in for a `<body>`, counters and all
|
|
374
429
|
this._scopes.open();
|
|
375
430
|
this._counterChanges(rootStyle, {
|
|
@@ -387,6 +442,7 @@ class Builder {
|
|
|
387
442
|
const anonymous = anonymousStyles(cascade.initial);
|
|
388
443
|
fixUp(rootBox, anonymous);
|
|
389
444
|
assignSubtreeRanges(rootBox);
|
|
445
|
+
const copies = cascade.stylesShapes ? new ShapeCopies(idIndex(root)) : null;
|
|
390
446
|
return {
|
|
391
447
|
root: rootBox,
|
|
392
448
|
anonymous,
|
|
@@ -403,6 +459,8 @@ class Builder {
|
|
|
403
459
|
firstLine: this._firstLine,
|
|
404
460
|
firstLineStyler: this._firstLine ? this._firstLineStyler() : null,
|
|
405
461
|
selectionStyler: cascade.hasSelection ? this._selectionStyler() : null,
|
|
462
|
+
shapeStyler: copies ? this._shapeStyler(copies) : null,
|
|
463
|
+
shapeCopies: copies,
|
|
406
464
|
nestedOutOfLine: this._nestedOutOfLine,
|
|
407
465
|
movedInline: this._movedInline,
|
|
408
466
|
clipText: this._clipText,
|
|
@@ -435,6 +493,19 @@ class Builder {
|
|
|
435
493
|
return at?.el ? of(at.el) : null;
|
|
436
494
|
};
|
|
437
495
|
}
|
|
496
|
+
/** `BoxTree.shapeStyler`, over this build's cascade: each drawing's
|
|
497
|
+
* once, from its box's style as it is when first asked. */
|
|
498
|
+
_shapeStyler(copies) {
|
|
499
|
+
const cascade = this._options.cascade;
|
|
500
|
+
return (box) => {
|
|
501
|
+
let shapes = SHAPE_STYLES.get(box);
|
|
502
|
+
if (shapes === undefined) {
|
|
503
|
+
shapes = box.el ? cascade.shapeStyles(box.el, box.style, copies) : null;
|
|
504
|
+
SHAPE_STYLES.set(box, shapes);
|
|
505
|
+
}
|
|
506
|
+
return shapes;
|
|
507
|
+
};
|
|
508
|
+
}
|
|
438
509
|
/** `BoxTree.firstLineStyler`, over this build's cascade. */
|
|
439
510
|
_firstLineStyler() {
|
|
440
511
|
const cascade = this._options.cascade;
|
|
@@ -599,9 +670,11 @@ class Builder {
|
|
|
599
670
|
this._replaced(el, tag, replaced, style, into);
|
|
600
671
|
return;
|
|
601
672
|
}
|
|
602
|
-
if (this._depth >= MAX_DEPTH)
|
|
603
|
-
return;
|
|
604
673
|
const kind = boxKindFor(style.display);
|
|
674
|
+
// the box, and the anonymous boxes the fix-up will put round it
|
|
675
|
+
const depth = 1 + wrappersAround(into.kind, kind, style);
|
|
676
|
+
if (this._depth + depth > MAX_DEPTH)
|
|
677
|
+
return;
|
|
605
678
|
const box = new Box(kind, el, style);
|
|
606
679
|
into.append(box);
|
|
607
680
|
if ((kind === 'block' || kind === 'table-cell' || kind === 'table-caption') &&
|
|
@@ -663,21 +736,19 @@ class Builder {
|
|
|
663
736
|
flush = true;
|
|
664
737
|
}
|
|
665
738
|
if (markerImage && !ownMarker) {
|
|
739
|
+
const [width, height] = this._markerImageSize(markerImage.size, markerStyle ?? style);
|
|
740
|
+
const gap = MARKER_IMAGE_GAP * (this._options.scale ?? 1);
|
|
741
|
+
const image = { url: markerImage.url, width, height, gap };
|
|
666
742
|
if (style.listStylePosition === 'inside')
|
|
667
|
-
insideImage =
|
|
743
|
+
insideImage = image;
|
|
668
744
|
else {
|
|
669
|
-
const scale = this._options.scale ?? 1;
|
|
670
745
|
box.marker = {
|
|
671
746
|
text: '',
|
|
672
747
|
layout: null,
|
|
673
748
|
x: 0,
|
|
674
749
|
y: 0,
|
|
675
750
|
style: markerStyle,
|
|
676
|
-
image
|
|
677
|
-
url: markerImage.url,
|
|
678
|
-
width: (markerImage.size.width ?? 0) * scale,
|
|
679
|
-
height: (markerImage.size.height ?? 0) * scale,
|
|
680
|
-
},
|
|
751
|
+
image,
|
|
681
752
|
};
|
|
682
753
|
}
|
|
683
754
|
}
|
|
@@ -717,12 +788,18 @@ class Builder {
|
|
|
717
788
|
const ownLetter = ownRules ? { rules: ownRules, punctuation: [] } : null;
|
|
718
789
|
if (ownLetter)
|
|
719
790
|
this._firstLetter = ownLetter;
|
|
720
|
-
this._depth +=
|
|
791
|
+
this._depth += depth;
|
|
721
792
|
if (insideImage) {
|
|
722
793
|
// an inline image at the start of the first line, as a generated
|
|
723
|
-
// image is, and the
|
|
724
|
-
|
|
725
|
-
|
|
794
|
+
// image is, and the room after it Blink gives it rather than a
|
|
795
|
+
// space: the content's own white space after it is kept, as it is
|
|
796
|
+
// after an image (`MARKER_IMAGE_GAP`)
|
|
797
|
+
const { url, gap } = insideImage;
|
|
798
|
+
const image = this._contentImage(url, box, style, el, insideImage);
|
|
799
|
+
if (style.direction === 'rtl')
|
|
800
|
+
image.style.marginLeft = gap;
|
|
801
|
+
else
|
|
802
|
+
image.style.marginRight = gap;
|
|
726
803
|
}
|
|
727
804
|
else if (insideMarker) {
|
|
728
805
|
this._insideMarker(insideMarker, style, markerStyle, box, el);
|
|
@@ -730,7 +807,7 @@ class Builder {
|
|
|
730
807
|
this._pseudo(el, 'before', style, box);
|
|
731
808
|
this._children(el, box, style, childInFlex, el, key);
|
|
732
809
|
this._pseudo(el, 'after', style, box);
|
|
733
|
-
this._depth -=
|
|
810
|
+
this._depth -= depth;
|
|
734
811
|
this._letterAfter(flow, skipped, outerLetter, ownLetter);
|
|
735
812
|
if (flow !== 'inline')
|
|
736
813
|
this._endLine();
|
|
@@ -1117,14 +1194,14 @@ class Builder {
|
|
|
1117
1194
|
.join(item.separator);
|
|
1118
1195
|
break;
|
|
1119
1196
|
case 'open-quote':
|
|
1120
|
-
text += quoteAt(style.quotes, this._quoteDepth, 0);
|
|
1197
|
+
text += quoteAt(style.quotes, this._quoteDepth, 0, languageOf(el));
|
|
1121
1198
|
this._quoteDepth += 1;
|
|
1122
1199
|
break;
|
|
1123
1200
|
case 'close-quote':
|
|
1124
1201
|
// a close with nothing open writes nothing and closes nothing
|
|
1125
1202
|
if (this._quoteDepth > 0) {
|
|
1126
1203
|
this._quoteDepth -= 1;
|
|
1127
|
-
text += quoteAt(style.quotes, this._quoteDepth, 1);
|
|
1204
|
+
text += quoteAt(style.quotes, this._quoteDepth, 1, languageOf(el));
|
|
1128
1205
|
}
|
|
1129
1206
|
break;
|
|
1130
1207
|
case 'no-open-quote':
|
|
@@ -1146,7 +1223,10 @@ class Builder {
|
|
|
1146
1223
|
* the image's size once the host has it and none before. An image that
|
|
1147
1224
|
* never arrives takes no room, as no image does.
|
|
1148
1225
|
*/
|
|
1149
|
-
_contentImage(url, into, style, owner
|
|
1226
|
+
_contentImage(url, into, style, owner,
|
|
1227
|
+
/** Its size where it is a list marker's, which has one whatever the
|
|
1228
|
+
* image says (`_markerImageSize`). */
|
|
1229
|
+
marker) {
|
|
1150
1230
|
const box = new Box('replaced', null, {
|
|
1151
1231
|
...inherit(style, this._options.cascade.initial),
|
|
1152
1232
|
display: 'inline',
|
|
@@ -1156,13 +1236,39 @@ class Builder {
|
|
|
1156
1236
|
CONTENT_IMAGES.set(box, url);
|
|
1157
1237
|
const size = this._options.urlSize?.(url) ?? null;
|
|
1158
1238
|
this._contentImages.push({ url, element: owner, sized: !!size });
|
|
1159
|
-
if (
|
|
1239
|
+
if (marker) {
|
|
1240
|
+
const { width, height } = marker;
|
|
1241
|
+
const ratio = width > 0 && height > 0 ? width / height : 0;
|
|
1242
|
+
box.intrinsic = { width, height, missing: 0, ratio };
|
|
1243
|
+
}
|
|
1244
|
+
else if (size)
|
|
1160
1245
|
setIntrinsics(box, size, this._options.scale ?? 1);
|
|
1161
1246
|
else
|
|
1162
1247
|
box.intrinsic = { width: 0, height: 0, missing: 0, ratio: 0 };
|
|
1163
1248
|
this._ws = after('atomic', this._ws, this._ws);
|
|
1164
1249
|
this._lettered = false;
|
|
1165
1250
|
this._abandonLetter();
|
|
1251
|
+
return box;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* A list marker image's size, in device pixels: its own where it has one,
|
|
1255
|
+
* and where it lacks some — an SVG with only a `viewBox`, or with no size
|
|
1256
|
+
* and no ratio — CSS Images' default sizing in a square half its face's
|
|
1257
|
+
* ascent across. CSS Lists 3 (3.3) makes the square 1em, which both
|
|
1258
|
+
* engines find too large (w3c/csswg-drafts#4207): Blink's is half the
|
|
1259
|
+
* ascent, rounded to a whole pixel first
|
|
1260
|
+
* (`LayoutListMarkerImage::DefaultSize`), Gecko's 0.4em, and this is
|
|
1261
|
+
* Blink's. A `viewBox` alone came to 0 by 0 and drew no marker at all,
|
|
1262
|
+
* and inside the item to the 300 by 150 a generated image defaults to.
|
|
1263
|
+
*/
|
|
1264
|
+
_markerImageSize(size, style) {
|
|
1265
|
+
let side = 0;
|
|
1266
|
+
// CoreText reads a size of 0 as its default twelve points
|
|
1267
|
+
if ((size.width === null || size.height === null) && style.fontSize > 0) {
|
|
1268
|
+
const ascent = this._options.faceAscent?.(style) ?? style.fontSize * 0.8;
|
|
1269
|
+
side = Math.round(ascent) / 2;
|
|
1270
|
+
}
|
|
1271
|
+
return concreteSize(size, side, side, this._options.scale ?? 1);
|
|
1166
1272
|
}
|
|
1167
1273
|
/** A text node, whitespace-processed per the inherited `white-space`. */
|
|
1168
1274
|
_textNode(data, into, style, owner) {
|
|
@@ -1747,6 +1853,39 @@ function after(flow, inside, before) {
|
|
|
1747
1853
|
return 'start';
|
|
1748
1854
|
}
|
|
1749
1855
|
}
|
|
1856
|
+
/**
|
|
1857
|
+
* How many anonymous boxes the fix-up will put between a box of `kind` and
|
|
1858
|
+
* the box it is appended to, `parent` (`fixUpTable`, `wrapOrphans`,
|
|
1859
|
+
* `wrapTableParts`): a table part outside a table is given what it is
|
|
1860
|
+
* missing of one, and what is in a table and no part of it is given a
|
|
1861
|
+
* cell, a row and a row group. A cell in a block is in a table, a row group
|
|
1862
|
+
* and a row of its own, and a block in a row is in a cell. Counted against
|
|
1863
|
+
* `MAX_DEPTH`, which bounds the boxes and not the elements.
|
|
1864
|
+
*/
|
|
1865
|
+
function wrappersAround(parent, kind, style) {
|
|
1866
|
+
const column = style.display === 'table-column' || style.display === 'table-column-group';
|
|
1867
|
+
switch (parent) {
|
|
1868
|
+
case 'table':
|
|
1869
|
+
if (kind === 'table-row-group' || kind === 'table-caption' || column) {
|
|
1870
|
+
return 0;
|
|
1871
|
+
}
|
|
1872
|
+
return kind === 'table-row' ? 1 : kind === 'table-cell' ? 2 : 3;
|
|
1873
|
+
case 'table-row-group':
|
|
1874
|
+
return kind === 'table-row' ? 0 : kind === 'table-cell' ? 1 : 2;
|
|
1875
|
+
case 'table-row':
|
|
1876
|
+
return kind === 'table-cell' ? 0 : 1;
|
|
1877
|
+
}
|
|
1878
|
+
// a part out of flow is no part (`isTablePart`)
|
|
1879
|
+
if (style.position === 'absolute' ||
|
|
1880
|
+
style.position === 'fixed' ||
|
|
1881
|
+
style.float !== 'none') {
|
|
1882
|
+
return 0;
|
|
1883
|
+
}
|
|
1884
|
+
if (kind === 'table-row-group' || kind === 'table-caption' || column) {
|
|
1885
|
+
return 1;
|
|
1886
|
+
}
|
|
1887
|
+
return kind === 'table-row' ? 2 : kind === 'table-cell' ? 3 : 0;
|
|
1888
|
+
}
|
|
1750
1889
|
function boxKindFor(display) {
|
|
1751
1890
|
switch (display) {
|
|
1752
1891
|
case 'inline':
|