Represents content to flow among various block region elements. The NamedFlow interface allows access to both the content of the flow and the series of regions in which it displays, and helps determine if the content exceeds or falls short of the number of regions necessary to display it.
PropertiesGeneric event handler dispatches functions to add or delete regions based on changes to how content flows through a region chain:
document.getNamedFlows().namedItem('main').addEventListener(
'regionoversetchange', modifyFlow
);
document.getNamedFlows().namedItem('figures').addEventListener(
'regionoversetchange', modifyFlow
);
function modifyFlow(e) {
var flow = e.target;
if (flow.overset) {
appendRegion(flow.name);
}
else if (flow.firstEmptyRegionIndex !== -1) {
trimRegions(flow.name);
}
}
Check if the opening paragraph splits across layout elements:
var flow = document.getNamedFlows().namedItem('main');
var elements = flow.getContent();
var firstPara = elements[0].querySelector('p:first-of-type');
var regions = flow.getRegionsByContent(firstPara);
if (regions.length > 1) {
adjustLayout(regions[0], firstPara);
}
Usage
Specifying an identifier for any element's flow-into CSS property diverts its content to a NamedFlow object, whose name corresponds to the property's value. Other elements that specify the same identifier as their flow-from property serve as a chain of 'regions' that dynamically display the content. (The NamedFlow object is still available with NULL content if those properties are later removed.)
Use the getNamedFlows() method to gather named flows from a document.
For an overview of CSS Regions, see Using CSS Regions to flow content through a layout.
Related specificationsNamedFlow
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4