public interface CSSUnit
CSS numeric units.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final shortFont-relative length (cap).static final shortFont-relative length (ch).static final shortLength (cm).static final shortAngle (deg).static final shortResolution (dpcm).static final shortResolution (dpi).static final shortResolution (dppx).static final shortFont-relative length (em).static final shortFont-relative length (ex).static final shortFlexible length (fr).static final shortAngle (grad).static final shortFrequency (Hz).static final shortFont-relative length (ic).static final shortLength (in).static final shortInvalid CSS unit.static final shortFrequency (kHz).static final shortFont-relative length (lh).static final shortLength (mm).static final shortTime (ms).static final shortDimensionless number.static final shortNumber with an unknown dimension.static final shortLength (pc).static final shortPercentage.static final shortLength (pt).static final shortLength (px).static final shortLength (Q).static final shortAngle (rad).static final shortFont-relative length (rch).static final shortFont-relative length (rem).static final shortFont-relative length (rex).static final shortFont-relative length (ric).static final shortFont-relative length (rlh).static final shortTime (s).static final shortAngle (turn).static final shortViewport-percentage length (vb).static final shortViewport-percentage length (vh).static final shortViewport-percentage length (vi).static final shortViewport-percentage length (vmax).static final shortViewport-percentage length (vmin).static final shortViewport-percentage length (vw).
- 
Method SummaryStatic MethodsModifier and TypeMethodDescriptionstatic StringdimensionUnitString(short unitType) Gives the dimension unit string associated to the given CSS unit type.static booleanisAngleUnitType(short unitType) Check whether the given unit is an angle.static booleanisLengthUnitType(short unitType) Check whether the given unit is a length.static booleanisRelativeLengthUnitType(short unitType) Check whether the given unit is a relative length.static booleanisResolutionUnitType(short unitType) Check whether the given unit is a resolution unit.static booleanisTimeUnitType(short unitType) Check whether the given unit is a time.
- 
Field Details- 
CSS_NUMBERstatic final short CSS_NUMBERDimensionless number.- See Also:
 
- 
CSS_OTHERstatic final short CSS_OTHERNumber with an unknown dimension.- See Also:
 
- 
CSS_PERCENTAGEstatic final short CSS_PERCENTAGEPercentage.- See Also:
 
- 
CSS_PXstatic final short CSS_PXLength (px).- See Also:
 
- 
CSS_INstatic final short CSS_INLength (in).- See Also:
 
- 
CSS_PCstatic final short CSS_PCLength (pc).- See Also:
 
- 
CSS_PTstatic final short CSS_PTLength (pt).- See Also:
 
- 
CSS_CMstatic final short CSS_CMLength (cm).- See Also:
 
- 
CSS_MMstatic final short CSS_MMLength (mm).- See Also:
 
- 
CSS_QUARTER_MMstatic final short CSS_QUARTER_MMLength (Q).- See Also:
 
- 
CSS_EMstatic final short CSS_EMFont-relative length (em).- See Also:
 
- 
CSS_EXstatic final short CSS_EXFont-relative length (ex).- See Also:
 
- 
CSS_CAPstatic final short CSS_CAPFont-relative length (cap).- See Also:
 
- 
CSS_CHstatic final short CSS_CHFont-relative length (ch).- See Also:
 
- 
CSS_ICstatic final short CSS_ICFont-relative length (ic).- See Also:
 
- 
CSS_LHstatic final short CSS_LHFont-relative length (lh).- See Also:
 
- 
CSS_REMstatic final short CSS_REMFont-relative length (rem).- See Also:
 
- 
CSS_RLHstatic final short CSS_RLHFont-relative length (rlh).- See Also:
 
- 
CSS_REXstatic final short CSS_REXFont-relative length (rex).- See Also:
 
- 
CSS_RCHstatic final short CSS_RCHFont-relative length (rch).- See Also:
 
- 
CSS_RICstatic final short CSS_RICFont-relative length (ric).- See Also:
 
- 
CSS_VBstatic final short CSS_VBViewport-percentage length (vb).- See Also:
 
- 
CSS_VHstatic final short CSS_VHViewport-percentage length (vh).- See Also:
 
- 
CSS_VIstatic final short CSS_VIViewport-percentage length (vi).- See Also:
 
- 
CSS_VMAXstatic final short CSS_VMAXViewport-percentage length (vmax).- See Also:
 
- 
CSS_VMINstatic final short CSS_VMINViewport-percentage length (vmin).- See Also:
 
- 
CSS_VWstatic final short CSS_VWViewport-percentage length (vw).- See Also:
 
- 
CSS_DPIstatic final short CSS_DPIResolution (dpi).- See Also:
 
- 
CSS_DPCMstatic final short CSS_DPCMResolution (dpcm).- See Also:
 
- 
CSS_DPPXstatic final short CSS_DPPXResolution (dppx).- See Also:
 
- 
CSS_FRstatic final short CSS_FRFlexible length (fr). Note that it is not a length.- See Also:
 
- 
CSS_DEGstatic final short CSS_DEGAngle (deg).- See Also:
 
- 
CSS_RADstatic final short CSS_RADAngle (rad).- See Also:
 
- 
CSS_GRADstatic final short CSS_GRADAngle (grad).- See Also:
 
- 
CSS_TURNstatic final short CSS_TURNAngle (turn).- See Also:
 
- 
CSS_Sstatic final short CSS_STime (s).- See Also:
 
- 
CSS_MSstatic final short CSS_MSTime (ms).- See Also:
 
- 
CSS_HZstatic final short CSS_HZFrequency (Hz).- See Also:
 
- 
CSS_KHZstatic final short CSS_KHZFrequency (kHz).- See Also:
 
- 
CSS_INVALIDstatic final short CSS_INVALIDInvalid CSS unit.- See Also:
 
 
- 
- 
Method Details- 
isLengthUnitTypestatic boolean isLengthUnitType(short unitType) Check whether the given unit is a length.Percentage is not considered an explicit length. - Parameters:
- unitType- the unit type.
- Returns:
- true if the unit is a length.
 
- 
isRelativeLengthUnitTypestatic boolean isRelativeLengthUnitType(short unitType) Check whether the given unit is a relative length.- Parameters:
- unitType- the unit type.
- Returns:
- true if the unit is a relative length.
 
- 
isAngleUnitTypestatic boolean isAngleUnitType(short unitType) Check whether the given unit is an angle.- Parameters:
- unitType- the unit type.
- Returns:
- true if the unit is an angle.
 
- 
isTimeUnitTypestatic boolean isTimeUnitType(short unitType) Check whether the given unit is a time.- Parameters:
- unitType- the unit type.
- Returns:
- true if the unit is a time.
 
- 
isResolutionUnitTypestatic boolean isResolutionUnitType(short unitType) Check whether the given unit is a resolution unit.- Parameters:
- unitType- the unit type.
- Returns:
- true if the unit is a resolution unit.
 
- 
dimensionUnitStringGives the dimension unit string associated to the given CSS unit type.- Parameters:
- unitType- the CSS primitive unit type.
- Returns:
- the unit string.
- Throws:
- DOMException- INVALID_ACCESS_ERR if the unit is not a- CSSUnitone.
 
 
-