Skip to content

Commit 398f756

Browse files
committed
Reference right initial values
1 parent 1a85c05 commit 398f756

File tree

107 files changed

+134
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+134
-183
lines changed

src/AngleSharp.Css/Constants/InitialValues.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ static class InitialValues
117117
public static readonly ICssValue TextDecorationLineDecl = new Constant<Object>(CssKeywords.None, null);
118118
public static readonly ICssValue TextDecorationStyleDecl = new Constant<LineStyle>(CssKeywords.Solid, LineStyle.Solid);
119119
public static readonly ICssValue TextDecorationColorDecl = new Constant<Color>(CssKeywords.CurrentColor, Color.CurrentColor);
120+
public static readonly ICssValue TextAnchorDecl = new Constant<TextAnchor>(CssKeywords.Start, TextAnchor.Start);
120121
public static readonly ICssValue ListStyleTypeDecl = new Constant<ListStyle>(CssKeywords.Disc, ListStyle.Disc);
121122
public static readonly ICssValue ListStylePositionDecl = new Constant<ListPosition>(CssKeywords.Outside, ListPosition.Outside);
122123
public static readonly ICssValue ListStyleImageDecl = new Constant<Object>(CssKeywords.None, null);
@@ -132,14 +133,20 @@ static class InitialValues
132133
public static readonly ICssValue ColumnGapDecl = new Constant<Length>(CssKeywords.Normal, Length.Normal);
133134
public static readonly ICssValue RowGapDecl = new Constant<Length>(CssKeywords.Normal, Length.Normal);
134135
public static readonly ICssValue PerspectiveDecl = new Constant<Object>(CssKeywords.None, null);
136+
public static readonly ICssValue PerspectiveOriginDecl = Point.Center;
135137
public static readonly ICssValue PositionDecl = new Constant<PositionMode>(CssKeywords.Inline, PositionMode.Static);
136138
public static readonly ICssValue TransformDecl = new Constant<Object>(CssKeywords.None, null);
137139
public static readonly ICssValue TransformStyleDecl = new Constant<Boolean>(CssKeywords.Flat, true);
140+
public static readonly ICssValue TransformOriginDecl = Point.Center;
138141
public static readonly ICssValue TableLayoutDecl = new Constant<Boolean>(CssKeywords.Auto, false);
139142
public static readonly ICssValue ClearDecl = new Constant<ClearMode>(CssKeywords.None, ClearMode.None);
140143
public static readonly ICssValue ClipDecl = new Constant<Length>(CssKeywords.Auto, Length.Auto);
141-
public static readonly ICssValue StrokeOpacityDecl = new Length(1, Length.Unit.None);
144+
public static readonly ICssValue StrokeOpacityDecl = new Length(1.0, Length.Unit.None);
142145
public static readonly ICssValue StrokeLinecapDecl = new Constant<StrokeLinecap>(CssKeywords.Butt, StrokeLinecap.Butt);
146+
public static readonly ICssValue StrokeLinejoinDecl = new Constant<StrokeLinejoin>(CssKeywords.Miter, StrokeLinejoin.Miter);
147+
public static readonly ICssValue StrokeDashoffsetDecl = Length.Zero;
148+
public static readonly ICssValue StrokeDasharrayDecl = new Constant<Object>(CssKeywords.None, null);
149+
public static readonly ICssValue StrokeWidthDecl = new Length(1.0, Length.Unit.Px);
143150
public static readonly ICssValue RubyPositionDecl = new Constant<RubyPosition>(CssKeywords.Over, RubyPosition.Over);
144151
public static readonly ICssValue RubyOverhangDecl = new Constant<RubyOverhangMode>(CssKeywords.None, RubyOverhangMode.None);
145152
public static readonly ICssValue RubyAlignDecl = new Constant<RubyAlignment>(CssKeywords.SpaceAround, RubyAlignment.SpaceAround);
@@ -158,18 +165,33 @@ static class InitialValues
158165
public static readonly ICssValue BorderImageOutsetDecl = Length.Zero;
159166
public static readonly ICssValue BorderImageRepeatDecl = new Constant<BorderRepeat>(CssKeywords.Stretch, BorderRepeat.Stretch);
160167
public static readonly ICssValue BorderCollapseDecl = new Constant<Boolean>(CssKeywords.Separate, true);
168+
public static readonly ICssValue BorderRadiusDecl = Length.Zero;
161169
public static readonly ICssValue AlignSelfDecl = new Constant<FlexContentMode>(CssKeywords.Auto, FlexContentMode.Auto);
162170
public static readonly ICssValue AlignItemsDecl = new Constant<FlexContentMode>(CssKeywords.Normal, FlexContentMode.Stretch);
163171
public static readonly ICssValue AlignContentDecl = new Constant<FlexContentMode>(CssKeywords.Normal, FlexContentMode.Stretch);
164172
public static readonly ICssValue JustifyContentDecl = new Constant<Object>(CssKeywords.Normal, null);
165173
public static readonly ICssValue JustifyItemsDecl = new Constant<Object>(CssKeywords.Legacy, null);
166174
public static readonly ICssValue JustifySelfDecl = new Constant<FlexContentMode>(CssKeywords.Auto, FlexContentMode.Auto);
167175
public static readonly ICssValue UnicodeBidiDecl = new Constant<UnicodeMode>(CssKeywords.Normal, UnicodeMode.Normal);
176+
public static readonly ICssValue WordWrapDecl = new Constant<OverflowWrap>(CssKeywords.Normal, OverflowWrap.Normal);
168177
public static readonly ICssValue WidowsDecl = new Length(2, Length.Unit.None);
169178
public static readonly ICssValue OrphansDecl = new Length(2, Length.Unit.None);
170179
public static readonly ICssValue OrderDecl = new Length(0, Length.Unit.None);
171180
public static readonly ICssValue ObjectFitDecl = new Constant<ObjectFitting>(CssKeywords.Fill, ObjectFitting.Fill);
181+
public static readonly ICssValue ObjectPositionDecl = Point.Center;
172182
public static readonly ICssValue WhiteSpaceDecl = new Constant<Whitespace>(CssKeywords.Normal, Whitespace.Normal);
173183
public static readonly ICssValue ZIndexDecl = new Constant<Length>(CssKeywords.Auto, Length.Auto);
184+
public static readonly ICssValue WidthDecl = Length.Auto;
185+
public static readonly ICssValue HeightDecl = Length.Auto;
186+
public static readonly ICssValue ScrollbarTrackColorDecl = CssColors.GetColor("scrollbar");
187+
public static readonly ICssValue ScrollbarShadowColorDecl = CssColors.GetColor("threeddarkshadow");
188+
public static readonly ICssValue ScrollbarHighlightColorDecl = CssColors.GetColor("threedhighlight");
189+
public static readonly ICssValue ScrollbarFaceColorDecl = CssColors.GetColor("threedface");
190+
public static readonly ICssValue ScrollbarDarkshadowColorDecl = CssColors.GetColor("threeddarkshadow");
191+
public static readonly ICssValue ScrollbarBaseColorDecl = Color.Transparent;
192+
public static readonly ICssValue ScrollbarArrowColorDecl = CssColors.GetColor("buttontext");
193+
public static readonly ICssValue Scrollbar3dLightColorDecl = Color.White;
194+
public static readonly ICssValue LetterSpacingDecl = Length.Normal;
195+
public static readonly ICssValue FontSizeAdjustDecl = new Length(1.0, Length.Unit.Em);
174196
}
175197
}

src/AngleSharp.Css/Declarations/AnimationDeclaration.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,14 @@ sealed class AnimationConverter : IValueConverter
4141
PlayStateConverter.Option(),
4242
IdentifierConverter.Option()).FromList();
4343

44-
public ICssValue Convert(StringSource source)
45-
{
46-
return ListConverter.Convert(source);
47-
}
44+
public ICssValue Convert(StringSource source) => ListConverter.Convert(source);
4845
}
4946

5047
sealed class AnimationAggregator : IValueAggregator, IValueConverter
5148
{
5249
private static readonly IValueConverter converter = Or(new AnimationConverter(), AssignInitial());
5350

54-
public ICssValue Convert(StringSource source)
55-
{
56-
return converter.Convert(source);
57-
}
51+
public ICssValue Convert(StringSource source) => converter.Convert(source);
5852

5953
public ICssValue Merge(ICssValue[] values)
6054
{

src/AngleSharp.Css/Declarations/AnimationDelayDeclaration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
namespace AngleSharp.Css.Declarations
22
{
33
using AngleSharp.Css.Converters;
4-
using AngleSharp.Css.Values;
54
using System;
65
using static ValueConverters;
76

@@ -14,7 +13,7 @@ static class AnimationDelayDeclaration
1413
PropertyNames.Animation,
1514
};
1615

17-
public static IValueConverter Converter = Or(TimeConverter.FromList(), AssignInitial(Time.Zero));
16+
public static IValueConverter Converter = Or(TimeConverter.FromList(), AssignInitial(InitialValues.AnimationDelayDecl));
1817

1918
public static PropertyFlags Flags = PropertyFlags.None;
2019
}

src/AngleSharp.Css/Declarations/AnimationDurationDeclaration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
namespace AngleSharp.Css.Declarations
22
{
33
using AngleSharp.Css.Converters;
4-
using AngleSharp.Css.Values;
54
using System;
65
using static ValueConverters;
76

@@ -14,7 +13,7 @@ static class AnimationDurationDeclaration
1413
PropertyNames.Animation,
1514
};
1615

17-
public static IValueConverter Converter = Or(TimeConverter.FromList(), AssignInitial(Time.Zero));
16+
public static IValueConverter Converter = Or(TimeConverter.FromList(), AssignInitial(InitialValues.AnimationDurationDecl));
1817

1918
public static PropertyFlags Flags = PropertyFlags.None;
2019
}

