Common DOM API

org.w3c.dom.css
Interface CSS2Properties


public interface CSS2Properties

The CSS2Properties interface represents a convenience mechanism for retrieving and setting properties within a CSSStyleDeclaration. The attributes of this interface correspond to all the properties specified in CSS2. Getting an attribute of this interface is equivalent to calling the getPropertyValue method of the CSSStyleDeclaration interface. Setting an attribute of this interface is equivalent to calling the setProperty method of the CSSStyleDeclaration interface.

A conformant implementation of the CSS module is not required to implement the CSS2Properties interface. If an implementation does implement this interface, the expectation is that language-specific methods can be used to cast from an instance of the CSSStyleDeclaration interface to the CSS2Properties interface.

If an implementation does implement this interface, it is expected to understand the specific syntax of the shorthand properties, and apply their semantics; when the margin property is set, for example, the marginTop, marginRight, marginBottom and marginLeft properties are actually being set by the underlying implementation.

When dealing with CSS "shorthand" properties, the shorthand properties should be decomposed into their component longhand properties as appropriate, and when querying for their value, the form returned should be the shortest form exactly equivalent to the declarations made in the ruleset. However, if there is no shorthand declaration that could be added to the ruleset without changing in any way the rules already declared in the ruleset (i.e., by adding longhand rules that were previously not declared in the ruleset), then the empty string should be returned for the shorthand property.

For example, querying for the font property should not return "normal normal normal 14pt/normal Arial, sans-serif", when "14pt Arial, sans-serif" suffices. (The normals are initial values, and are implied by use of the longhand property.)

If the values for all the longhand properties that compose a particular string are the initial values, then a string consisting of all the initial values should be returned (e.g. a border-width value of "medium" should be returned as such, not as "").

For some shorthand properties that take missing values from other sides, such as the margin, padding, and border-[width|style|color] properties, the minimum number of sides possible should be used; i.e., "0px 10px" will be returned instead of "0px 10px 0px 10px".

If the value of a shorthand property can not be decomposed into its component longhand properties, as is the case for the font property with a value of "menu", querying for the values of the component longhand properties should return the empty string.

See also the Document Object Model (DOM) Level 2 Style Specification.

Since:
DOM Level 2

