AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.5.1" />

 CSSStyleDeclaration

Represents a single CSS declaration block.
using AngleSharp.DOM.Css; using AngleSharp.Parser.Css; using System; using System.Collections; using System.Collections.Generic; using System.Text; namespace AngleSharp.DOM.Collections { [DOM("CSSStyleDeclaration")] public sealed class CSSStyleDeclaration : IEnumerable<CSSProperty>, IEnumerable { private Dictionary<string, CSSProperty> _rules; private CSSRule _parent; private Func<string> _getter; private Action<string> _setter; private bool _blocking; [DOM("cssText")] public string CssText { get { return _getter(); } set { Update(value); _setter(value); } } [DOM("length")] public int Length { get { return _rules.Count; } } [DOM("parentRule")] public CSSRule ParentRule { get { return _parent; } internal set { _parent = value; } } [DOM("item")] public string this[int index] { get { return Get(index).Name; } } [DOM("alignContent")] public string AlignContent { get { return GetPropertyValue(PropertyNames.AlignContent) ?? string.Empty; } set { SetProperty(PropertyNames.AlignContent, value); } } [DOM("alignItems")] public string AlignItems { get { return GetPropertyValue(PropertyNames.AlignItems) ?? string.Empty; } set { SetProperty(PropertyNames.AlignItems, value); } } [DOM("alignSelf")] public string AlignSelf { get { return GetPropertyValue(PropertyNames.AlignSelf) ?? string.Empty; } set { SetProperty(PropertyNames.AlignSelf, value); } } [DOM("accelerator")] public string Accelerator { get { return GetPropertyValue(PropertyNames.Accelerator) ?? string.Empty; } set { SetProperty(PropertyNames.Accelerator, value); } } [DOM("alignmentBaseline")] public string AlignmentBaseline { get { return GetPropertyValue(PropertyNames.AlignBaseline) ?? string.Empty; } set { SetProperty(PropertyNames.AlignBaseline, value); } } [DOM("animation")] public string Animation { get { return GetPropertyValue(PropertyNames.Animation) ?? string.Empty; } set { SetProperty(PropertyNames.Animation, value); } } [DOM("animationDelay")] public string AnimationDelay { get { return GetPropertyValue(PropertyNames.AnimationDelay) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationDelay, value); } } [DOM("animationDirection")] public string AnimationDirection { get { return GetPropertyValue(PropertyNames.AnimationDirection) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationDirection, value); } } [DOM("animationDuration")] public string AnimationDuration { get { return GetPropertyValue(PropertyNames.AnimationDuration) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationDuration, value); } } [DOM("animationFillMode")] public string AnimationFillMode { get { return GetPropertyValue(PropertyNames.AnimationFillMode) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationFillMode, value); } } [DOM("animationIterationCount")] public string AnimationIterationCount { get { return GetPropertyValue(PropertyNames.AnimationIterationCount) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationIterationCount, value); } } [DOM("animationName")] public string AnimationName { get { return GetPropertyValue(PropertyNames.AnimationName) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationName, value); } } [DOM("animationPlayState")] public string AnimationPlayState { get { return GetPropertyValue(PropertyNames.AnimationPlayState) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationPlayState, value); } } [DOM("animationTimingFunction")] public string AnimationTimingFunction { get { return GetPropertyValue(PropertyNames.AnimationTimingFunction) ?? string.Empty; } set { SetProperty(PropertyNames.AnimationTimingFunction, value); } } [DOM("backfaceVisibility")] public string BackfaceVisibility { get { return GetPropertyValue(PropertyNames.BackfaceVisibility) ?? string.Empty; } set { SetProperty(PropertyNames.BackfaceVisibility, value); } } [DOM("background")] public string Background { get { return GetPropertyValue(PropertyNames.Background) ?? string.Empty; } set { SetProperty(PropertyNames.Background, value); } } [DOM("backgroundAttachment")] public string BackgroundAttachment { get { return GetPropertyValue(PropertyNames.BackgroundAttachment) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundAttachment, value); } } [DOM("backgroundClip")] public string BackgroundClip { get { return GetPropertyValue(PropertyNames.BackgroundClip) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundClip, value); } } [DOM("backgroundColor")] public string BackgroundColor { get { return GetPropertyValue(PropertyNames.BackgroundColor) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundColor, value); } } [DOM("backgroundImage")] public string BackgroundImage { get { return GetPropertyValue(PropertyNames.BackgroundImage) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundImage, value); } } [DOM("backgroundOrigin")] public string BackgroundOrigin { get { return GetPropertyValue(PropertyNames.BackgroundOrigin) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundOrigin, value); } } [DOM("backgroundPosition")] public string BackgroundPosition { get { return GetPropertyValue(PropertyNames.BackgroundPosition) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundPosition, value); } } [DOM("backgroundPositionX")] public string BackgroundPositionX { get { return GetPropertyValue(PropertyNames.BackgroundPositionX) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundPositionX, value); } } [DOM("backgroundPositionY")] public string BackgroundPositionY { get { return GetPropertyValue(PropertyNames.BackgroundPositionY) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundPositionY, value); } } [DOM("backgroundRepeat")] public string BackgroundRepeat { get { return GetPropertyValue(PropertyNames.BackgroundRepeat) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundRepeat, value); } } [DOM("backgroundSize")] public string BackgroundSize { get { return GetPropertyValue(PropertyNames.BackgroundSize) ?? string.Empty; } set { SetProperty(PropertyNames.BackgroundSize, value); } } [DOM("baselineShift")] public string BaselineShift { get { return GetPropertyValue(PropertyNames.BaselineShift) ?? string.Empty; } set { SetProperty(PropertyNames.BaselineShift, value); } } [DOM("behavior")] public string Behavior { get { return GetPropertyValue(PropertyNames.Behavior) ?? string.Empty; } set { SetProperty(PropertyNames.Behavior, value); } } [DOM("border")] public string Border { get { return GetPropertyValue(PropertyNames.Border) ?? string.Empty; } set { SetProperty(PropertyNames.Border, value); } } [DOM("borderBottom")] public string BorderBottom { get { return GetPropertyValue(PropertyNames.BorderBottom) ?? string.Empty; } set { SetProperty(PropertyNames.BorderBottom, value); } } [DOM("borderBottomColor")] public string BorderBottomColor { get { return GetPropertyValue(PropertyNames.BorderBottomColor) ?? string.Empty; } set { SetProperty(PropertyNames.BorderBottomColor, value); } } [DOM("borderBottomLeftRadius")] public string BorderBottomLeftRadius { get { return GetPropertyValue(PropertyNames.BorderBottomLeftRadius) ?? string.Empty; } set { SetProperty(PropertyNames.BorderBottomLeftRadius, value); } } [DOM("borderBottomRightRadius")] public string BorderBottomRightRadius { get { return GetPropertyValue(PropertyNames.BorderBottomRightRadius) ?? string.Empty; } set { SetProperty(PropertyNames.BorderBottomRightRadius, value); } } [DOM("borderBottomStyle")] public string BorderBottomStyle { get { return GetPropertyValue(PropertyNames.BorderBottomStyle) ?? string.Empty; } set { SetProperty(PropertyNames.BorderBottomStyle, value); } } [DOM("borderBottomWidth")] public string BorderBottomWidth { get { return GetPropertyValue(PropertyNames.BorderBottomWidth) ?? string.Empty; } set { SetProperty(PropertyNames.BorderBottomWidth, value); } } [DOM("borderCollapse")] public string BorderCollapse { get { return GetPropertyValue(PropertyNames.BorderCollapse) ?? string.Empty; } set { SetProperty(PropertyNames.BorderCollapse, value); } } [DOM("borderColor")] public string BorderColor { get { return GetPropertyValue(PropertyNames.BorderColor) ?? string.Empty; } set { SetProperty(PropertyNames.BorderColor, value); } } [DOM("borderImage")] public string BorderImage { get { return GetPropertyValue(PropertyNames.BorderImage) ?? string.Empty; } set { SetProperty(PropertyNames.BorderImage, value); } } [DOM("borderImageOutset")] public string BorderImageOutset { get { return GetPropertyValue(PropertyNames.BorderImageOutset) ?? string.Empty; } set { SetProperty(PropertyNames.BorderImageOutset, value); } } [DOM("borderImageRepeat")] public string BorderImageRepeat { get { return GetPropertyValue(PropertyNames.BorderImageRepeat) ?? string.Empty; } set { SetProperty(PropertyNames.BorderImageRepeat, value); } } [DOM("borderImageSlice")] public string BorderImageSlice { get { return GetPropertyValue(PropertyNames.BorderImageSlice) ?? string.Empty; } set { SetProperty(PropertyNames.BorderImageSlice, value); } } [DOM("borderImageSource")] public string BorderImageSource { get { return GetPropertyValue(PropertyNames.BorderImageSource) ?? string.Empty; } set { SetProperty(PropertyNames.BorderImageSource, value); } } [DOM("borderImageWidth")] public string BorderImageWidth { get { return GetPropertyValue(PropertyNames.BorderImageWidth) ?? string.Empty; } set { SetProperty(PropertyNames.BorderImageWidth, value); } } [DOM("borderLeft")] public string BorderLeft { get { return GetPropertyValue(PropertyNames.BorderLeft) ?? string.Empty; } set { SetProperty(PropertyNames.BorderLeft, value); } } [DOM("borderLeftColor")] public string BorderLeftColor { get { return GetPropertyValue(PropertyNames.BorderLeftColor) ?? string.Empty; } set { SetProperty(PropertyNames.BorderLeftColor, value); } } [DOM("borderLeftStyle")] public string BorderLeftStyle { get { return GetPropertyValue(PropertyNames.BorderLeftStyle) ?? string.Empty; } set { SetProperty(PropertyNames.BorderLeftStyle, value); } } [DOM("borderLeftWidth")] public string BorderLeftWidth { get { return GetPropertyValue(PropertyNames.BorderLeftWidth) ?? string.Empty; } set { SetProperty(PropertyNames.BorderLeftWidth, value); } } [DOM("borderRadius")] public string BorderRadius { get { return GetPropertyValue(PropertyNames.BorderRadius) ?? string.Empty; } set { SetProperty(PropertyNames.BorderRadius, value); } } [DOM("borderRight")] public string BorderRight { get { return GetPropertyValue(PropertyNames.BorderRight) ?? string.Empty; } set { SetProperty(PropertyNames.BorderRight, value); } } [DOM("borderRightColor")] public string BorderRightColor { get { return GetPropertyValue(PropertyNames.BorderRightColor) ?? string.Empty; } set { SetProperty(PropertyNames.BorderRightColor, value); } } [DOM("borderRightStyle")] public string BorderRightStyle { get { return GetPropertyValue(PropertyNames.BorderRightStyle) ?? string.Empty; } set { SetProperty(PropertyNames.BorderRightStyle, value); } } [DOM("borderRightWidth")] public string BorderRightWidth { get { return GetPropertyValue(PropertyNames.BorderRightWidth) ?? string.Empty; } set { SetProperty(PropertyNames.BorderRightWidth, value); } } [DOM("borderSpacing")] public string BorderSpacing { get { return GetPropertyValue(PropertyNames.BorderSpacing) ?? string.Empty; } set { SetProperty(PropertyNames.BorderSpacing, value); } } [DOM("borderStyle")] public string BorderStyle { get { return GetPropertyValue(PropertyNames.BorderStyle) ?? string.Empty; } set { SetProperty(PropertyNames.BorderStyle, value); } } [DOM("borderTop")] public string BorderTop { get { return GetPropertyValue(PropertyNames.BorderTop) ?? string.Empty; } set { SetProperty(PropertyNames.BorderTop, value); } } [DOM("borderTopColor")] public string BorderTopColor { get { return GetPropertyValue(PropertyNames.BorderTopColor) ?? string.Empty; } set { SetProperty(PropertyNames.BorderTopColor, value); } } [DOM("borderTopLeftRadius")] public string BorderTopLeftRadius { get { return GetPropertyValue(PropertyNames.BorderTopLeftRadius) ?? string.Empty; } set { SetProperty(PropertyNames.BorderTopLeftRadius, value); } } [DOM("borderTopRightRadius")] public string BorderTopRightRadius { get { return GetPropertyValue(PropertyNames.BorderTopRightRadius) ?? string.Empty; } set { SetProperty(PropertyNames.BorderTopRightRadius, value); } } [DOM("borderTopStyle")] public string BorderTopStyle { get { return GetPropertyValue(PropertyNames.BorderTopStyle) ?? string.Empty; } set { SetProperty(PropertyNames.BorderTopStyle, value); } } [DOM("borderTopWidth")] public string BorderTopWidth { get { return GetPropertyValue(PropertyNames.BorderTopWidth) ?? string.Empty; } set { SetProperty(PropertyNames.BorderTopWidth, value); } } [DOM("borderWidth")] public string BorderWidth { get { return GetPropertyValue(PropertyNames.BorderWidth) ?? string.Empty; } set { SetProperty(PropertyNames.BorderWidth, value); } } [DOM("boxShadow")] public string BoxShadow { get { return GetPropertyValue(PropertyNames.BoxShadow) ?? string.Empty; } set { SetProperty(PropertyNames.BoxShadow, value); } } [DOM("boxSizing")] public string BoxSizing { get { return GetPropertyValue(PropertyNames.BoxSizing) ?? string.Empty; } set { SetProperty(PropertyNames.BoxSizing, value); } } [DOM("breakAfter")] public string BreakAfter { get { return GetPropertyValue(PropertyNames.BreakAfter) ?? string.Empty; } set { SetProperty(PropertyNames.BreakAfter, value); } } [DOM("breakBefore")] public string BreakBefore { get { return GetPropertyValue(PropertyNames.BreakBefore) ?? string.Empty; } set { SetProperty(PropertyNames.BreakBefore, value); } } [DOM("breakInside")] public string BreakInside { get { return GetPropertyValue(PropertyNames.BreakInside) ?? string.Empty; } set { SetProperty(PropertyNames.BreakInside, value); } } [DOM("captionSide")] public string CaptionSide { get { return GetPropertyValue(PropertyNames.CaptionSide) ?? string.Empty; } set { SetProperty(PropertyNames.CaptionSide, value); } } [DOM("clear")] public string Clear { get { return GetPropertyValue(PropertyNames.Clear) ?? string.Empty; } set { SetProperty(PropertyNames.Clear, value); } } [DOM("clip")] public string Clip { get { return GetPropertyValue(PropertyNames.Clip) ?? string.Empty; } set { SetProperty(PropertyNames.Clip, value); } } [DOM("clipBottom")] public string ClipBottom { get { return GetPropertyValue(PropertyNames.ClipBottom) ?? string.Empty; } set { SetProperty(PropertyNames.ClipBottom, value); } } [DOM("clipLeft")] public string ClipLeft { get { return GetPropertyValue(PropertyNames.ClipLeft) ?? string.Empty; } set { SetProperty(PropertyNames.ClipLeft, value); } } [DOM("clipPath")] public string ClipPath { get { return GetPropertyValue(PropertyNames.ClipPath) ?? string.Empty; } set { SetProperty(PropertyNames.ClipPath, value); } } [DOM("clipRight")] public string ClipRight { get { return GetPropertyValue(PropertyNames.ClipRight) ?? string.Empty; } set { SetProperty(PropertyNames.ClipRight, value); } } [DOM("clipRule")] public string ClipRule { get { return GetPropertyValue(PropertyNames.ClipRule) ?? string.Empty; } set { SetProperty(PropertyNames.ClipRule, value); } } [DOM("clipTop")] public string ClipTop { get { return GetPropertyValue(PropertyNames.ClipTop) ?? string.Empty; } set { SetProperty(PropertyNames.ClipTop, value); } } [DOM("color")] public string Color { get { return GetPropertyValue(PropertyNames.Color) ?? string.Empty; } set { SetProperty(PropertyNames.Color, value); } } [DOM("colorInterpolationFilters")] public string ColorInterpolationFilters { get { return GetPropertyValue(PropertyNames.ColorInterpolationFilters) ?? string.Empty; } set { SetProperty(PropertyNames.ColorInterpolationFilters, value); } } [DOM("columnCount")] public string ColumnCount { get { return GetPropertyValue(PropertyNames.ColumnCount) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnCount, value); } } [DOM("columnFill")] public string ColumnFill { get { return GetPropertyValue(PropertyNames.ColumnFill) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnFill, value); } } [DOM("columnGap")] public string ColumnGap { get { return GetPropertyValue(PropertyNames.ColumnGap) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnGap, value); } } [DOM("columnRule")] public string ColumnRule { get { return GetPropertyValue(PropertyNames.ColumnRule) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnRule, value); } } [DOM("columnRuleColor")] public string ColumnRuleColor { get { return GetPropertyValue(PropertyNames.ColumnRuleColor) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnRuleColor, value); } } [DOM("columnRuleStyle")] public string ColumnRuleStyle { get { return GetPropertyValue(PropertyNames.ColumnRuleStyle) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnRuleStyle, value); } } [DOM("columnRuleWidth")] public string ColumnRuleWidth { get { return GetPropertyValue(PropertyNames.ColumnRuleWidth) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnRuleWidth, value); } } [DOM("columns")] public string Columns { get { return GetPropertyValue(PropertyNames.Columns) ?? string.Empty; } set { SetProperty(PropertyNames.Columns, value); } } [DOM("columnSpan")] public string ColumnSpan { get { return GetPropertyValue(PropertyNames.ColumnSpan) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnSpan, value); } } [DOM("columnWidth")] public string ColumnWidth { get { return GetPropertyValue(PropertyNames.ColumnWidth) ?? string.Empty; } set { SetProperty(PropertyNames.ColumnWidth, value); } } [DOM("content")] public string Content { get { return GetPropertyValue(PropertyNames.Content) ?? string.Empty; } set { SetProperty(PropertyNames.Content, value); } } [DOM("counterIncrement")] public string CounterIncrement { get { return GetPropertyValue(PropertyNames.CounterIncrement) ?? string.Empty; } set { SetProperty(PropertyNames.CounterIncrement, value); } } [DOM("counterReset")] public string CounterReset { get { return GetPropertyValue(PropertyNames.CounterReset) ?? string.Empty; } set { SetProperty(PropertyNames.CounterReset, value); } } [DOM("cssFloat")] public string Float { get { return GetPropertyValue(PropertyNames.Float) ?? string.Empty; } set { SetProperty(PropertyNames.Float, value); } } [DOM("cursor")] public string Cursor { get { return GetPropertyValue(PropertyNames.Cursor) ?? string.Empty; } set { SetProperty(PropertyNames.Cursor, value); } } [DOM("direction")] public string Direction { get { return GetPropertyValue(PropertyNames.Direction) ?? string.Empty; } set { SetProperty(PropertyNames.Direction, value); } } [DOM("display")] public string Display { get { return GetPropertyValue(PropertyNames.Display) ?? string.Empty; } set { SetProperty(PropertyNames.Display, value); } } [DOM("dominantBaseline")] public string DominantBaseline { get { return GetPropertyValue(PropertyNames.DominantBaseline) ?? string.Empty; } set { SetProperty(PropertyNames.DominantBaseline, value); } } [DOM("emptyCells")] public string EmptyCells { get { return GetPropertyValue(PropertyNames.EmptyCells) ?? string.Empty; } set { SetProperty(PropertyNames.EmptyCells, value); } } [DOM("enableBackground")] public string EnableBackground { get { return GetPropertyValue(PropertyNames.EnableBackground) ?? string.Empty; } set { SetProperty(PropertyNames.EnableBackground, value); } } [DOM("fill")] public string Fill { get { return GetPropertyValue(PropertyNames.Fill) ?? string.Empty; } set { SetProperty(PropertyNames.Fill, value); } } [DOM("fillOpacity")] public string FillOpacity { get { return GetPropertyValue(PropertyNames.FillOpacity) ?? string.Empty; } set { SetProperty(PropertyNames.FillOpacity, value); } } [DOM("fillRule")] public string FillRule { get { return GetPropertyValue(PropertyNames.FillRule) ?? string.Empty; } set { SetProperty(PropertyNames.FillRule, value); } } [DOM("filter")] public string Filter { get { return GetPropertyValue(PropertyNames.Filter) ?? string.Empty; } set { SetProperty(PropertyNames.Filter, value); } } [DOM("flex")] public string Flex { get { return GetPropertyValue(PropertyNames.Flex) ?? string.Empty; } set { SetProperty(PropertyNames.Flex, value); } } [DOM("flexBasis")] public string FlexBasis { get { return GetPropertyValue(PropertyNames.FlexBasis) ?? string.Empty; } set { SetProperty(PropertyNames.FlexBasis, value); } } [DOM("flexDirection")] public string FlexDirection { get { return GetPropertyValue(PropertyNames.FlexDirection) ?? string.Empty; } set { SetProperty(PropertyNames.FlexDirection, value); } } [DOM("flexFlow")] public string FlexFlow { get { return GetPropertyValue(PropertyNames.FlexFlow) ?? string.Empty; } set { SetProperty(PropertyNames.FlexFlow, value); } } [DOM("flexGrow")] public string FlexGrow { get { return GetPropertyValue(PropertyNames.FlexGrow) ?? string.Empty; } set { SetProperty(PropertyNames.FlexGrow, value); } } [DOM("flexShrink")] public string FlexShrink { get { return GetPropertyValue(PropertyNames.FlexShrink) ?? string.Empty; } set { SetProperty(PropertyNames.FlexShrink, value); } } [DOM("flexWrap")] public string FlexWrap { get { return GetPropertyValue(PropertyNames.FlexWrap) ?? string.Empty; } set { SetProperty(PropertyNames.FlexWrap, value); } } [DOM("font")] public string Font { get { return GetPropertyValue(PropertyNames.Font) ?? string.Empty; } set { SetProperty(PropertyNames.Font, value); } } [DOM("fontFamily")] public string FontFamily { get { return GetPropertyValue(PropertyNames.FontFamily) ?? string.Empty; } set { SetProperty(PropertyNames.FontFamily, value); } } [DOM("fontFeatureSettings")] public string FontFeatureSettings { get { return GetPropertyValue(PropertyNames.FontFeatureSettings) ?? string.Empty; } set { SetProperty(PropertyNames.FontFeatureSettings, value); } } [DOM("fontSize")] public string FontSize { get { return GetPropertyValue(PropertyNames.FontSize) ?? string.Empty; } set { SetProperty(PropertyNames.FontSize, value); } } [DOM("fontSizeAdjust")] public string FontSizeAdjust { get { return GetPropertyValue(PropertyNames.FontSizeAdjust) ?? string.Empty; } set { SetProperty(PropertyNames.FontSizeAdjust, value); } } [DOM("fontStretch")] public string FontStretch { get { return GetPropertyValue(PropertyNames.FontStretch) ?? string.Empty; } set { SetProperty(PropertyNames.FontStretch, value); } } [DOM("fontStyle")] public string FontStyle { get { return GetPropertyValue(PropertyNames.FontStyle) ?? string.Empty; } set { SetProperty(PropertyNames.FontStyle, value); } } [DOM("fontVariant")] public string FontVariant { get { return GetPropertyValue(PropertyNames.FontVariant) ?? string.Empty; } set { SetProperty(PropertyNames.FontVariant, value); } } [DOM("fontWeight")] public string FontWeight { get { return GetPropertyValue(PropertyNames.FontWeight) ?? string.Empty; } set { SetProperty(PropertyNames.FontWeight, value); } } [DOM("glyphOrientationHorizontal")] public string GlyphOrientationHorizontal { get { return GetPropertyValue(PropertyNames.GlyphOrientationHorizontal) ?? string.Empty; } set { SetProperty(PropertyNames.GlyphOrientationHorizontal, value); } } [DOM("glyphOrientationVertical")] public string GlyphOrientationVertical { get { return GetPropertyValue(PropertyNames.GlyphOrientationVertical) ?? string.Empty; } set { SetProperty(PropertyNames.GlyphOrientationVertical, value); } } [DOM("height")] public string Height { get { return GetPropertyValue(PropertyNames.Height) ?? string.Empty; } set { SetProperty(PropertyNames.Height, value); } } [DOM("imeMode")] public string ImeMode { get { return GetPropertyValue(PropertyNames.ImeMode) ?? string.Empty; } set { SetProperty(PropertyNames.ImeMode, value); } } [DOM("justifyContent")] public string JustifyContent { get { return GetPropertyValue(PropertyNames.JustifyContent) ?? string.Empty; } set { SetProperty(PropertyNames.JustifyContent, value); } } [DOM("layoutGrid")] public string LayoutGrid { get { return GetPropertyValue(PropertyNames.LayoutGrid) ?? string.Empty; } set { SetProperty(PropertyNames.LayoutGrid, value); } } [DOM("layoutGridChar")] public string LayoutGridChar { get { return GetPropertyValue(PropertyNames.LayoutGridChar) ?? string.Empty; } set { SetProperty(PropertyNames.LayoutGridChar, value); } } [DOM("layoutGridLine")] public string LayoutGridLine { get { return GetPropertyValue(PropertyNames.LayoutGridLine) ?? string.Empty; } set { SetProperty(PropertyNames.LayoutGridLine, value); } } [DOM("layoutGridMode")] public string LayoutGridMode { get { return GetPropertyValue(PropertyNames.LayoutGridMode) ?? string.Empty; } set { SetProperty(PropertyNames.LayoutGridMode, value); } } [DOM("layoutGridType")] public string LayoutGridType { get { return GetPropertyValue(PropertyNames.LayoutGridType) ?? string.Empty; } set { SetProperty(PropertyNames.LayoutGridType, value); } } [DOM("left")] public string Left { get { return GetPropertyValue(PropertyNames.Left) ?? string.Empty; } set { SetProperty(PropertyNames.Left, value); } } [DOM("letterSpacing")] public string LetterSpacing { get { return GetPropertyValue(PropertyNames.LetterSpacing) ?? string.Empty; } set { SetProperty(PropertyNames.LetterSpacing, value); } } [DOM("lineHeight")] public string LineHeight { get { return GetPropertyValue(PropertyNames.LineHeight) ?? string.Empty; } set { SetProperty(PropertyNames.LineHeight, value); } } [DOM("listStyle")] public string ListStyle { get { return GetPropertyValue(PropertyNames.ListStyle) ?? string.Empty; } set { SetProperty(PropertyNames.ListStyle, value); } } [DOM("listStyleImage")] public string ListStyleImage { get { return GetPropertyValue(PropertyNames.ListStyleImage) ?? string.Empty; } set { SetProperty(PropertyNames.ListStyleImage, value); } } [DOM("listStylePosition")] public string ListStylePosition { get { return GetPropertyValue(PropertyNames.ListStylePosition) ?? string.Empty; } set { SetProperty(PropertyNames.ListStylePosition, value); } } [DOM("listStyleType")] public string ListStyleType { get { return GetPropertyValue(PropertyNames.ListStyleType) ?? string.Empty; } set { SetProperty(PropertyNames.ListStyleType, value); } } [DOM("margin")] public string Margin { get { return GetPropertyValue(PropertyNames.Margin) ?? string.Empty; } set { SetProperty(PropertyNames.Margin, value); } } [DOM("marginBottom")] public string MarginBottom { get { return GetPropertyValue(PropertyNames.MarginBottom) ?? string.Empty; } set { SetProperty(PropertyNames.MarginBottom, value); } } [DOM("marginLeft")] public string MarginLeft { get { return GetPropertyValue(PropertyNames.MarginLeft) ?? string.Empty; } set { SetProperty(PropertyNames.MarginLeft, value); } } [DOM("marginRight")] public string MarginRight { get { return GetPropertyValue(PropertyNames.MarginRight) ?? string.Empty; } set { SetProperty(PropertyNames.MarginRight, value); } } [DOM("marginTop")] public string MarginTop { get { return GetPropertyValue(PropertyNames.MarginTop) ?? string.Empty; } set { SetProperty(PropertyNames.MarginTop, value); } } [DOM("marker")] public string Marker { get { return GetPropertyValue(PropertyNames.Marker) ?? string.Empty; } set { SetProperty(PropertyNames.Marker, value); } } [DOM("markerEnd")] public string MarkerEnd { get { return GetPropertyValue(PropertyNames.MarkerEnd) ?? string.Empty; } set { SetProperty(PropertyNames.MarkerEnd, value); } } [DOM("markerMid")] public string MarkerMid { get { return GetPropertyValue(PropertyNames.MarkerMid) ?? string.Empty; } set { SetProperty(PropertyNames.MarkerMid, value); } } [DOM("markerStart")] public string MarkerStart { get { return GetPropertyValue(PropertyNames.MarkerStart) ?? string.Empty; } set { SetProperty(PropertyNames.MarkerStart, value); } } [DOM("mask")] public string Mask { get { return GetPropertyValue(PropertyNames.Mask) ?? string.Empty; } set { SetProperty(PropertyNames.Mask, value); } } [DOM("maxHeight")] public string MaxHeight { get { return GetPropertyValue(PropertyNames.MaxHeight) ?? string.Empty; } set { SetProperty(PropertyNames.MaxHeight, value); } } [DOM("maxWidth")] public string MaxWidth { get { return GetPropertyValue(PropertyNames.MaxWidth) ?? string.Empty; } set { SetProperty(PropertyNames.MaxWidth, value); } } [DOM("minHeight")] public string MinHeight { get { return GetPropertyValue(PropertyNames.MinHeight) ?? string.Empty; } set { SetProperty(PropertyNames.MinHeight, value); } } [DOM("minWidth")] public string MinWidth { get { return GetPropertyValue(PropertyNames.MinWidth) ?? string.Empty; } set { SetProperty(PropertyNames.MinWidth, value); } } [DOM("opacity")] public string Opacity { get { return GetPropertyValue(PropertyNames.Opacity) ?? string.Empty; } set { SetProperty(PropertyNames.Opacity, value); } } [DOM("order")] public string Order { get { return GetPropertyValue(PropertyNames.Order) ?? string.Empty; } set { SetProperty(PropertyNames.Order, value); } } [DOM("orphans")] public string Orphans { get { return GetPropertyValue(PropertyNames.Orphans) ?? string.Empty; } set { SetProperty(PropertyNames.Orphans, value); } } [DOM("outline")] public string Outline { get { return GetPropertyValue(PropertyNames.Outline) ?? string.Empty; } set { SetProperty(PropertyNames.Outline, value); } } [DOM("outlineColor")] public string OutlineColor { get { return GetPropertyValue(PropertyNames.OutlineColor) ?? string.Empty; } set { SetProperty(PropertyNames.OutlineColor, value); } } [DOM("outlineStyle")] public string OutlineStyle { get { return GetPropertyValue(PropertyNames.OutlineStyle) ?? string.Empty; } set { SetProperty(PropertyNames.OutlineStyle, value); } } [DOM("outlineWidth")] public string OutlineWidth { get { return GetPropertyValue(PropertyNames.OutlineWidth) ?? string.Empty; } set { SetProperty(PropertyNames.OutlineWidth, value); } } [DOM("overflow")] public string Overflow { get { return GetPropertyValue(PropertyNames.Overflow) ?? string.Empty; } set { SetProperty(PropertyNames.Overflow, value); } } [DOM("overflowX")] public string OverflowX { get { return GetPropertyValue(PropertyNames.OverflowX) ?? string.Empty; } set { SetProperty(PropertyNames.OverflowX, value); } } [DOM("overflowY")] public string OverflowY { get { return GetPropertyValue(PropertyNames.OverflowY) ?? string.Empty; } set { SetProperty(PropertyNames.OverflowY, value); } } [DOM("padding")] public string Padding { get { return GetPropertyValue(PropertyNames.Padding) ?? string.Empty; } set { SetProperty(PropertyNames.Padding, value); } } [DOM("paddingBottom")] public string PaddingBottom { get { return GetPropertyValue(PropertyNames.PaddingBottom) ?? string.Empty; } set { SetProperty(PropertyNames.PaddingBottom, value); } } [DOM("paddingLeft")] public string PaddingLeft { get { return GetPropertyValue(PropertyNames.PaddingLeft) ?? string.Empty; } set { SetProperty(PropertyNames.PaddingLeft, value); } } [DOM("paddingRight")] public string PaddingRight { get { return GetPropertyValue(PropertyNames.PaddingRight) ?? string.Empty; } set { SetProperty(PropertyNames.PaddingRight, value); } } [DOM("paddingTop")] public string PaddingTop { get { return GetPropertyValue(PropertyNames.PaddingTop) ?? string.Empty; } set { SetProperty(PropertyNames.PaddingTop, value); } } [DOM("pageBreakAfter")] public string PageBreakAfter { get { return GetPropertyValue(PropertyNames.PageBreakAfter) ?? string.Empty; } set { SetProperty(PropertyNames.PageBreakAfter, value); } } [DOM("pageBreakBefore")] public string PageBreakBefore { get { return GetPropertyValue(PropertyNames.PageBreakBefore) ?? string.Empty; } set { SetProperty(PropertyNames.PageBreakBefore, value); } } [DOM("pageBreakInside")] public string PageBreakInside { get { return GetPropertyValue(PropertyNames.PageBreakInside) ?? string.Empty; } set { SetProperty(PropertyNames.PageBreakInside, value); } } [DOM("perspective")] public string Perspective { get { return GetPropertyValue(PropertyNames.Perspective) ?? string.Empty; } set { SetProperty(PropertyNames.Perspective, value); } } [DOM("perspectiveOrigin")] public string PerspectiveOrigin { get { return GetPropertyValue(PropertyNames.PerspectiveOrigin) ?? string.Empty; } set { SetProperty(PropertyNames.PerspectiveOrigin, value); } } [DOM("pointerEvents")] public string PointerEvents { get { return GetPropertyValue(PropertyNames.PointerEvents) ?? string.Empty; } set { SetProperty(PropertyNames.PointerEvents, value); } } [DOM("position")] public string Position { get { return GetPropertyValue(PropertyNames.Position) ?? string.Empty; } set { SetProperty(PropertyNames.Position, value); } } [DOM("quotes")] public string Quotes { get { return GetPropertyValue(PropertyNames.Quotes) ?? string.Empty; } set { SetProperty(PropertyNames.Quotes, value); } } [DOM("right")] public string Right { get { return GetPropertyValue(PropertyNames.Right) ?? string.Empty; } set { SetProperty(PropertyNames.Right, value); } } [DOM("rubyAlign")] public string RubyAlign { get { return GetPropertyValue(PropertyNames.RubyAlign) ?? string.Empty; } set { SetProperty(PropertyNames.RubyAlign, value); } } [DOM("rubyOverhang")] public string RubyOverhang { get { return GetPropertyValue(PropertyNames.RubyOverhang) ?? string.Empty; } set { SetProperty(PropertyNames.RubyOverhang, value); } } [DOM("rubyPosition")] public string RubyPosition { get { return GetPropertyValue(PropertyNames.RubyPosition) ?? string.Empty; } set { SetProperty(PropertyNames.RubyPosition, value); } } [DOM("scrollbar3dLightColor")] public string Scrollbar3dLightColor { get { return GetPropertyValue(PropertyNames.Scrollbar3dLightColor) ?? string.Empty; } set { SetProperty(PropertyNames.Scrollbar3dLightColor, value); } } [DOM("scrollbarArrowColor")] public string ScrollbarArrowColor { get { return GetPropertyValue(PropertyNames.ScrollbarArrowColor) ?? string.Empty; } set { SetProperty(PropertyNames.ScrollbarArrowColor, value); } } [DOM("scrollbarDarkShadowColor")] public string ScrollbarDarkShadowColor { get { return GetPropertyValue(PropertyNames.ScrollbarDarkShadowColor) ?? string.Empty; } set { SetProperty(PropertyNames.ScrollbarDarkShadowColor, value); } } [DOM("scrollbarFaceColor")] public string ScrollbarFaceColor { get { return GetPropertyValue(PropertyNames.ScrollbarFaceColor) ?? string.Empty; } set { SetProperty(PropertyNames.ScrollbarFaceColor, value); } } [DOM("scrollbarHighlightColor")] public string ScrollbarHighlightColor { get { return GetPropertyValue(PropertyNames.ScrollbarHighlightColor) ?? string.Empty; } set { SetProperty(PropertyNames.ScrollbarHighlightColor, value); } } [DOM("scrollbarShadowColor")] public string ScrollbarShadowColor { get { return GetPropertyValue(PropertyNames.ScrollbarShadowColor) ?? string.Empty; } set { SetProperty(PropertyNames.ScrollbarShadowColor, value); } } [DOM("scrollbarTrackColor")] public string ScrollbarTrackColor { get { return GetPropertyValue(PropertyNames.ScrollbarTrackColor) ?? string.Empty; } set { SetProperty(PropertyNames.ScrollbarTrackColor, value); } } [DOM("stroke")] public string Stroke { get { return GetPropertyValue(PropertyNames.Stroke) ?? string.Empty; } set { SetProperty(PropertyNames.Stroke, value); } } [DOM("strokeDasharray")] public string StrokeDasharray { get { return GetPropertyValue(PropertyNames.StrokeDasharray) ?? string.Empty; } set { SetProperty(PropertyNames.StrokeDasharray, value); } } [DOM("strokeDashoffset")] public string StrokeDashoffset { get { return GetPropertyValue(PropertyNames.StrokeDashoffset) ?? string.Empty; } set { SetProperty(PropertyNames.StrokeDashoffset, value); } } [DOM("strokeLinecap")] public string StrokeLinecap { get { return GetPropertyValue(PropertyNames.StrokeLinecap) ?? string.Empty; } set { SetProperty(PropertyNames.StrokeLinecap, value); } } [DOM("strokeLinejoin")] public string StrokeLinejoin { get { return GetPropertyValue(PropertyNames.StrokeLinejoin) ?? string.Empty; } set { SetProperty(PropertyNames.StrokeLinejoin, value); } } [DOM("strokeMiterlimit")] public string StrokeMiterlimit { get { return GetPropertyValue(PropertyNames.StrokeMiterlimit) ?? string.Empty; } set { SetProperty(PropertyNames.StrokeMiterlimit, value); } } [DOM("strokeOpacity")] public string StrokeOpacity { get { return GetPropertyValue(PropertyNames.StrokeOpacity) ?? string.Empty; } set { SetProperty(PropertyNames.StrokeOpacity, value); } } [DOM("strokeWidth")] public string StrokeWidth { get { return GetPropertyValue(PropertyNames.StrokeWidth) ?? string.Empty; } set { SetProperty(PropertyNames.StrokeWidth, value); } } [DOM("tableLayout")] public string TableLayout { get { return GetPropertyValue(PropertyNames.TableLayout) ?? string.Empty; } set { SetProperty(PropertyNames.TableLayout, value); } } [DOM("textAlign")] public string TextAlign { get { return GetPropertyValue(PropertyNames.TextAlign) ?? string.Empty; } set { SetProperty(PropertyNames.TextAlign, value); } } [DOM("textAlignLast")] public string TextAlignLast { get { return GetPropertyValue(PropertyNames.TextAlignLast) ?? string.Empty; } set { SetProperty(PropertyNames.TextAlignLast, value); } } [DOM("textAnchor")] public string TextAnchor { get { return GetPropertyValue(PropertyNames.TextAnchor) ?? string.Empty; } set { SetProperty(PropertyNames.TextAnchor, value); } } [DOM("textAutospace")] public string TextAutospace { get { return GetPropertyValue(PropertyNames.TextAutospace) ?? string.Empty; } set { SetProperty(PropertyNames.TextAutospace, value); } } [DOM("textDecoration")] public string TextDecoration { get { return GetPropertyValue(PropertyNames.TextDecoration) ?? string.Empty; } set { SetProperty(PropertyNames.TextDecoration, value); } } [DOM("textIndent")] public string TextIndent { get { return GetPropertyValue(PropertyNames.TextIndent) ?? string.Empty; } set { SetProperty(PropertyNames.TextIndent, value); } } [DOM("textJustify")] public string TextJustify { get { return GetPropertyValue(PropertyNames.TextJustify) ?? string.Empty; } set { SetProperty(PropertyNames.TextJustify, value); } } [DOM("textOverflow")] public string TextOverflow { get { return GetPropertyValue(PropertyNames.TextOverflow) ?? string.Empty; } set { SetProperty(PropertyNames.TextOverflow, value); } } [DOM("textShadow")] public string TextShadow { get { return GetPropertyValue(PropertyNames.TextShadow) ?? string.Empty; } set { SetProperty(PropertyNames.TextShadow, value); } } [DOM("textTransform")] public string TextTransform { get { return GetPropertyValue(PropertyNames.TextTransform) ?? string.Empty; } set { SetProperty(PropertyNames.TextTransform, value); } } [DOM("textUnderlinePosition")] public string TextUnderlinePosition { get { return GetPropertyValue(PropertyNames.TextUnderlinePosition) ?? string.Empty; } set { SetProperty(PropertyNames.TextUnderlinePosition, value); } } [DOM("top")] public string Top { get { return GetPropertyValue(PropertyNames.Top) ?? string.Empty; } set { SetProperty(PropertyNames.Top, value); } } [DOM("transform")] public string Transform { get { return GetPropertyValue(PropertyNames.Transform) ?? string.Empty; } set { SetProperty(PropertyNames.Transform, value); } } [DOM("transformOrigin")] public string TransformOrigin { get { return GetPropertyValue(PropertyNames.TransformOrigin) ?? string.Empty; } set { SetProperty(PropertyNames.TransformOrigin, value); } } [DOM("transformStyle")] public string TransformStyle { get { return GetPropertyValue(PropertyNames.TransformStyle) ?? string.Empty; } set { SetProperty(PropertyNames.TransformStyle, value); } } [DOM("transition")] public string Transition { get { return GetPropertyValue(PropertyNames.Transition) ?? string.Empty; } set { SetProperty(PropertyNames.Transition, value); } } [DOM("transitionDelay")] public string TransitionDelay { get { return GetPropertyValue(PropertyNames.TransitionDelay) ?? string.Empty; } set { SetProperty(PropertyNames.TransitionDelay, value); } } [DOM("transitionDuration")] public string TransitionDuration { get { return GetPropertyValue(PropertyNames.TransitionDuration) ?? string.Empty; } set { SetProperty(PropertyNames.TransitionDuration, value); } } [DOM("transitionProperty")] public string TransitionProperty { get { return GetPropertyValue(PropertyNames.TransitionProperty) ?? string.Empty; } set { SetProperty(PropertyNames.TransitionProperty, value); } } [DOM("transitionTimingFunction")] public string TransitionTimingFunction { get { return GetPropertyValue(PropertyNames.TransitionTimingFunction) ?? string.Empty; } set { SetProperty(PropertyNames.TransitionTimingFunction, value); } } [DOM("unicodeBidi")] public string UnicodeBidi { get { return GetPropertyValue(PropertyNames.UnicodeBidi) ?? string.Empty; } set { SetProperty(PropertyNames.UnicodeBidi, value); } } [DOM("verticalAlign")] public string VerticalAlign { get { return GetPropertyValue(PropertyNames.VerticalAlign) ?? string.Empty; } set { SetProperty(PropertyNames.VerticalAlign, value); } } [DOM("visibility")] public string Visibility { get { return GetPropertyValue(PropertyNames.Visibility) ?? string.Empty; } set { SetProperty(PropertyNames.Visibility, value); } } [DOM("whiteSpace")] public string WhiteSpace { get { return GetPropertyValue(PropertyNames.WhiteSpace) ?? string.Empty; } set { SetProperty(PropertyNames.WhiteSpace, value); } } [DOM("widows")] public string Widows { get { return GetPropertyValue(PropertyNames.Widows) ?? string.Empty; } set { SetProperty(PropertyNames.Widows, value); } } [DOM("width")] public string Width { get { return GetPropertyValue(PropertyNames.Width) ?? string.Empty; } set { SetProperty(PropertyNames.Width, value); } } [DOM("wordBreak")] public string WordBreak { get { return GetPropertyValue(PropertyNames.WordBreak) ?? string.Empty; } set { SetProperty(PropertyNames.WordBreak, value); } } [DOM("wordSpacing")] public string WordSpacing { get { return GetPropertyValue(PropertyNames.WordSpacing) ?? string.Empty; } set { SetProperty(PropertyNames.WordSpacing, value); } } [DOM("wordWrap")] public string WordWrap { get { return GetPropertyValue(PropertyNames.WordWrap) ?? string.Empty; } set { SetProperty(PropertyNames.WordWrap, value); } } [DOM("writingMode")] public string WritingMode { get { return GetPropertyValue(PropertyNames.WritingMode) ?? string.Empty; } set { SetProperty(PropertyNames.WritingMode, value); } } [DOM("zIndex")] public string ZIndex { get { return GetPropertyValue(PropertyNames.ZIndex) ?? string.Empty; } set { SetProperty(PropertyNames.ZIndex, value); } } [DOM("zoom")] public string Zoom { get { return GetPropertyValue(PropertyNames.Zoom) ?? string.Empty; } set { SetProperty(PropertyNames.Zoom, value); } } internal CSSStyleDeclaration() { string text = string.Empty; _getter = (() => text); _setter = delegate(string value) { text = value; }; _rules = new Dictionary<string, CSSProperty>(StringComparer.OrdinalIgnoreCase); } internal CSSStyleDeclaration(Element host) { Func<string> func = _getter = delegate { if (host.OwnerDocument != null && !host.OwnerDocument.Options.IsStyling) return string.Empty; return host.GetAttribute(AttributeNames.Style); }; _setter = delegate(string value) { host.SetAttribute(AttributeNames.Style, value); }; _rules = new Dictionary<string, CSSProperty>(StringComparer.OrdinalIgnoreCase); } [DOM("removeProperty")] public string RemoveProperty(string propertyName) { if (_rules.TryGetValue(propertyName, out CSSProperty value)) { _rules.Remove(propertyName); Propagate(); return value.Value.CssText; } return null; } [DOM("getPropertyPriority")] public string GetPropertyPriority(string propertyName) { if (_rules.TryGetValue(propertyName, out CSSProperty value) && value.Important) return "important"; return null; } [DOM("getPropertyValue")] public string GetPropertyValue(string propertyName) { if (_rules.TryGetValue(propertyName, out CSSProperty value)) return value.Value.CssText; return null; } [DOM("setProperty")] public CSSStyleDeclaration SetProperty(string propertyName, string propertyValue) { CSSProperty cSSProperty = CssParser.ParseDeclaration(propertyName + ":" + propertyValue, null); if (cSSProperty != null) { _rules[propertyName] = cSSProperty; Propagate(); } return this; } internal CSSProperty Get(int index) { int num = 0; foreach (KeyValuePair<string, CSSProperty> rule in _rules) { if (num++ == index) return rule.Value; } return null; } internal CSSProperty Get(string name) { if (_rules.TryGetValue(name, out CSSProperty value)) return value; return null; } internal void Set(CSSProperty property) { if (property != null) _rules[property.Name] = property; } internal void Update(string value) { if (!_blocking) { _rules.Clear(); CssParser.AppendDeclarations(this, value ?? string.Empty, null); } } private void Propagate() { _blocking = true; _setter(ToCss()); _blocking = false; } public string ToCss() { StringBuilder stringBuilder = Pool.NewStringBuilder(); foreach (KeyValuePair<string, CSSProperty> rule in _rules) { stringBuilder.Append(rule.Value.ToCss()).Append(';'); } return stringBuilder.ToPool(); } public IEnumerator<CSSProperty> GetEnumerator() { return _rules.Values.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }