[24] The NodeRect.js JavaScript library is available at <https://suika.suikawiki.org/www/css/noderect/NodeRect.js>.
Converts two CSS <length>s into pixel-unit in the context of element. Return {width: pixel-width, height: pixel-height}.
Margin area of the element.
Supported browsers: All.
Border area of the element.
Supported browsers: All.
Padding area of the element.
Supported browsers: All.
Box represented by offset* attributes of the element.
Supported browsers: All.
Origin: Browser-dependent.
Box represented by client* attributes of the element.
Supported browsers: All.
Origin: Browser-dependent.
Box represented by scrollWidth and scrollHeight
attributes of the element.
Supported browsers: All.
Origin: Browser-dependent.
The point represented by scrollTop and scrollLeft
attributes of the element.
Supported browsers: All.
Origin: Browser-dependent.
Offset box of the element.
If margin collapsing occurs for the html and/or
body elements, the result is wrong.
Origin: position-absolute-origin.
Supported browsers: WebKit and Opera. In Gecko and WinIE the result might be incorrect.
The content box generated by the element.
It might be wrong when the paddingBox is wrong.
Origin: The position-absolute origin.
Supported browsers: All.
The padding box generated by the element.
It might be wrong when the borderBox is wrong.
In addition, if the element is the html element or the
body element, the result might be wrong.
Origin: The position-absolute origin.
Supported browsers: All.
The border box generated by the element.
html and
body element has overflow property specified,
the result might be wrong.html element or the
body element, the result might be wrong.html and/or
body elements.offset* attributes do not return reasonable
values (e.g. td:first-child).Origin: position-absolute-origin.
Supported browsers: All.
The margin box generated by the element.
It might be wrong when the borderBox is wrong.
Origin: position-absolute-origin.
Supported browsers: All.
The box returned by getBoundingClientRect method of the element.
Origin: Browser-dependent.
Supported browsers: Gecko, Opera, and WinIE.
Same as >>18 getBoxAreas.
The box returned by getBoxObjectFor method.
Origin: Browser-dependent.
Supported browser: Gecko.
The box returned by getBoxObjectFor method.
Origin: The top left corner of the screen.
Supported browser: Gecko.
The box returned by bounding* attributes of TextRange
object for the element, if any.
Origin: The top left corner of the viewport border box.
Supported browser: WinIE.
The box returned by getBoundingClientRect method of TextRange
object for the element, if any.
Origin: The top left corner of the viewport border box.
Supported browser: WinIE.
The point returned by offset* attributes of TextRange
object for the element, if any.
Origin: The top left corner of the viewport border box.
Supported browser: WinIE.
The origin of the getBoundingClientRect method, measured by inserting an
element into the document.
Origin: The position-absolute origin.
Supported browsers: WinIE, Opera, and Gecko.
The origin of the canvas.
Origin: The position-absolute origin.
Supported browsers: All.
The origin of the rect returned by the getBoundingClientRect method.
Origin: The position-absolute origin.
Supported browsers: All.
Origin: The position-absolute-origin.
Supported browsers: All.
The content area of the viewport (not including scrollbars and border area).
Origin: The position-absolute-origin.
Supported browsers: All.
The top left corner of the inner edge of the viewport.
Origin: The top left corner of the canvas.
Supported browsers: All.
The point returned by window.pageXOffset and
window.pageYOffset attributes.
Origin: The top left corner of the canvas.
Supported browsers: WebKit, Gecko, and Opera.
The document element's boxes.
The body element's boxes.
The entire viewport, including scrollbars.
Origin: The top left corner of the viewport.
Supported browsers: WebKit, Gecko, and Opera.
The point returned by window.scrollX and
window.scrollY attributes.
Origin: The top left corner of the canvas.
Supported browsers: WebKit and Gecko.
The point represented by (window.scrollMaxX,
window.scrollMaxY).
Origin: N/A.
Supported browsers: Gecko.
The box represented by document.width and
document.height attributes.
Origin: Browser-dependent.
Supported browsers: WebKit and Gecko.
The rect representing the browser window.
Origin: The top left corner of the browser window.
Supported browsers: WebKit, Gecko, and Opera.
The top left corner of the browser window.
Origin: The top left corner of the screen.
Supported browsers: WebKit, Gecko, and Opera (broken).
The top left corner of the browser window.
Origin: The top left corner of the screen.
Supported browsers: WebKit, Gecko, and WinIE.
The rect representing the screen.
Origin: In Gecko, the origin of the screen coordinate space. In WebKit, Opera, and WinIE, the top left corner of the screen.
Supported browsers: All.
The available area in the screen.
Origin: In WebKit and Gecko, the top left corner of the screen. In Opera and WinIE, the top left corner of the available area.
Supported browsers: All.
The mouse event location in the canvas.
Origin: The position-absolute origin.
Supported browsers: All.
The mouse event location in the viewport.
Origin: The position-absolute origin.
Supported browsers: All.
The clientX/clientY value.
Origin: The top left corner of the canvas visible area.
Supported browsers: All.
The offsetX/offsetY value.
Origin: Browser-dependent.
Supported browsers: WebKit, Opera, WinIE.
The screenX/screenY value.
Origin: The top left corner of the screen.
Supported browsers: All.
The width/height value.
Origin: Browser-dependent.
Supported browser: NC4.
The pageX/pageY value.
Origin: Browser-dependent.
Supported browsers: Gecko, WebKit, Opera.
The layerX/layerY value.
Origin: Browser-dependent.
The x/y value.
Origin: Browser dependent.
Supported browsers: WebKit, Opera, WinIE.
[26] If a function NROnLoad of the global scope is defined, it is invoked
when all of the classes defined in the NodeRect.js are loaded.
[25] The position-absolute origin is the top left corner of the box that would be generated from
a child element with position: absolute; top: 0; left: 0 of
the body element. It is same as the origin of the canvas, according to the
CSS 2.1 specification. However, in Gecko, it is instead the top left corner of the padding edge of
the box generated by the root element.
[33] See NodeRectViewer.js, an interactive user interface for the NR.js.
[34] rtl support
[35] non-HTML elements
[36] iframe/frame