src/AngleSharp.Css/Declarations/AnimationNameDeclaration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static class AnimationNameDeclaration
1313
PropertyNames.Animation,
1414
};
1515

16-
public static IValueConverter Converter = Or(IdentifierConverter.FromList(), None, AssignInitial());
16+
public static IValueConverter Converter = Or(IdentifierConverter.FromList(), None, AssignInitial(InitialValues.AnimationNameDecl));
1717

1818
public static PropertyFlags Flags = PropertyFlags.None;
1919
}

src/AngleSharp.Css/Declarations/AnimationTimingFunctionDeclaration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
namespace AngleSharp.Css.Declarations
22
{
33
using AngleSharp.Css.Converters;
4-
using AngleSharp.Css.Values;
54
using System;
65
using static ValueConverters;
76

@@ -14,7 +13,7 @@ static class AnimationTimingFunctionDeclaration
1413
PropertyNames.Animation,
1514
};
1615

17-
public static IValueConverter Converter = Or(TransitionConverter.FromList(), AssignInitial(CssCubicBezierValue.Ease));
16+
public static IValueConverter Converter = Or(TransitionConverter.FromList(), AssignInitial(InitialValues.AnimationTimingFunctionDecl));
1817

1918
public static PropertyFlags Flags = PropertyFlags.None;
2019
}

src/AngleSharp.Css/Declarations/BackgroundColorDeclaration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ static class BackgroundColorDeclaration
1212
PropertyNames.Background,
1313
};
1414

15-
public static IValueConverter Converter = Or(CurrentColorConverter, AssignInitial());
15+
public static IValueConverter Converter = Or(CurrentColorConverter, AssignInitial(InitialValues.BackgroundColorDecl));
1616

1717
public static PropertyFlags Flags = PropertyFlags.Hashless | PropertyFlags.Animatable;
1818
}

src/AngleSharp.Css/Declarations/BackgroundImageDeclaration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ static class BackgroundImageDeclaration
1212
PropertyNames.Background,
1313
};
1414

15-
public static IValueConverter Converter = Or(MultipleImageSourceConverter, AssignInitial());
15+
public static IValueConverter Converter = Or(MultipleImageSourceConverter, AssignInitial(InitialValues.BackgroundImageDecl));
1616

1717
public static PropertyFlags Flags = PropertyFlags.None;
1818
}

src/AngleSharp.Css/Declarations/BackgroundSizeDeclaration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static class BackgroundSizeDeclaration
1313
PropertyNames.Background,
1414
};
1515

16-
public static IValueConverter Converter = Or(BackgroundSizeConverter.FromList(), AssignInitial());
16+
public static IValueConverter Converter = Or(BackgroundSizeConverter.FromList(), AssignInitial(InitialValues.BackgroundSizeDecl));
1717

1818
public static PropertyFlags Flags = PropertyFlags.Animatable;
1919
}

src/AngleSharp.Css/Declarations/BorderBottomColorDeclaration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace AngleSharp.Css.Declarations
22
{
3-
using AngleSharp.Css.Values;
43
using System;
54
using static ValueConverters;
65

@@ -14,7 +13,7 @@ static class BorderBottomColorDeclaration
1413
PropertyNames.BorderBottom,
1514
};
1615

17-
public static IValueConverter Converter = Or(CurrentColorConverter, AssignInitial(Color.Transparent));
16+
public static IValueConverter Converter = Or(CurrentColorConverter, AssignInitial(InitialValues.BorderBottomColorDecl));
1817

1918
public static PropertyFlags Flags = PropertyFlags.None;
2019
}

0 commit comments

Comments
 (0)