Constructor
new PositionFixed(chunker, polisher, caller)
Creates an instance of PositionFixed.
Creates an instance of PositionFixed.
Parameters:
Name | Type | Description |
---|---|---|
chunker |
Object | The chunker instance used for pagination. |
polisher |
Object | The polisher instance responsible for styles. |
caller |
Object | The object coordinating the handlers. |
Members
fixedElements :Array.<HTMLElement>
Collected DOM elements that matched fixed position rules.
Collected DOM elements that matched fixed position rules. These are inserted back on each page during layout.
Type:
- Array.<HTMLElement>
fixedElementsSelector :Array.<string>
Array of selectors that match position: fixed
elements.
Array of selectors that match position: fixed
elements.
Type:
- Array.<string>
styleSheet :CSSStyleSheet
Type:
- CSSStyleSheet
Methods
afterPageLayout(pageElement, page, breakToken)
After each page layout, this method re-inserts all collected fixed
elements into the top of the page, effectively simulating position: fixed
.
After each page layout, this method re-inserts all collected fixed
elements into the top of the page, effectively simulating position: fixed
.
Parameters:
Name | Type | Description |
---|---|---|
pageElement |
HTMLElement | The DOM element for the current page. |
page |
Object | Metadata or state for the current page. |
breakToken |
Object | Information about content breaks (unused here). |
afterParsed(fragment)
After parsing the full document, this method finds all elements
that matched position: fixed
, applies position: absolute
instead,
removes them from the DOM flow, and stores them for re-insertion.
After parsing the full document, this method finds all elements
that matched position: fixed
, applies position: absolute
instead,
removes them from the DOM flow, and stores them for re-insertion.
Parameters:
Name | Type | Description |
---|---|---|
fragment |
DocumentFragment | The parsed document fragment. |
onDeclaration(declaration, dItem, dList, rule)
Intercepts position: fixed
declarations, saves their selector,
and removes the declaration from the stylesheet.
Intercepts position: fixed
declarations, saves their selector,
and removes the declaration from the stylesheet.
Parameters:
Name | Type | Description |
---|---|---|
declaration |
Object | The CSS AST node for the declaration. |
dItem |
Object | The item in the declaration list. |
dList |
Object | The full declaration list. |
rule |
Object | The rule containing this declaration. |