Constructor
new RunningHeaders(chunker, polisher, caller)
Creates an instance of RunningHeaders.
Creates an instance of RunningHeaders.
Parameters:
Name | Type | Description |
---|---|---|
chunker |
Object | The chunker instance controlling content chunking. |
polisher |
Object | The polisher instance controlling polishing/styling. |
caller |
Object | The caller or controller invoking this handler. |
Extends
- Handler
Members
elements
Stores element() CSS content references keyed by selector string.
Stores element() CSS content references keyed by selector string.
runningSelectors
Stores running header selectors keyed by the running identifier.
Stores running header selectors keyed by the running identifier.
Methods
afterPageLayout(fragment)
Called after page layout is complete.
Called after page layout is complete. Inserts cloned running header elements into their target containers.
Parameters:
Name | Type | Description |
---|---|---|
fragment |
DocumentFragment | The DOM fragment for the current page. |
afterParsed(fragment)
Called after the DOM fragment is parsed.
Called after the DOM fragment is parsed.
Hides running header elements by setting display: none
.
Parameters:
Name | Type | Description |
---|---|---|
fragment |
DocumentFragment | The parsed DOM fragment. |
beforeTreeParse(text, sheet)
Adjusts CSS text before parsing.
Adjusts CSS text before parsing.
Fixes parsing issues with element()
by renaming it to element-ident()
.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | The CSS text to parse. |
sheet |
Object | The CSS stylesheet object. |
onDeclaration(declaration, dItem, dList, rule)
Processes CSS declarations to find and store position: running()
and content: element()
rules.
Processes CSS declarations to find and store position: running()
and content: element()
rules.
Parameters:
Name | Type | Description |
---|---|---|
declaration |
Object | The CSS declaration node. |
dItem |
Object | Declaration item (not used here). |
dList |
Object | Declaration list (not used here). |
rule |
Object | The CSS rule node that contains the declaration. |
orderSelectors(obj) → {Array.<string>}
Orders selectors based on their page weight.
Orders selectors based on their page weight.
Does not deduplicate selectors; later selectors overwrite previous ones.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object.<string, any> | The selectors object. |
Returns:
Ordered selectors array.
- Type
- Array.<string>
pageWeight(sopt) → {number}
Assigns a weight to @page selector classes for ordering.
Assigns a weight to @page selector classes for ordering.
Weights:
- page
- left & right
- blank
- first & nth
- named page
- named left & right
- named first & nth
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
s |
string |
<optional> |
The selector string. |
Returns:
Weight value for ordering.
- Type
- number