getRegionsByContent
< apis | css-regions | NamedFlow
getRegionsByContent
This page has been flagged with the following issues:
High-level issues:
W3C Editor's Draft
Summary
Returns the series 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.
Examples
Checks if the last paragraph in a flow splits across more than one region
JavaScript
// get flow:
var flow = document.getNamedFlows()['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 3 | W3C Editor's Draft |
Compatibility
Desktop
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic Support | 20 -webkit |
Unsupported | Unsupported | Unsupported |
534 -webkit
|
Mobile
| Feature | Android | BlackBerry | Chrome for mobile | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Opera Mini | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic Support | Unsupported | Unsupported | Unsupported | Unsupported | Unsupported | Unsupported | Unsupported | Unsupported |
See also
Related articles
Regions
- getRegionsByContent
External resources
- W3C editor's draft: CSS Regions Module Level 3
- Adobe Web Standards: CSS Regions
- Adobe Developer's Network: CSS3 Regions: Rich page layout with HTML and CSS3
- Sample pages
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here