Welcome, guest ( Login )

WikiHome » HtmlRefactor

HtmlRefactor

Version 17, changed by bryan 07/18/2006.   Show version history

Location Changes:

  • html.js: requires dojo.html.* and has a deprecated message
  • style.js: requires dojo.html.style for browsers and has a deprecated message
  • the old html/layout.js is now located in widget/html/layout.js as dojo.widget.html.layout
  • html/ (all functions have dojo.html namespace)
    • common.js:
      • all dojo.dom functions
        • when creating HTML widgets or contructs, use dojo.html to access dojo.dom functions
      • body (deprecated in favor of dojo.body)
      • getEventTarget
      • getViewport
      • getScroll
      • getParentByType
      • getAttribute
      • hasAttribute
      • getCursorPosition
      • isTag
      • overElement
    • color.js:
      • getBackgroundColor
    • display.js:
      • _toggle
      • show
      • hide
      • setShowing
      • isShowing
      • toggleShowing
      • suggestDisplayByTagName
      • setDisplay
      • isDisplayed
      • toggleDisplay
      • setVisibility
      • isVisible
      • toggleVisibility
      • setOpacity
      • clearOpacity
      • getOpacity
    • iframe.js:
      • iframeContentWindow
      • iframeContentDocument
      • BackgroundIframe
        • onResized
        • size
        • setZIndex
        • show
        • hide
        • remove
    • layout.js:
      • sumAncestorProperties
      • setStyleAttributes
      • getAbsolutePosition (aliased as abs)
      • isPositionAbsolute
      • _sumPixelValues
      • getMargin
      • getBorder
      • getBorderExtent
      • getMarginExtent
      • getPaddingExtent
      • getPadding
      • getPadBorder
      • getBoxSizing
      • isBorderBox
      • getBorderBox
      • getContentBox
      • setContentBox
      • getMarginBox
      • setMarginBox
      • toCoordinateObject
    • selection.js:
      • clearSelection
      • disableSelection
      • enableSelection
      • selectElement
      • selectInputText
      • isSelectionCollapsed
      • selection:
        • getType
        • getSelectedElement
        • getParentElement
        • selectNode
        • collapse
        • remove
    • shadow.js: (will move to the presentation layer)
      • shadow:
        • init
        • _makePiece
        • size
    • style.js:
      • getClass
      • getClasses
      • hasClass
      • prependClass
      • addClass
      • setClass
      • removeClass
      • replaceClass
      • getElementByClass
      • toCamelCase
      • toSelectorCase
      • getComputedStyle
      • getStyleProperty
      • getStyle
      • setStyle
      • copyStyle
      • getUnitValue
      • getPixelValue
      • setPositivePixelValue
      • insertCssRule
      • removeCssRule
      • insertCssFile
      • insertCssText
      • fixPathsInCssText
      • setActiveStyleSheet
      • getActiveStyleSheet
      • getPreferredStyleSheet
    • util.js:
      • getElementWindow
      • getDocumentWindow
      • gravity
      • overElement
      • renderedTextContext
      • createNodesFromText
      • placeOnScreen
      • placeOnScreenPoint (calls placeOnScreen and adds deprecation notice)
      • placeOnScreenAroundElement
      • scrollIntoView

API Changes:

OldNew
getViewportWidth() / getViewportHeight()getViewport().width / getViewport().height
getScrollX() / getScrollY() / getScrollOffset()getScroll().left / getScroll().top / getScroll().offset
getAbsolutePosition()[0] / getAbsolutePosition()[1]getAbsolutePosition().left / getAbsolutePosition().top
getMarginWidth() / getMarginHeight()getMargin().width / getMargin().height
getBorderWidth() / getBorderHeight()getBorder().width / getBorder().height
getPaddingWidth() / getPaddingHeight()getPadding().width / getPadding().height
getPadBorderWidth() / getPadBorderHeight()getPadBorder().width / getPadBorder().height
getBorderBoxWidth() or getInnerWidth() /
getBorderBoxHeight() or getInnerHeight()
getBorderBox().width /
getBorderBox().height
getContentBoxWidth() or getContentWidth() /
getContentBoxHeight() or getContentHeight() /
setContentBoxWidth(node, width) or setContentWidth(node, width) /
setContentBoxHeight(node, height) or setContentHeight(node, height)
getContentBox().width /
getContentBox().height /
setContentBox(node, {width: width, height: height})
getMarginBoxWidth() or getOuterWidth() /
getMarginBoxHeight() or getOuterHeight() /
setMarginBoxWidth(node, width) or setOuterWidth(node, width) /
setMarginBoxHeight(node, height) or setOuterHeight(node, height)
getMarginBox().width /
getMarginBox().height /
setMarginBox(node, {width: width, height: height})
toCoordinateArray(array) or toCoordinateArray(node)

returns an array [x,y,w,h]
toCoordinateObject({left: left, top: top, width: width, height: height}) or
toCoordinateObject(node)
returns an object {left: left, top: top, width: width, height: height}
placeOnScreen() returns array [x,y,dist]placeOnScreen() returns object {left: x, top: y, dist: dist}

Comments (1)

bill@dojotoolkit.org said, 06/09/2006

Note that there is already some code in the src/html directory that is separate from html.js:

  • layout.js
  • shadow.js

So this plan jibes well with that.

Attachments (0)

  File By Size Attached Ver.