getRegionsByContent

Jump to: navigation, search

getRegionsByContent()

This article is Ready to Use.


W3C Working Draft

Summary

Returns the static sequence of regions that contain at least part of the supplied target content element.

Method of apis/css-regions/NamedFlow

Syntax

var regions = flow.getRegionsByContent(element);

Parameters

element

Data-type: DOM Node

Return Value

Returns an object of type function.

Returns the static sequence of regions that contain at least part of the supplied target content element. The regions are returned in document order.




Compatibility

There is no data available for topic "webapi", feature "getRegionsByContent". If you think that there should be data available, consider opening an issue.

Examples

Checks if the last paragraph in a flow splits across more than one region

JavaScript

// get flow:
var flow = document.getNamedFlows().namedItem('main');
// get all top-level flow-into elements that contribute to flow:
var elements = flow.getContent();
// get last element:
var lastElement = elements[elements.length-1];
// from within last element, get last paragraph;
var lastPara = lastElement.querySelector('p:last-of-type');
// get regions in which last paragraph displays:
var regions = flow.getRegionsByContent(lastPara);
// check if last paragraph splits across regions:
if (regions.length > 1) {
    // do something?
}



Related specifications

Specification Status Related Changes
CSS Regions Module Level 1 W3C Working Draft

See also

Related articles

Regions







  • getRegionsByContent()

























External resources