blockly > utils > style

utils.style namespace

Functions

Function Description
getBorderBox(element) Gets the computed border widths (on all sides) in pixels Copied from Closure's goog.style.getBorderBox
getComputedStyle(element, property)

Retrieves a computed style value of a node. It returns empty string if the property requested is an SVG one and it has not been explicitly set (firefox and webkit).

Copied from Closure's goog.style.getComputedStyle

getContainerOffsetToScrollInto(element, container, opt_center) Calculate the scroll position of container with the minimum amount so that the content and the borders of the given element become visible. If the element is bigger than the container, its top left corner will be aligned as close to the container's top left corner as possible. Copied from Closure's goog.style.getContainerOffsetToScrollInto
getPageOffset(el) Returns a Coordinate object relative to the top-left of the HTML document. Similar to Closure's goog.style.getPageOffset
getSize(element) Gets the height and width of an element. Similar to Closure's goog.style.getSize
getViewportPageOffset() Calculates the viewport coordinates relative to the document. Similar to Closure's goog.style.getViewportPageOffset
scrollIntoContainerView(element, container, opt_center) Changes the scroll position of container with the minimum amount so that the content and the borders of the given element become visible. If the element is bigger than the container, its top left corner will be aligned as close to the container's top left corner as possible. Copied from Closure's goog.style.scrollIntoContainerView

Variables

Variable Description
TEST_ONLY