@vivliostyle/core 2.39.1 → 2.41.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/lib/vivliostyle/adaptive-viewer.d.ts +5 -0
- package/lib/vivliostyle/assets.d.ts +6 -6
- package/lib/vivliostyle/base.d.ts +6 -0
- package/lib/vivliostyle/break.d.ts +6 -0
- package/lib/vivliostyle/cmyk-store.d.ts +109 -0
- package/lib/vivliostyle/columns.d.ts +7 -0
- package/lib/vivliostyle/core-viewer.d.ts +6 -0
- package/lib/vivliostyle/counters.d.ts +52 -0
- package/lib/vivliostyle/css-cascade.d.ts +48 -7
- package/lib/vivliostyle/css-page.d.ts +20 -0
- package/lib/vivliostyle/css-prop.d.ts +6 -2
- package/lib/vivliostyle/css-styler.d.ts +17 -1
- package/lib/vivliostyle/epub.d.ts +38 -1
- package/lib/vivliostyle/footnotes.d.ts +1 -1
- package/lib/vivliostyle/layout-helper.d.ts +26 -5
- package/lib/vivliostyle/layout.d.ts +43 -4
- package/lib/vivliostyle/ops.d.ts +45 -1
- package/lib/vivliostyle/page-floats.d.ts +36 -2
- package/lib/vivliostyle/plugin.d.ts +13 -1
- package/lib/vivliostyle/pseudo-element.d.ts +0 -4
- package/lib/vivliostyle/semantic-footnote.d.ts +20 -0
- package/lib/vivliostyle/table.d.ts +24 -1
- package/lib/vivliostyle/toc.d.ts +3 -1
- package/lib/vivliostyle/types.d.ts +13 -10
- package/lib/vivliostyle/vgen.d.ts +35 -3
- package/lib/vivliostyle/vtree.d.ts +1 -1
- package/lib/vivliostyle.js +119 -65
- package/lib/vivliostyle.js.map +4 -4
- package/package.json +4 -3
|
@@ -22,6 +22,19 @@ export declare class PageFloat implements PageFloats.PageFloat {
|
|
|
22
22
|
readonly floatMinWrapBlock: Css.Numeric | null;
|
|
23
23
|
order: number | null;
|
|
24
24
|
id: PageFloatID | null;
|
|
25
|
+
/**
|
|
26
|
+
* Set to true when this float is created inside a page float area.
|
|
27
|
+
* Used to bypass the normal anchor check in isAllowedOnContext because
|
|
28
|
+
* the anchor node is lost after page-level invalidation. (Issue #1675)
|
|
29
|
+
*/
|
|
30
|
+
insidePageFloatArea: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Reference to the parent page float that contains this float.
|
|
33
|
+
* Set when this float is created inside a page float area, allowing
|
|
34
|
+
* isAllowedOnContext to check whether the parent is still present.
|
|
35
|
+
* (Issue #1675)
|
|
36
|
+
*/
|
|
37
|
+
parentPageFloat: PageFloat | null;
|
|
25
38
|
constructor(nodePosition: Vtree.NodePosition, floatReference: FloatReference, floatSide: string, clearSide: string | null, flowName: string, floatMinWrapBlock: Css.Numeric | null);
|
|
26
39
|
getOrder(): number;
|
|
27
40
|
getId(): PageFloatID;
|
|
@@ -89,8 +102,28 @@ export declare class PageFloatLayoutContext implements PageFloats.PageFloatLayou
|
|
|
89
102
|
private floatsDeferredFromPrevious;
|
|
90
103
|
private layoutConstraints;
|
|
91
104
|
private locked;
|
|
105
|
+
/**
|
|
106
|
+
* Reference to the outer column's context for page float area contexts.
|
|
107
|
+
* Used only for getParent() navigation to propagate nested page floats
|
|
108
|
+
* and footnotes to region/page level. Unlike `parent`, this does NOT
|
|
109
|
+
* affect children registration, isInvalidated() propagation, or
|
|
110
|
+
* getFloatFragmentExclusions(). (Issue #1675)
|
|
111
|
+
*/
|
|
112
|
+
private outerContext;
|
|
92
113
|
constructor(parent: PageFloatLayoutContext, floatReference: FloatReference | null, container: Vtree.Container, flowName: string | null, generatingNodePosition: Vtree.NodePosition | null, writingMode: Css.Val | null, direction: Css.Val | null);
|
|
114
|
+
/**
|
|
115
|
+
* Returns the effective parent context for hierarchy traversal.
|
|
116
|
+
* For normal contexts, returns `parent`. For page float area contexts
|
|
117
|
+
* (where `parent` is null), falls back to `outerContext`. (Issue #1675)
|
|
118
|
+
*/
|
|
119
|
+
get effectiveParent(): PageFloatLayoutContext | null;
|
|
93
120
|
private getParent;
|
|
121
|
+
/**
|
|
122
|
+
* Set the outer context for a page float area context.
|
|
123
|
+
* This shares the float store so that page floats/footnotes created inside
|
|
124
|
+
* a page float area are visible at all levels. (Issue #1675)
|
|
125
|
+
*/
|
|
126
|
+
setOuterContext(outerContext: PageFloatLayoutContext): void;
|
|
94
127
|
private getPreviousSiblingOf;
|
|
95
128
|
private getPreviousSibling;
|
|
96
129
|
getContainer(floatReference?: FloatReference): Vtree.Container;
|
|
@@ -144,7 +177,8 @@ export declare class PageFloatLayoutContext implements PageFloats.PageFloatLayou
|
|
|
144
177
|
getFloatFragmentExclusions(): GeometryUtil.Shape[];
|
|
145
178
|
private reattachFloatFragments;
|
|
146
179
|
getMaxReachedAfterEdge(): number;
|
|
147
|
-
|
|
180
|
+
getBlockEndEdgeOfBlockStartFloats(inlinePos?: number): number;
|
|
181
|
+
getBlockStartEdgeOfBlockEndFloats(inlinePos?: number): number;
|
|
148
182
|
getPageFloatClearEdge(clear: string, column: LayoutType.Column): number;
|
|
149
183
|
getPageFloatPlacementCondition(float: PageFloat, floatSide: string, clearSide: string | null): PageFloatPlacementCondition;
|
|
150
184
|
getLayoutConstraints(): LayoutType.LayoutConstraint[];
|
|
@@ -174,7 +208,7 @@ export declare class NormalPageFloatLayoutStrategy implements PageFloatLayoutStr
|
|
|
174
208
|
/** @override */
|
|
175
209
|
findPageFloatFragment(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): PageFloatFragment | null;
|
|
176
210
|
/** @override */
|
|
177
|
-
adjustPageFloatArea(floatArea: LayoutType.PageFloatArea, floatContainer: Vtree.Container, column: LayoutType.Column): void
|
|
211
|
+
adjustPageFloatArea(floatArea: LayoutType.PageFloatArea, floatContainer: Vtree.Container, column: LayoutType.Column): Task.Result<void>;
|
|
178
212
|
/** @override */
|
|
179
213
|
forbid(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): void;
|
|
180
214
|
}
|
|
@@ -125,7 +125,15 @@ export declare enum HOOKS {
|
|
|
125
125
|
* {Array.<Vtree.NodeContext>} checkPoints
|
|
126
126
|
* {Layout.Column} column
|
|
127
127
|
*/
|
|
128
|
-
POST_LAYOUT_BLOCK = "POST_LAYOUT_BLOCK"
|
|
128
|
+
POST_LAYOUT_BLOCK = "POST_LAYOUT_BLOCK",
|
|
129
|
+
/**
|
|
130
|
+
* Called when pagination progresses during document load.
|
|
131
|
+
*
|
|
132
|
+
* The hook is called with an object with the following properties:
|
|
133
|
+
* {number} fraction: Fraction of the HTML content already paginated (0-1)
|
|
134
|
+
* {number} pages: Number of pages created so far
|
|
135
|
+
*/
|
|
136
|
+
PAGINATION_PROGRESS = "PAGINATION_PROGRESS"
|
|
129
137
|
}
|
|
130
138
|
export type PreProcessSingleDocumentHook = (p1: Document) => any;
|
|
131
139
|
export type PreProcessTextContentHook = (p1: Vtree.NodeContext, p2: string) => Task.Result<string>;
|
|
@@ -139,6 +147,10 @@ export type ResolveTextNodeBreakerHook = (p1: Vtree.NodeContext) => Layout.TextN
|
|
|
139
147
|
export type ResolveFormattingContextHook = (p1: Vtree.NodeContext, p2: boolean, p3: Css.Val, p4: Css.Ident, p5: Css.Val, p6: boolean) => Vtree.FormattingContext;
|
|
140
148
|
export type ResolveLayoutProcessorHook = (p1: Vtree.FormattingContext) => LayoutProcessor.LayoutProcessor;
|
|
141
149
|
export type PostLayoutBlockHook = (p1: Vtree.NodeContext, p2: Vtree.NodeContext[], p3: Layout.Column) => void;
|
|
150
|
+
export type PaginationProgressHook = (p1: {
|
|
151
|
+
fraction: number;
|
|
152
|
+
pages: number;
|
|
153
|
+
}) => void;
|
|
142
154
|
/**
|
|
143
155
|
* Register a function to a hook with the specified name.
|
|
144
156
|
* The registered function is called at appropriate timings by the core code.
|
|
@@ -29,8 +29,4 @@ export declare class PseudoelementStyler implements PseudoElement.PseudoelementS
|
|
|
29
29
|
processContent(element: Element, styles: {
|
|
30
30
|
[key: string]: Css.Val;
|
|
31
31
|
}, nodeContext: Vtree.NodeContext): void;
|
|
32
|
-
/**
|
|
33
|
-
* ::marker support
|
|
34
|
-
*/
|
|
35
|
-
private processMarker;
|
|
36
32
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Vivliostyle Foundation
|
|
3
|
+
*
|
|
4
|
+
* Vivliostyle.js is free software: you can redistribute it and/or modify
|
|
5
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
6
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
7
|
+
* (at your option) any later version.
|
|
8
|
+
*
|
|
9
|
+
* Vivliostyle.js is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
* along with Vivliostyle.js. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* @fileoverview Semantic footnote helper utilities.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isSemanticFootnoteElement(element: Element): boolean;
|
|
20
|
+
export declare function isSemanticFootnoteNoterefElement(element: Element): boolean;
|
|
@@ -10,6 +10,8 @@ export declare class TableRow {
|
|
|
10
10
|
readonly rowIndex: number;
|
|
11
11
|
readonly sourceNode: Node;
|
|
12
12
|
cells: TableCell[];
|
|
13
|
+
breakBefore: string | null;
|
|
14
|
+
breakAfter: string | null;
|
|
13
15
|
constructor(rowIndex: number, sourceNode: Node);
|
|
14
16
|
addCell(cell: TableCell): void;
|
|
15
17
|
getMinimumHeight(): number;
|
|
@@ -51,6 +53,13 @@ export declare class BetweenTableRowBreakPosition extends BreakPosition.EdgeBrea
|
|
|
51
53
|
private rowIndex;
|
|
52
54
|
constructor(position: Vtree.NodeContext, breakOnEdge: string | null, overflows: boolean, columnBlockSize: number);
|
|
53
55
|
findAcceptableBreak(column: Layout.Column, penalty: number): Vtree.NodeContext;
|
|
56
|
+
/**
|
|
57
|
+
* Check if any non-spanning cell in the row has content that wasn't fully
|
|
58
|
+
* rendered. This happens when page floats (footnotes) reduce available space
|
|
59
|
+
* during a retry, causing cell content to overflow within the row even though
|
|
60
|
+
* the row boundary appears acceptable. (Issue #1663)
|
|
61
|
+
*/
|
|
62
|
+
private hasUnfinishedCells;
|
|
54
63
|
getMinBreakPenalty(): number;
|
|
55
64
|
getAcceptableCellBreakPositions(): Layout.BreakPositionAndNodeContext[];
|
|
56
65
|
private getRowIndex;
|
|
@@ -161,10 +170,19 @@ export declare class TableLayoutStrategy extends LayoutUtil.EdgeSkipper {
|
|
|
161
170
|
inHeader: boolean;
|
|
162
171
|
inFooter: boolean;
|
|
163
172
|
constructor(formattingContext: TableFormattingContext, column: Layout.Column);
|
|
173
|
+
startNonInlineElementNode(state: LayoutUtil.LayoutIteratorState): void | Task.Result<boolean>;
|
|
164
174
|
resetColumn(): void;
|
|
165
175
|
getColSpanningCellWidth(cell: TableCell): number;
|
|
166
176
|
layoutCell(cell: TableCell, cellNodeContext: Vtree.NodeContext, startChunkPosition: Vtree.ChunkPosition): Task.Result<boolean>;
|
|
167
|
-
|
|
177
|
+
/**
|
|
178
|
+
* Find the break position for the cell at the given slot index.
|
|
179
|
+
* Returns the break position and its index in cellBreakPositions, or null if not found.
|
|
180
|
+
* Uses sourceNode matching instead of sequential index to support layout retry (issue #1663).
|
|
181
|
+
*/
|
|
182
|
+
findBrokenCellAtSlot(slotIndex: number, sourceNode: Node): {
|
|
183
|
+
position: BrokenTableCellPosition;
|
|
184
|
+
index: number;
|
|
185
|
+
} | null;
|
|
168
186
|
private extractRowSpanningCellBreakPositions;
|
|
169
187
|
layoutRowSpanningCellsFromPreviousFragment(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
170
188
|
startTableRow(state: LayoutUtil.LayoutIteratorState): Task.Result<boolean>;
|
|
@@ -186,6 +204,11 @@ export declare class TableLayoutProcessor implements LayoutProcessor.LayoutProce
|
|
|
186
204
|
*/
|
|
187
205
|
normalizeColGroups(formattingContext: TableFormattingContext, tableElement: Element, column: Layout.Column): void;
|
|
188
206
|
doInitialLayout(nodeContext: Vtree.NodeContext, column: Layout.Column): Task.Result<Vtree.NodeContext>;
|
|
207
|
+
/**
|
|
208
|
+
* Check if any row inside the table has a forced break value
|
|
209
|
+
* (propagated from cells or set on the row itself).
|
|
210
|
+
*/
|
|
211
|
+
private hasForcedBreakInRows;
|
|
189
212
|
addCaptions(formattingContext: TableFormattingContext, rootViewNode: Element, firstChild: Node | null): void;
|
|
190
213
|
addColGroups(formattingContext: TableFormattingContext, rootViewNode: Element, firstChild: Node | null): void;
|
|
191
214
|
removeColGroups(formattingContext: TableFormattingContext, rootViewNode: Element): void;
|
package/lib/vivliostyle/toc.d.ts
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* @fileoverview Toc - Table of Contents view.
|
|
20
20
|
*/
|
|
21
21
|
import * as Base from "./base";
|
|
22
|
+
import * as CmykStore from "./cmyk-store";
|
|
22
23
|
import * as Counters from "./counters";
|
|
23
24
|
import * as Exprs from "./exprs";
|
|
24
25
|
import * as Font from "./font";
|
|
@@ -49,12 +50,13 @@ export declare class TOCView implements Vgen.CustomRendererFactory {
|
|
|
49
50
|
};
|
|
50
51
|
readonly documentURLTransformer: Base.DocumentURLTransformer;
|
|
51
52
|
readonly counterStore: Counters.CounterStore;
|
|
53
|
+
readonly cmykStore: CmykStore.CmykStore;
|
|
52
54
|
pref: Exprs.Preferences;
|
|
53
55
|
page: Vtree.Page;
|
|
54
56
|
instance: OPS.StyleInstance;
|
|
55
57
|
constructor(store: OPS.OPSDocStore, url: string, lang: string | null, clientLayout: Vtree.ClientLayout, fontMapper: Font.Mapper, pref: Exprs.Preferences, rendererFactory: Vgen.CustomRendererFactory, fallbackMap: {
|
|
56
58
|
[key: string]: string;
|
|
57
|
-
}, documentURLTransformer: Base.DocumentURLTransformer, counterStore: Counters.CounterStore);
|
|
59
|
+
}, documentURLTransformer: Base.DocumentURLTransformer, counterStore: Counters.CounterStore, cmykStore: CmykStore.CmykStore);
|
|
58
60
|
setAutoHeight(elem: Element, depth: number): void;
|
|
59
61
|
/** @override */
|
|
60
62
|
makeCustomRenderer(xmldoc: XmlDoc.XMLDocHolder): Vgen.CustomRenderer;
|
|
@@ -110,6 +110,7 @@ export declare namespace Layout {
|
|
|
110
110
|
last: Node;
|
|
111
111
|
viewDocument: Document;
|
|
112
112
|
flowRootFormattingContext: Vtree.FormattingContext;
|
|
113
|
+
isNonFirstColumn: boolean;
|
|
113
114
|
isFloat: boolean;
|
|
114
115
|
isFootnote: boolean;
|
|
115
116
|
startEdge: number;
|
|
@@ -142,6 +143,7 @@ export declare namespace Layout {
|
|
|
142
143
|
pseudoParent: Column;
|
|
143
144
|
nodeContextOverflowingDueToRepetitiveElements: Vtree.NodeContext | null;
|
|
144
145
|
blockDistanceToBlockEndFloats: number;
|
|
146
|
+
lastLineStride: number;
|
|
145
147
|
computedBlockSize: number;
|
|
146
148
|
layoutContext: Vtree.LayoutContext;
|
|
147
149
|
clientLayout: Vtree.ClientLayout;
|
|
@@ -235,8 +237,8 @@ export declare namespace Layout {
|
|
|
235
237
|
* Layout a single float element.
|
|
236
238
|
*/
|
|
237
239
|
layoutFloat(nodeContext: Vtree.NodeContext): Task.Result<Vtree.NodeContext>;
|
|
238
|
-
setupFloatArea(area: PageFloatArea, floatReference: PageFloats.FloatReference, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): boolean
|
|
239
|
-
createPageFloatArea(float: PageFloats.PageFloat | null, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): PageFloatArea | null
|
|
240
|
+
setupFloatArea(area: PageFloatArea, floatReference: PageFloats.FloatReference, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): Task.Result<boolean>;
|
|
241
|
+
createPageFloatArea(float: PageFloats.PageFloat | null, floatSide: string, anchorEdge: number | null, strategy: PageFloats.PageFloatLayoutStrategy, condition: PageFloats.PageFloatPlacementCondition): Task.Result<PageFloatArea | null>;
|
|
240
242
|
layoutSinglePageFloatFragment(continuations: PageFloats.PageFloatContinuation[], floatSide: string, clearSide: string | null, allowFragmented: boolean, strategy: PageFloats.PageFloatLayoutStrategy, anchorEdge: number | null, pageFloatFragment?: PageFloats.PageFloatFragment | null): Task.Result<SinglePageFloatLayoutResult>;
|
|
241
243
|
layoutPageFloatInner(continuation: PageFloats.PageFloatContinuation, strategy: PageFloats.PageFloatLayoutStrategy, anchorEdge: number | null, pageFloatFragment?: PageFloats.PageFloatFragment): Task.Result<boolean>;
|
|
242
244
|
setFloatAnchorViewNode(nodeContext: Vtree.NodeContext): Vtree.NodeContext;
|
|
@@ -286,10 +288,6 @@ export declare namespace Layout {
|
|
|
286
288
|
* Determines if a page break is acceptable at this position
|
|
287
289
|
*/
|
|
288
290
|
isBreakable(flowPosition: Vtree.NodeContext): boolean;
|
|
289
|
-
/**
|
|
290
|
-
* Determines if an indent value is zero
|
|
291
|
-
*/
|
|
292
|
-
zeroIndent(val: string | number): boolean;
|
|
293
291
|
/**
|
|
294
292
|
* @return true if overflows
|
|
295
293
|
*/
|
|
@@ -384,6 +382,7 @@ export declare namespace Layout {
|
|
|
384
382
|
readonly parentContainer: Vtree.Container;
|
|
385
383
|
convertPercentageSizesToPx(target: Element): void;
|
|
386
384
|
fixFloatSizeAndPosition(nodeContext: Vtree.NodeContext): void;
|
|
385
|
+
getContentBlockMarginAfter(): number;
|
|
387
386
|
getContentInlineSize(): number;
|
|
388
387
|
}
|
|
389
388
|
}
|
|
@@ -437,6 +436,8 @@ export declare namespace PageFloats {
|
|
|
437
436
|
interface PageFloat {
|
|
438
437
|
order: number | null;
|
|
439
438
|
id: PageFloatID | null;
|
|
439
|
+
insidePageFloatArea: boolean;
|
|
440
|
+
parentPageFloat: PageFloat | null;
|
|
440
441
|
readonly nodePosition: Vtree.NodePosition;
|
|
441
442
|
readonly floatReference: FloatReference;
|
|
442
443
|
readonly floatSide: string;
|
|
@@ -477,10 +478,12 @@ export declare namespace PageFloats {
|
|
|
477
478
|
direction: Css.Val;
|
|
478
479
|
floatFragments: PageFloatFragment[];
|
|
479
480
|
readonly parent: PageFloatLayoutContext;
|
|
481
|
+
readonly effectiveParent: PageFloatLayoutContext | null;
|
|
480
482
|
readonly flowName: string | null;
|
|
481
483
|
readonly generatingNodePosition: Vtree.NodePosition | null;
|
|
482
484
|
getContainer(floatReference?: FloatReference): Vtree.Container;
|
|
483
485
|
setContainer(container: Vtree.Container): any;
|
|
486
|
+
setOuterContext(outerContext: PageFloatLayoutContext): void;
|
|
484
487
|
addPageFloat(float: PageFloat): void;
|
|
485
488
|
getPageFloatLayoutContext(floatReference: FloatReference): PageFloatLayoutContext;
|
|
486
489
|
findPageFloatByNodePosition(nodePosition: Vtree.NodePosition): PageFloat | null;
|
|
@@ -522,7 +525,8 @@ export declare namespace PageFloats {
|
|
|
522
525
|
setFloatAreaDimensions(area: Layout.PageFloatArea, floatReference: FloatReference, floatSide: string, anchorEdge: number | null, init: boolean, force: boolean, condition: PageFloatPlacementCondition): string | null;
|
|
523
526
|
getFloatFragmentExclusions(): GeometryUtil.Shape[];
|
|
524
527
|
getMaxReachedAfterEdge(): number;
|
|
525
|
-
|
|
528
|
+
getBlockEndEdgeOfBlockStartFloats(inlinePos?: number): number;
|
|
529
|
+
getBlockStartEdgeOfBlockEndFloats(inlinePos?: number): number;
|
|
526
530
|
getPageFloatClearEdge(clear: string, column: Layout.Column): number;
|
|
527
531
|
getPageFloatPlacementCondition(float: PageFloat, floatSide: string, clearSide: string | null): PageFloatPlacementCondition;
|
|
528
532
|
getLayoutConstraints(): Layout.LayoutConstraint[];
|
|
@@ -538,7 +542,7 @@ export declare namespace PageFloats {
|
|
|
538
542
|
createPageFloat(nodeContext: Vtree.NodeContext, pageFloatLayoutContext: PageFloatLayoutContext, column: Layout.Column): Task.Result<PageFloat>;
|
|
539
543
|
createPageFloatFragment(continuations: PageFloatContinuation[], floatSide: string, clearSide: string | null, floatArea: Layout.PageFloatArea, continues: boolean): PageFloatFragment;
|
|
540
544
|
findPageFloatFragment(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): PageFloatFragment | null;
|
|
541
|
-
adjustPageFloatArea(floatArea: Layout.PageFloatArea, floatContainer: Vtree.Container, column: Layout.Column):
|
|
545
|
+
adjustPageFloatArea(floatArea: Layout.PageFloatArea, floatContainer: Vtree.Container, column: Layout.Column): Task.Result<void>;
|
|
542
546
|
forbid(float: PageFloat, pageFloatLayoutContext: PageFloatLayoutContext): any;
|
|
543
547
|
}
|
|
544
548
|
}
|
|
@@ -707,7 +711,7 @@ export declare namespace Vtree {
|
|
|
707
711
|
* @param target element to apply styles to
|
|
708
712
|
* @return vertical
|
|
709
713
|
*/
|
|
710
|
-
applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): boolean
|
|
714
|
+
applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): Task.Result<boolean>;
|
|
711
715
|
/**
|
|
712
716
|
* Peel off innermost first-XXX pseudoelement, create and create view nodes
|
|
713
717
|
* after the end of that pseudoelement.
|
|
@@ -883,7 +887,6 @@ export declare namespace Vtree {
|
|
|
883
887
|
clearSide: string | null;
|
|
884
888
|
floatMinWrapBlock: Css.Numeric | null;
|
|
885
889
|
columnSpan: Css.Val | null;
|
|
886
|
-
verticalAlign: string;
|
|
887
890
|
captionSide: string;
|
|
888
891
|
inlineBorderSpacing: number;
|
|
889
892
|
blockBorderSpacing: number;
|
|
@@ -38,7 +38,14 @@ export declare class ViewFactory extends Base.SimpleEventTarget implements Vtree
|
|
|
38
38
|
[key: string]: string;
|
|
39
39
|
};
|
|
40
40
|
readonly documentURLTransformer: Base.DocumentURLTransformer;
|
|
41
|
+
readonly pageProps?: {
|
|
42
|
+
[key: string]: CssCascade.ElementStyle;
|
|
43
|
+
};
|
|
44
|
+
readonly cascadedPageStyle?: CssCascade.ElementStyle;
|
|
45
|
+
private readonly semanticFootnoteFirstRefOffsets;
|
|
46
|
+
private readonly semanticFootnoteFirstRefOffsetsInitialized;
|
|
41
47
|
private static SVG_URL_ATTRIBUTES;
|
|
48
|
+
private static FOOTNOTE_CALL_OWNER_ATTR;
|
|
42
49
|
document: Document;
|
|
43
50
|
exprContentListener: Vtree.ExprContentListener;
|
|
44
51
|
nodeContext: Vtree.NodeContext | null;
|
|
@@ -49,9 +56,18 @@ export declare class ViewFactory extends Base.SimpleEventTarget implements Vtree
|
|
|
49
56
|
viewNode: Node | null;
|
|
50
57
|
constructor(flowName: string, context: Exprs.Context, viewport: Viewport, styler: CssStyler.Styler, regionIds: string[], xmldoc: XmlDoc.XMLDocHolder, docFaces: Font.DocumentFaces, footnoteStyle: CssCascade.ElementStyle, stylerProducer: StylerProducer, page: Vtree.Page, customRenderer: CustomRenderer, fallbackMap: {
|
|
51
58
|
[key: string]: string;
|
|
52
|
-
}, documentURLTransformer: Base.DocumentURLTransformer
|
|
59
|
+
}, documentURLTransformer: Base.DocumentURLTransformer, pageProps?: {
|
|
60
|
+
[key: string]: CssCascade.ElementStyle;
|
|
61
|
+
}, cascadedPageStyle?: CssCascade.ElementStyle, semanticFootnoteFirstRefOffsets?: Map<string, number | null>, semanticFootnoteFirstRefOffsetsInitialized?: {
|
|
62
|
+
value: boolean;
|
|
63
|
+
});
|
|
53
64
|
/** @override */
|
|
54
65
|
clone(): Vtree.LayoutContext;
|
|
66
|
+
private initializeSemanticFootnoteFirstRefOffsets;
|
|
67
|
+
/**
|
|
68
|
+
* True only for the first semantic footnote reference to the same target.
|
|
69
|
+
*/
|
|
70
|
+
private shouldGenerateSemanticFootnote;
|
|
55
71
|
createPseudoelementShadow(element: Element, isRoot: boolean, cascStyle: CssCascade.ElementStyle, computedStyle: {
|
|
56
72
|
[key: string]: Css.Val;
|
|
57
73
|
}, styler: CssStyler.AbstractStyler, context: Exprs.Context, parentShadow: Vtree.ShadowContext, subShadow: Vtree.ShadowContext): Vtree.ShadowContext;
|
|
@@ -125,7 +141,22 @@ export declare class ViewFactory extends Base.SimpleEventTarget implements Vtree
|
|
|
125
141
|
setCurrent(nodeContext: Vtree.NodeContext, firstTime: boolean, atUnforcedBreak?: boolean): Task.Result<boolean>;
|
|
126
142
|
processShadowContent(pos: Vtree.NodeContext): Vtree.NodeContext;
|
|
127
143
|
private nextPositionInTree;
|
|
128
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Find a footnote-call element immediately before the given view node.
|
|
146
|
+
*/
|
|
147
|
+
private findImmediateFootnoteCallSibling;
|
|
148
|
+
/**
|
|
149
|
+
* True for semantic footnotes that already provide a noteref call in source
|
|
150
|
+
* (EPUB or DPUB-ARIA pattern), so an extra ::footnote-call must not be inserted.
|
|
151
|
+
*/
|
|
152
|
+
private isSemanticFootnoteElement;
|
|
153
|
+
/**
|
|
154
|
+
* Insert a footnote-call NodeContext before the footnote element.
|
|
155
|
+
* The footnote-call will be processed as a normal inline element,
|
|
156
|
+
* then shadowSibling will lead to the footnote element.
|
|
157
|
+
* (Issue #868)
|
|
158
|
+
*/
|
|
159
|
+
private insertFootnoteCall;
|
|
129
160
|
/** @override */
|
|
130
161
|
nextInTree(position: Vtree.NodeContext, atUnforcedBreak?: boolean): Task.Result<Vtree.NodeContext>;
|
|
131
162
|
addImageFetchers(bg: Css.Val): void;
|
|
@@ -156,7 +187,7 @@ export declare class ViewFactory extends Base.SimpleEventTarget implements Vtree
|
|
|
156
187
|
peelOff(nodeContext: Vtree.NodeContext, nodeOffset: number): Task.Result<Vtree.NodeContext>;
|
|
157
188
|
createElement(ns: string, tag: string): Element;
|
|
158
189
|
/** @override */
|
|
159
|
-
applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): boolean
|
|
190
|
+
applyFootnoteStyle(vertical: boolean, rtl: boolean, target: Element): Task.Result<boolean>;
|
|
160
191
|
/** @override */
|
|
161
192
|
processFragmentedBlockEdge(nodeContext: Vtree.NodeContext): void;
|
|
162
193
|
private fixClonedBoxDecorationOverflow;
|
|
@@ -178,6 +209,7 @@ export declare const propertiesNotPassedToDOM: {
|
|
|
178
209
|
"flow-linger": boolean;
|
|
179
210
|
"flow-options": boolean;
|
|
180
211
|
"flow-priority": boolean;
|
|
212
|
+
"footnote-display": boolean;
|
|
181
213
|
"footnote-policy": boolean;
|
|
182
214
|
"margin-break": boolean;
|
|
183
215
|
page: boolean;
|
|
@@ -123,6 +123,7 @@ export type Whitespace = Vtree.Whitespace;
|
|
|
123
123
|
*/
|
|
124
124
|
export declare function whitespaceFromPropertyValue(whitespace: string): Whitespace | null;
|
|
125
125
|
export declare function canIgnore(node: Node, whitespace?: Whitespace): boolean;
|
|
126
|
+
export declare function canIgnoreText(text: string, whitespace?: Whitespace): boolean;
|
|
126
127
|
export declare class Flow {
|
|
127
128
|
readonly flowName: string;
|
|
128
129
|
readonly parentFlowName: string | null;
|
|
@@ -222,7 +223,6 @@ export declare class NodeContext implements Vtree.NodeContext {
|
|
|
222
223
|
clearSide: string | null;
|
|
223
224
|
floatMinWrapBlock: Css.Numeric | null;
|
|
224
225
|
columnSpan: Css.Val | null;
|
|
225
|
-
verticalAlign: string;
|
|
226
226
|
captionSide: string;
|
|
227
227
|
inlineBorderSpacing: number;
|
|
228
228
|
blockBorderSpacing: number;
|