Method Summary
 String getAzimuth()
          See the azimuth property definition in CSS2.
 String getBackground()
          See the background property definition in CSS2.
 String getBackgroundAttachment()
          See the background-attachment property definition in CSS2.
 String getBackgroundColor()
          See the background-color property definition in CSS2.
 String getBackgroundImage()
          See the background-image property definition in CSS2.
 String getBackgroundPosition()
          See the background-position property definition in CSS2.
 String getBackgroundRepeat()
          See the background-repeat property definition in CSS2.
 String getBorder()
          See the border property definition in CSS2.
 String getBorderBottom()
          See the border-bottom property definition in CSS2.
 String getBorderBottomColor()
          See the border-bottom-color property definition in CSS2.
 String getBorderBottomStyle()
          See the border-bottom-style property definition in CSS2.
 String getBorderBottomWidth()
          See the border-bottom-width property definition in CSS2.
 String getBorderCollapse()
          See the border-collapse property definition in CSS2.
 String getBorderColor()
          See the border-color property definition in CSS2.
 String getBorderLeft()
          See the border-left property definition in CSS2.
 String getBorderLeftColor()
          See the border-left-color property definition in CSS2.
 String getBorderLeftStyle()
          See the border-left-style property definition in CSS2.
 String getBorderLeftWidth()
          See the border-left-width property definition in CSS2.
 String getBorderRight()
          See the border-right property definition in CSS2.
 String getBorderRightColor()
          See the border-right-color property definition in CSS2.
 String getBorderRightStyle()
          See the border-right-style property definition in CSS2.
 String getBorderRightWidth()
          See the border-right-width property definition in CSS2.
 String getBorderSpacing()
          See the border-spacing property definition in CSS2.
 String getBorderStyle()
          See the border-style property definition in CSS2.
 String getBorderTop()
          See the border-top property definition in CSS2.
 String getBorderTopColor()
          See the border-top-color property definition in CSS2.
 String getBorderTopStyle()
          See the border-top-style property definition in CSS2.
 String getBorderTopWidth()
          See the border-top-width property definition in CSS2.
 String getBorderWidth()
          See the border-width property definition in CSS2.
 String getBottom()
          See the bottom property definition in CSS2.
 String getCaptionSide()
          See the caption-side property definition in CSS2.
 String getClear()
          See the clear property definition in CSS2.
 String getClip()
          See the clip property definition in CSS2.
 String getColor()
          See the color property definition in CSS2.
 String getContent()
          See the content property definition in CSS2.
 String getCounterIncrement()
          See the counter-increment property definition in CSS2.
 String getCounterReset()
          See the counter-reset property definition in CSS2.
 String getCssFloat()
          See the float property definition in CSS2.
 String getCue()
          See the cue property definition in CSS2.
 String getCueAfter()
          See the cue-after property definition in CSS2.
 String getCueBefore()
          See the cue-before property definition in CSS2.
 String getCursor()
          See the cursor property definition in CSS2.
 String getDirection()
          See the direction property definition in CSS2.
 String getDisplay()
          See the display property definition in CSS2.
 String getElevation()
          See the elevation property definition in CSS2.
 String getEmptyCells()
          See the empty-cells property definition in CSS2.
 String getFont()
          See the font property definition in CSS2.
 String getFontFamily()
          See the font-family property definition in CSS2.
 String getFontSize()
          See the font-size property definition in CSS2.
 String getFontSizeAdjust()
          See the font-size-adjust property definition in CSS2.
 String getFontStretch()
          See the font-stretch property definition in CSS2.
 String getFontStyle()
          See the font-style property definition in CSS2.
 String getFontVariant()
          See the font-variant property definition in CSS2.
 String getFontWeight()
          See the font-weight property definition in CSS2.
 String getHeight()
          See the height property definition in CSS2.
 String getLeft()
          See the left property definition in CSS2.
 String getLetterSpacing()
          See the letter-spacing property definition in CSS2.
 String getLineHeight()
          See the line-height property definition in CSS2.
 String getListStyle()
          See the list-style property definition in CSS2.
 String getListStyleImage()
          See the list-style-image property definition in CSS2.
 String getListStylePosition()
          See the list-style-position property definition in CSS2.
 String getListStyleType()
          See the list-style-type property definition in CSS2.
 String getMargin()
          See the margin property definition in CSS2.
 String getMarginBottom()
          See the margin-bottom property definition in CSS2.
 String getMarginLeft()
          See the margin-left property definition in CSS2.
 String getMarginRight()
          See the margin-right property definition in CSS2.
 String getMarginTop()
          See the margin-top property definition in CSS2.
 String getMarkerOffset()
          See the marker-offset property definition in CSS2.
 String getMarks()
          See the marks property definition in CSS2.
 String getMaxHeight()
          See the max-height property definition in CSS2.
 String getMaxWidth()
          See the max-width property definition in CSS2.
 String getMinHeight()
          See the min-height property definition in CSS2.
 String getMinWidth()
          See the min-width property definition in CSS2.
 String getOrphans()
          See the orphans property definition in CSS2.
 String getOutline()
          See the outline property definition in CSS2.
 String getOutlineColor()
          See the outline-color property definition in CSS2.
 String getOutlineStyle()
          See the outline-style property definition in CSS2.
 String getOutlineWidth()
          See the outline-width property definition in CSS2.
 String getOverflow()
          See the overflow property definition in CSS2.
 String getPadding()
          See the padding property definition in CSS2.
 String getPaddingBottom()
          See the padding-bottom property definition in CSS2.
 String getPaddingLeft()
          See the padding-left property definition in CSS2.
 String getPaddingRight()
          See the padding-right property definition in CSS2.
 String getPaddingTop()
          See the padding-top property definition in CSS2.
 String getPage()
          See the page property definition in CSS2.
 String getPageBreakAfter()
          See the page-break-after property definition in CSS2.
 String getPageBreakBefore()
          See the page-break-before property definition in CSS2.
 String getPageBreakInside()
          See the page-break-inside property definition in CSS2.
 String getPause()
          See the pause property definition in CSS2.
 String getPauseAfter()
          See the pause-after property definition in CSS2.
 String getPauseBefore()
          See the pause-before property definition in CSS2.
 String getPitch()
          See the pitch property definition in CSS2.
 String getPitchRange()
          See the pitch-range property definition in CSS2.
 String getPlayDuring()
          See the play-during property definition in CSS2.
 String getPosition()
          See the position property definition in CSS2.
 String getQuotes()
          See the quotes property definition in CSS2.
 String getRichness()
          See the richness property definition in CSS2.
 String getRight()
          See the right property definition in CSS2.
 String getSize()
          See the size property definition in CSS2.
 String getSpeak()
          See the speak property definition in CSS2.
 String getSpeakHeader()
          See the speak-header property definition in CSS2.
 String getSpeakNumeral()
          See the speak-numeral property definition in CSS2.
 String getSpeakPunctuation()
          See the speak-punctuation property definition in CSS2.
 String getSpeechRate()
          See the speech-rate property definition in CSS2.
 String getStress()
          See the stress property definition in CSS2.
 String getTableLayout()
          See the table-layout property definition in CSS2.
 String getTextAlign()
          See the text-align property definition in CSS2.
 String getTextDecoration()
          See the text-decoration property definition in CSS2.
 String getTextIndent()
          See the text-indent property definition in CSS2.
 String getTextShadow()
          See the text-shadow property definition in CSS2.
 String getTextTransform()
          See the text-transform property definition in CSS2.
 String getTop()
          See the top property definition in CSS2.
 String getUnicodeBidi()
          See the unicode-bidi property definition in CSS2.
 String getVerticalAlign()
          See the vertical-align property definition in CSS2.
 String getVisibility()
          See the visibility property definition in CSS2.
 String getVoiceFamily()
          See the voice-family property definition in CSS2.
 String getVolume()
          See the volume property definition in CSS2.
 String getWhiteSpace()
          See the white-space property definition in CSS2.
 String getWidows()
          See the widows property definition in CSS2.
 String getWidth()
          See the width property definition in CSS2.
 String getWordSpacing()
          See the word-spacing property definition in CSS2.
 String getZIndex()
          See the z-index property definition in CSS2.
 void setAzimuth(String azimuth)
           
 void setBackground(String background)
           
 void setBackgroundAttachment(String backgroundAttachment)
           
 void setBackgroundColor(String backgroundColor)
           
 void setBackgroundImage(String backgroundImage)
           
 void setBackgroundPosition(String backgroundPosition)
           
 void setBackgroundRepeat(String backgroundRepeat)
           
 void setBorder(String border)
           
 void setBorderBottom(String borderBottom)
           
 void setBorderBottomColor(String borderBottomColor)
           
 void setBorderBottomStyle(String borderBottomStyle)
           
 void setBorderBottomWidth(String borderBottomWidth)
           
 void setBorderCollapse(String borderCollapse)
           
 void setBorderColor(String borderColor)
           
 void setBorderLeft(String borderLeft)
           
 void setBorderLeftColor(String borderLeftColor)
           
 void setBorderLeftStyle(String borderLeftStyle)
           
 void setBorderLeftWidth(String borderLeftWidth)
           
 void setBorderRight(String borderRight)
           
 void setBorderRightColor(String borderRightColor)
           
 void setBorderRightStyle(String borderRightStyle)
           
 void setBorderRightWidth(String borderRightWidth)
           
 void setBorderSpacing(String borderSpacing)
           
 void setBorderStyle(String borderStyle)
           
 void setBorderTop(String borderTop)
           
 void setBorderTopColor(String borderTopColor)
           
 void setBorderTopStyle(String borderTopStyle)
           
 void setBorderTopWidth(String borderTopWidth)
           
 void setBorderWidth(String borderWidth)
           
 void setBottom(String bottom)
           
 void setCaptionSide(String captionSide)
           
 void setClear(String clear)
           
 void setClip(String clip)
           
 void setColor(String color)
           
 void setContent(String content)
           
 void setCounterIncrement(String counterIncrement)
           
 void setCounterReset(String counterReset)
           
 void setCssFloat(String cssFloat)
           
 void setCue(String cue)
           
 void setCueAfter(String cueAfter)
           
 void setCueBefore(String cueBefore)
           
 void setCursor(String cursor)
           
 void setDirection(String direction)
           
 void setDisplay(String display)
           
 void setElevation(String elevation)
           
 void setEmptyCells(String emptyCells)
           
 void setFont(String font)
           
 void setFontFamily(String fontFamily)
           
 void setFontSize(String fontSize)
           
 void setFontSizeAdjust(String fontSizeAdjust)
           
 void setFontStretch(String fontStretch)
           
 void setFontStyle(String fontStyle)
           
 void setFontVariant(String fontVariant)
           
 void setFontWeight(String fontWeight)
           
 void setHeight(String height)
           
 void setLeft(String left)
           
 void setLetterSpacing(String letterSpacing)
           
 void setLineHeight(String lineHeight)
           
 void setListStyle(String listStyle)
           
 void setListStyleImage(String listStyleImage)
           
 void setListStylePosition(String listStylePosition)
           
 void setListStyleType(String listStyleType)
           
 void setMargin(String margin)
           
 void setMarginBottom(String marginBottom)
           
 void setMarginLeft(String marginLeft)
           
 void setMarginRight(String marginRight)
           
 void setMarginTop(String marginTop)
           
 void setMarkerOffset(String markerOffset)
           
 void setMarks(String marks)
           
 void setMaxHeight(String maxHeight)
           
 void setMaxWidth(String maxWidth)
           
 void setMinHeight(String minHeight)
           
 void setMinWidth(String minWidth)
           
 void setOrphans(String orphans)
           
 void setOutline(String outline)
           
 void setOutlineColor(String outlineColor)
           
 void setOutlineStyle(String outlineStyle)
           
 void setOutlineWidth(String outlineWidth)
           
 void setOverflow(String overflow)
           
 void setPadding(String padding)
           
 void setPaddingBottom(String paddingBottom)
           
 void setPaddingLeft(String paddingLeft)
           
 void setPaddingRight(String paddingRight)
           
 void setPaddingTop(String paddingTop)
           
 void setPage(String page)
           
 void setPageBreakAfter(String pageBreakAfter)
           
 void setPageBreakBefore(String pageBreakBefore)
           
 void setPageBreakInside(String pageBreakInside)
           
 void setPause(String pause)
           
 void setPauseAfter(String pauseAfter)
           
 void setPauseBefore(String pauseBefore)
           
 void setPitch(String pitch)
           
 void setPitchRange(String pitchRange)
           
 void setPlayDuring(String playDuring)
           
 void setPosition(String position)
           
 void setQuotes(String quotes)
           
 void setRichness(String richness)
           
 void setRight(String right)
           
 void setSize(String size)
           
 void setSpeak(String speak)
           
 void setSpeakHeader(String speakHeader)
           
 void setSpeakNumeral(String speakNumeral)
           
 void setSpeakPunctuation(String speakPunctuation)
           
 void setSpeechRate(String speechRate)
           
 void setStress(String stress)
           
 void setTableLayout(String tableLayout)
           
 void setTextAlign(String textAlign)
           
 void setTextDecoration(String textDecoration)
           
 void