diff --git a/CHANGELOG.md b/CHANGELOG.md index 74d3a57b..f8e475fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,12 @@ Released on Tuesday, May 31 2022. - Dropped .NET Framework 4.6 - Updated to use AngleSharp 0.17 +- Updated micro parser API to be public (#111) - Fixed casing issue with color, timing, and gradient functions (#109) - Fixed parsing of `skew` (#101) - Fixed shorthand properties using `inherit` being omitted (#100) +- Added support for `@counter-style` (#102) +- Added support for `@font-feature-values` (#102) - Added support for `conic-gradient` (#101) # 0.16.4 diff --git a/src/AngleSharp.Css/Constants/RuleNames.cs b/src/AngleSharp.Css/Constants/RuleNames.cs index 9a9f2c60..f51cf909 100644 --- a/src/AngleSharp.Css/Constants/RuleNames.cs +++ b/src/AngleSharp.Css/Constants/RuleNames.cs @@ -56,5 +56,15 @@ public static class RuleNames /// The @page rule. /// public static readonly String Page = "@page"; + + /// + /// The @counter-style rule. + /// + public static readonly String CounterStyle = "@counter-style"; + + /// + /// The @font-feature-values rule. + /// + public static readonly String FontFeatureValues = "@font-feature-values"; } } diff --git a/src/AngleSharp.Css/Dom/CssRuleType.cs b/src/AngleSharp.Css/Dom/CssRuleType.cs index 832b2963..50e8447e 100644 --- a/src/AngleSharp.Css/Dom/CssRuleType.cs +++ b/src/AngleSharp.Css/Dom/CssRuleType.cs @@ -1,4 +1,4 @@ -namespace AngleSharp.Css.Dom +namespace AngleSharp.Css.Dom { using AngleSharp.Attributes; @@ -7,7 +7,7 @@ /// [DomName("CSSRule")] public enum CssRuleType : byte - { + { /// /// The rule is not known and cannot be used. /// @@ -86,6 +86,6 @@ public enum CssRuleType : byte /// Creating a CSS region with @region. /// [DomName("REGION_STYLE_RULE")] - RegionStyle = 16 + RegionStyle = 16, } } diff --git a/src/AngleSharp.Css/Dom/Internal/CssMedium.cs b/src/AngleSharp.Css/Dom/Internal/CssMedium.cs index 986c7e63..8e50b2d7 100644 --- a/src/AngleSharp.Css/Dom/Internal/CssMedium.cs +++ b/src/AngleSharp.Css/Dom/Internal/CssMedium.cs @@ -10,7 +10,7 @@ namespace AngleSharp.Css.Dom /// Represents a medium rule. More information available at: /// http://www.w3.org/TR/css3-mediaqueries/ /// - sealed class CssMedium : ICssMedium + public sealed class CssMedium : ICssMedium { #region Fields @@ -23,11 +23,24 @@ sealed class CssMedium : ICssMedium #region ctor + /// + /// Creates a new CSS medium. + /// + /// The type of the media rule. + /// Specifies if it should be inverted. + /// Specifies if the rule is exclusive. public CssMedium(String type, Boolean inverse, Boolean exclusive) : this(type, inverse, exclusive, Enumerable.Empty()) { } + /// + /// Creates a new CSS medium. + /// + /// The type of the media rule. + /// Specifies if it should be inverted. + /// Specifies if the rule is exclusive. + /// The features of the medium. public CssMedium(String type, Boolean inverse, Boolean exclusive, IEnumerable features) { _features = new List(features); @@ -40,20 +53,36 @@ public CssMedium(String type, Boolean inverse, Boolean exclusive, IEnumerable + /// Gets the feature demands (constraints) of the medium. + /// public IEnumerable Features => _features; + /// + /// Gets the type of the medium. + /// public String Type => _type; + /// + /// Gets if the medium is exclusive to other media. + /// public Boolean IsExclusive => _exclusive; + /// + /// Gets if the medium should be inverted. + /// public Boolean IsInverse => _inverse; + /// + /// Gets the constraints - i.e., the stringified features. + /// public String Constraints => String.Join(" and ", Features.Select(m => m.ToCss())); #endregion #region Methods + /// public override Boolean Equals(Object obj) { var other = obj as CssMedium; @@ -80,8 +109,12 @@ public override Boolean Equals(Object obj) return false; } + /// public override Int32 GetHashCode() => base.GetHashCode(); + /// + /// Writes the medium as CSS. + /// public void ToCss(TextWriter writer, IStyleFormatter formatter) { var offset = 0; diff --git a/src/AngleSharp.Css/Dom/Internal/Rules/CssCounterStyleRule.cs b/src/AngleSharp.Css/Dom/Internal/Rules/CssCounterStyleRule.cs new file mode 100644 index 00000000..170b0249 --- /dev/null +++ b/src/AngleSharp.Css/Dom/Internal/Rules/CssCounterStyleRule.cs @@ -0,0 +1,40 @@ +namespace AngleSharp.Css.Dom +{ + using AngleSharp.Css; + using System; + using System.Collections.Generic; + using System.Diagnostics; + + /// + /// Represents the @counter-style rule. + /// + [DebuggerDisplay(null, Name = "CssCounterStyleRule ({StyleName})")] + sealed class CssCounterStyleRule : CssDeclarationRule, ICssRule + { + #region ctor + + internal CssCounterStyleRule(ICssStyleSheet owner) + : base(owner, CssRuleType.CounterStyle, RuleNames.CounterStyle, new HashSet()) + { + } + + #endregion + + #region Properties + + /// + /// Gets or sets the counter style name argument. + /// + public String StyleName { get; set; } + + #endregion + + #region Methods + + protected override void ReplaceWith(ICssRule rule) + { + } + + #endregion + } +} diff --git a/src/AngleSharp.Css/Dom/Internal/Rules/CssFontFeatureValuesRule.cs b/src/AngleSharp.Css/Dom/Internal/Rules/CssFontFeatureValuesRule.cs new file mode 100644 index 00000000..b5b1f0e6 --- /dev/null +++ b/src/AngleSharp.Css/Dom/Internal/Rules/CssFontFeatureValuesRule.cs @@ -0,0 +1,41 @@ +namespace AngleSharp.Css.Dom +{ + using AngleSharp.Css; + using System; + using System.Collections.Generic; + using System.Diagnostics; + + /// + /// Represents the @font-feature-values rule. + /// + [DebuggerDisplay(null, Name = "CssFontFeatureValuesRule ({FamilyName})")] + sealed class CssFontFeatureValuesRule : CssDeclarationRule, ICssRule + { + #region ctor + + internal CssFontFeatureValuesRule(ICssStyleSheet owner) + : base(owner, CssRuleType.FontFeatureValues, RuleNames.FontFeatureValues, new HashSet()) + { + // character-variant, styleset, stylistic, ornaments, annotation, swash + } + + #endregion + + #region Properties + + /// + /// Gets or sets the family name argument. + /// + public String FamilyName { get; set; } + + #endregion + + #region Methods + + protected override void ReplaceWith(ICssRule rule) + { + } + + #endregion + } +} diff --git a/src/AngleSharp.Css/Parser/CssBuilder.cs b/src/AngleSharp.Css/Parser/CssBuilder.cs index b7f8f16f..b73e1b80 100644 --- a/src/AngleSharp.Css/Parser/CssBuilder.cs +++ b/src/AngleSharp.Css/Parser/CssBuilder.cs @@ -116,6 +116,16 @@ private ICssRule CreateAtRule(ICssStyleSheet sheet, CssToken token) var rule = new CssDocumentRule(sheet); return CreateDocument(rule, token); } + else if (token.Data.Is(RuleNames.CounterStyle)) + { + var rule = new CssCounterStyleRule(sheet); + return CreateCounterStyle(rule, token); + } + else if (token.Data.Is(RuleNames.FontFeatureValues)) + { + var rule = new CssFontFeatureValuesRule(sheet); + return CreateFontFeatureValues(rule, token); + } else if (_options.IsIncludingUnknownRules) { return CreateUnknownAtRule(sheet, token); @@ -279,7 +289,7 @@ private CssPageRule CreatePage(CssPageRule rule, CssToken current) { rule.SetInvalidSelector(selectorText); } - + CollectTrivia(ref current); if (current.Type != CssTokenType.CurlyBracketOpen) @@ -312,6 +322,19 @@ private CssSupportsRule CreateSupports(CssSupportsRule rule, CssToken current) return null; } + private CssFontFeatureValuesRule CreateFontFeatureValues(CssFontFeatureValuesRule rule, CssToken current) + { + CollectTrivia(ref current); + //rule.FamilyName = + return null; + } + + private CssCounterStyleRule CreateCounterStyle(CssCounterStyleRule rule, CssToken current) + { + CollectTrivia(ref current); + return null; + } + public CssStyleRule CreateStyle(CssStyleRule rule, CssToken current) { CollectTrivia(ref current); @@ -556,7 +579,7 @@ private void JumpToRuleEnd(ref CssToken current) { scopes--; } - + if (scopes <= 0 && (current.Is(CssTokenType.CurlyBracketClose, CssTokenType.Semicolon))) { break; diff --git a/src/AngleSharp.Css/Parser/Micro/CalcParser.cs b/src/AngleSharp.Css/Parser/Micro/CalcParser.cs index b196d014..05b9085f 100644 --- a/src/AngleSharp.Css/Parser/Micro/CalcParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/CalcParser.cs @@ -6,8 +6,14 @@ namespace AngleSharp.Css.Parser using System; using System.Globalization; - static class CalcParser + /// + /// Represents extensions to for calc values. + /// + public static class CalcParser { + /// + /// Parses a calc value, if any. + /// public static CssCalcValue ParseCalc(this StringSource source) { var pos = source.Index; diff --git a/src/AngleSharp.Css/Parser/Micro/ColorParser.cs b/src/AngleSharp.Css/Parser/Micro/ColorParser.cs index 8c1cb46c..bffb1b37 100644 --- a/src/AngleSharp.Css/Parser/Micro/ColorParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/ColorParser.cs @@ -6,6 +6,9 @@ namespace AngleSharp.Css.Parser using System.Collections.Generic; using System.Globalization; + /// + /// Represents extensions to for color values. + /// static class ColorParser { private static readonly Dictionary> ColorFunctions = new Dictionary>(StringComparer.OrdinalIgnoreCase) @@ -19,6 +22,9 @@ static class ColorParser { FunctionNames.Hwba, ParseHwba }, }; + /// + /// Parses a color value, if any. + /// public static Color? ParseColor(this StringSource source) { var pos = source.Index; @@ -32,6 +38,9 @@ static class ColorParser return result; } + /// + /// Parses a the current color value, if any. + /// public static Color? ParseCurrentColor(this StringSource source) => source.IsIdentifier(CssKeywords.CurrentColor) ? Color.CurrentColor : ColorParser.ParseColor(source); diff --git a/src/AngleSharp.Css/Parser/Micro/CompoundParser.cs b/src/AngleSharp.Css/Parser/Micro/CompoundParser.cs index 687bfcb5..a241eb29 100644 --- a/src/AngleSharp.Css/Parser/Micro/CompoundParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/CompoundParser.cs @@ -6,8 +6,14 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class CompoundParser + /// + /// Represents extensions to for general CSS compount values. + /// + public static class CompoundParser { + /// + /// Parse for a CSS quote value. + /// public static CssTupleValue ParseQuotes(this StringSource source) { var quotes = new List(); @@ -30,6 +36,9 @@ public static CssTupleValue ParseQuotes(this StringSource source) return new CssTupleValue(quotes.ToArray()); } + /// + /// Parse for a CSS border image slice. + /// public static CssBorderImageSliceValue ParseBorderImageSlice(this StringSource source) { var lengths = new Length[4]; @@ -73,6 +82,9 @@ public static CssBorderImageSliceValue ParseBorderImageSlice(this StringSource s return null; } + /// + /// Parse for a CSS background repeat. + /// public static CssImageRepeatsValue ParseBackgroundRepeat(this StringSource source) { if (source.IsIdentifier(CssKeywords.RepeatX)) @@ -106,6 +118,9 @@ public static CssImageRepeatsValue ParseBackgroundRepeat(this StringSource sourc return null; } + /// + /// Parse for a CSS image source. + /// public static ICssImageValue ParseImageSource(this StringSource source) { var url = source.ParseUri(); @@ -118,6 +133,9 @@ public static ICssImageValue ParseImageSource(this StringSource source) return url; } + /// + /// Parse for a generic periodic [u, y, d, x] value. + /// public static CssPeriodicValue ParsePeriodic(this StringSource source, Func converter) where T : ICssValue { diff --git a/src/AngleSharp.Css/Parser/Micro/ConditionParser.cs b/src/AngleSharp.Css/Parser/Micro/ConditionParser.cs index c028a5b1..da138abc 100644 --- a/src/AngleSharp.Css/Parser/Micro/ConditionParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/ConditionParser.cs @@ -5,9 +5,12 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class ConditionParser + /// + /// Represents extensions to for CSS condition values. + /// + public static class ConditionParser { - public static IConditionFunction Parse(String str, IBrowsingContext context) + internal static IConditionFunction Parse(String str, IBrowsingContext context) { var source = new StringSource(str); source.SkipSpacesAndComments(); @@ -15,6 +18,9 @@ public static IConditionFunction Parse(String str, IBrowsingContext context) return source.IsDone ? result : null; } + /// + /// Parse a CSS condition function using the current browsing context. + /// public static IConditionFunction ParseConditionFunction(this StringSource source, IBrowsingContext context) => source.Condition(context); diff --git a/src/AngleSharp.Css/Parser/Micro/CssUriParser.cs b/src/AngleSharp.Css/Parser/Micro/CssUriParser.cs index 1685a657..3c0c3802 100644 --- a/src/AngleSharp.Css/Parser/Micro/CssUriParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/CssUriParser.cs @@ -5,8 +5,14 @@ namespace AngleSharp.Css.Parser using System; using System.Text; - static class CssUriParser + /// + /// Represents extensions to for URI values. + /// + public static class CssUriParser { + /// + /// Parse a CSS url() value. + /// public static CssUrlValue ParseUri(this StringSource source) { if (source.IsFunction(FunctionNames.Url)) diff --git a/src/AngleSharp.Css/Parser/Micro/DocumentFunctionParser.cs b/src/AngleSharp.Css/Parser/Micro/DocumentFunctionParser.cs index 1f533fb2..2fe574a6 100644 --- a/src/AngleSharp.Css/Parser/Micro/DocumentFunctionParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/DocumentFunctionParser.cs @@ -1,19 +1,25 @@ -namespace AngleSharp.Css.Parser +namespace AngleSharp.Css.Parser { using AngleSharp.Css.Dom; using AngleSharp.Text; using System; using System.Collections.Generic; - static class DocumentFunctionParser + /// + /// Represents extensions to for CSS document functions. + /// + public static class DocumentFunctionParser { - public static IEnumerable Parse(String str, IDocumentFunctionFactory factory) + internal static IEnumerable Parse(String str, IDocumentFunctionFactory factory) { var source = new StringSource(str); var result = source.ParseDocumentFunctions(factory); return source.IsDone ? result : null; } + /// + /// Parse a list of contained CSS document functions. + /// public static IEnumerable ParseDocumentFunctions(this StringSource source, IDocumentFunctionFactory factory) { var functions = new List(); diff --git a/src/AngleSharp.Css/Parser/Micro/FunctionParser.cs b/src/AngleSharp.Css/Parser/Micro/FunctionParser.cs index 4a84a0b7..5ba83e1d 100644 --- a/src/AngleSharp.Css/Parser/Micro/FunctionParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/FunctionParser.cs @@ -5,10 +5,13 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class FunctionParser + /// + /// Represents extensions to for general CSS functions. + /// + public static class FunctionParser { /// - /// Represents an attribute retriever object. + /// Parses a CSS attr value. /// http://dev.w3.org/csswg/css-values/#funcdef-attr /// public static CssAttrValue ParseAttr(this StringSource source) @@ -27,6 +30,9 @@ public static CssAttrValue ParseAttr(this StringSource source) return null; } + /// + /// Parses a CSS variable reference value. + /// public static CssReferenceValue ParseVars(this StringSource source) { var index = source.Index; @@ -79,6 +85,9 @@ public static CssReferenceValue ParseVars(this StringSource source) return null; } + /// + /// Parses a CSS var (variable) value. + /// public static CssVarValue ParseVar(this StringSource source) { var name = source.ParseCustomIdent(); @@ -100,6 +109,9 @@ public static CssVarValue ParseVar(this StringSource source) return null; } + /// + /// Parses a CSS content value. + /// public static CssContentValue ParseContent(this StringSource source) { if (source.IsFunction(FunctionNames.Content)) @@ -116,6 +128,9 @@ public static CssContentValue ParseContent(this StringSource source) return null; } + /// + /// Parses a CSS running value. + /// public static CssRunningValue ParseRunning(this StringSource source) { if (source.IsFunction(FunctionNames.Running)) @@ -133,7 +148,7 @@ public static CssRunningValue ParseRunning(this StringSource source) } /// - /// Represents a counter object. + /// Parses a counter object. /// http://www.w3.org/TR/CSS2/syndata.html#value-def-counter /// public static CounterDefinition? ParseCounter(this StringSource source) diff --git a/src/AngleSharp.Css/Parser/Micro/GradientParser.cs b/src/AngleSharp.Css/Parser/Micro/GradientParser.cs index 96eababc..d14ec8b1 100644 --- a/src/AngleSharp.Css/Parser/Micro/GradientParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/GradientParser.cs @@ -6,7 +6,10 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class GradientParser + /// + /// Represents extensions to for gradient values. + /// + public static class GradientParser { private static readonly Dictionary> GradientFunctions = new Dictionary>(StringComparer.OrdinalIgnoreCase) { @@ -18,6 +21,9 @@ static class GradientParser { FunctionNames.RepeatingConicGradient, ParseRepeatingConicGradient }, }; + /// + /// Parses a CSS gradient value. + /// public static ICssGradientFunctionValue ParseGradient(this StringSource source) { var pos = source.Index; @@ -426,12 +432,34 @@ private static ICssValue ParseLinearAngleKeywords(StringSource source) }; } + /// + /// Contains the radial options. + /// public struct RadialOptions { + /// + /// Gets or sets if its a circle. + /// public Boolean Circle; + + /// + /// Gets or sets the center of the gradient. + /// public Point Center; + + /// + /// Gets or sets the width of the gradient. + /// public ICssValue Width; + + /// + /// Gets or sets the height of the gradient. + /// public ICssValue Height; + + /// + /// Gets or sets the size of the gradient. + /// public CssRadialGradientValue.SizeMode Size; } diff --git a/src/AngleSharp.Css/Parser/Micro/GridParser.cs b/src/AngleSharp.Css/Parser/Micro/GridParser.cs index 002c2efa..6b16ee8d 100644 --- a/src/AngleSharp.Css/Parser/Micro/GridParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/GridParser.cs @@ -6,8 +6,14 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class GridParser + /// + /// Represents extensions to for grid values. + /// + public static class GridParser { + /// + /// Parses a grid template value. + /// public static ICssValue ParseGridTemplate(this StringSource source) { var pos = source.Index; @@ -100,6 +106,9 @@ public static ICssValue ParseGridTemplate(this StringSource source) return null; } + /// + /// Parses a grid line name value. + /// public static LineNames? ParseLineNames(this StringSource source) { var pos = source.Index; @@ -133,6 +142,9 @@ public static ICssValue ParseGridTemplate(this StringSource source) return null; } + /// + /// Parses a grid fixed size value. + /// public static ICssValue ParseFixedSize(this StringSource source) { var length = source.ParseDistanceOrCalc(); @@ -169,6 +181,9 @@ public static ICssValue ParseFixedSize(this StringSource source) return length; } + /// + /// Parses a grid track size value. + /// public static ICssValue ParseTrackSize(this StringSource source) { var length = source.ParseTrackBreadth(); @@ -217,20 +232,20 @@ public static ICssValue ParseTrackSize(this StringSource source) return length; } - public static ICssValue ParseFixedRepeat(this StringSource source) - { - return source.ParseRepeat(ParseIntegerCount, ParseFixedRepeatValue); - } + /// + /// Parses a grid fixed repeat value. + /// + public static ICssValue ParseFixedRepeat(this StringSource source) => source.ParseRepeat(ParseIntegerCount, ParseFixedRepeatValue); - public static ICssValue ParseAutoRepeat(this StringSource source) - { - return source.ParseRepeat(ParseAutoCount, ParseFixedRepeatValue); - } + /// + /// Parses a grid auto repeat value. + /// + public static ICssValue ParseAutoRepeat(this StringSource source) => source.ParseRepeat(ParseAutoCount, ParseFixedRepeatValue); - public static ICssValue ParseTrackRepeat(this StringSource source) - { - return source.ParseRepeat(ParseIntegerCount, ParseTrackRepeatValue); - } + /// + /// Parses a grid track repeat value. + /// + public static ICssValue ParseTrackRepeat(this StringSource source) => source.ParseRepeat(ParseIntegerCount, ParseTrackRepeatValue); private static ICssValue ParseAutoCount(this StringSource source) { @@ -292,26 +307,23 @@ private static ICssValue ParseRepeat(this StringSource source, Func source.ParseRepeatValue(ParseFixedSize); - private static ICssValue ParseTrackRepeatValue(this StringSource source) - { - return source.ParseRepeatValue(ParseTrackSize); - } + private static ICssValue ParseTrackRepeatValue(this StringSource source) => source.ParseRepeatValue(ParseTrackSize); - public static ICssValue ParseTrackList(this StringSource source) - { - return source.ParseRepeatValue(s => s.ParseTrackSize() ?? s.ParseTrackRepeat()); - } + /// + /// Parses a track list value. + /// + public static ICssValue ParseTrackList(this StringSource source) => source.ParseRepeatValue(s => s.ParseTrackSize() ?? s.ParseTrackRepeat()); - public static ICssValue ParseExplicitTrackList(this StringSource source) - { - return source.ParseRepeatValue(s => s.ParseTrackSize()); - } + /// + /// Parses an explicit track list value. + /// + public static ICssValue ParseExplicitTrackList(this StringSource source) => source.ParseRepeatValue(s => s.ParseTrackSize()); + /// + /// Parses an auto track list value. + /// public static ICssValue ParseAutoTrackList(this StringSource source) { var values = new List(); diff --git a/src/AngleSharp.Css/Parser/Micro/IdentParser.cs b/src/AngleSharp.Css/Parser/Micro/IdentParser.cs index 44a00f81..8899ce71 100644 --- a/src/AngleSharp.Css/Parser/Micro/IdentParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/IdentParser.cs @@ -7,14 +7,23 @@ namespace AngleSharp.Css.Parser using System.Collections.Generic; using System.Text; - static class IdentParser + /// + /// Represents extensions to for identifier values. + /// + public static class IdentParser { + /// + /// Parses a normalized CSS identifier value. + /// public static String ParseNormalizedIdent(this StringSource source) { var result = source.ParseIdent(); return result != null ? result.ToLowerInvariant() : result; } + /// + /// Parses a custom CSS identifier value. + /// public static String ParseCustomIdent(this StringSource source) { var current = source.Current; @@ -29,6 +38,9 @@ public static String ParseCustomIdent(this StringSource source) return Start(source, current, buffer); } + /// + /// Parses a CSS identifier value. + /// public static String ParseIdent(this StringSource source) { var current = source.Current; @@ -36,6 +48,9 @@ public static String ParseIdent(this StringSource source) return Start(source, current, buffer); } + /// + /// Parses a CSS constant value from a given dictionary. + /// public static ICssValue ParseConstant(this StringSource source, IDictionary values) where T : struct { @@ -51,6 +66,9 @@ public static ICssValue ParseConstant(this StringSource source, IDictionary + /// Parses a CSS static value from a given dictionary. + /// public static Constant? ParseStatic(this StringSource source, IDictionary values) { var ident = source.ParseIdent(); @@ -63,6 +81,9 @@ public static ICssValue ParseConstant(this StringSource source, IDictionary + /// Checks if a CSS function with the given name is at the current position. + /// public static Boolean IsFunction(this StringSource source, String name) { var rest = source.Content.Length - source.Index; @@ -104,6 +125,9 @@ public static Boolean IsFunction(this StringSource source, String name) return false; } + /// + /// Checks if the provided identifier is available at the current position. + /// public static Boolean IsIdentifier(this StringSource source, String identifier) { var pos = source.Index; @@ -118,6 +142,9 @@ public static Boolean IsIdentifier(this StringSource source, String identifier) return false; } + /// + /// Parses the font family at the current position. + /// public static ICssValue ParseFontFamily(this StringSource source) { var str = source.ParseString(); @@ -137,6 +164,9 @@ public static ICssValue ParseFontFamily(this StringSource source) return new Label(str); } + /// + /// Parses the font families at the current position. + /// public static ICssValue[] ParseFontFamilies(this StringSource source) { var family = source.ParseFontFamily(); @@ -166,6 +196,9 @@ public static ICssValue[] ParseFontFamilies(this StringSource source) return null; } + /// + /// Parses the string literal value. + /// public static String ParseLiteral(this StringSource source) { var content = StringBuilderPool.Obtain(); @@ -190,6 +223,9 @@ public static String ParseLiteral(this StringSource source) return result.Length > 0 ? result : null; } + /// + /// Parses the CSS identifier value - from the animatable list. + /// public static String ParseAnimatableIdent(this StringSource source) { var pos = source.Index; diff --git a/src/AngleSharp.Css/Parser/Micro/KeyframeParser.cs b/src/AngleSharp.Css/Parser/Micro/KeyframeParser.cs index 8f1bdf8b..f6ebe328 100644 --- a/src/AngleSharp.Css/Parser/Micro/KeyframeParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/KeyframeParser.cs @@ -5,15 +5,21 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class KeyframeParser + /// + /// Represents extensions to for keyframe values. + /// + public static class KeyframeParser { - public static IKeyframeSelector Parse(String str) + internal static IKeyframeSelector Parse(String str) { var source = new StringSource(str); var result = source.ParseKeyframeSelector(); return source.IsDone ? result : null; } + /// + /// Parses the keyframe selector. + /// public static IKeyframeSelector ParseKeyframeSelector(this StringSource source) { var stops = new List(); diff --git a/src/AngleSharp.Css/Parser/Micro/MediaParser.cs b/src/AngleSharp.Css/Parser/Micro/MediaParser.cs index 8c35872d..d549bf53 100644 --- a/src/AngleSharp.Css/Parser/Micro/MediaParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/MediaParser.cs @@ -5,15 +5,21 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class MediaParser + /// + /// Represents extensions to for media values. + /// + public static class MediaParser { - public static IEnumerable Parse(String str, IFeatureValidatorFactory factory) + internal static IEnumerable Parse(String str, IFeatureValidatorFactory factory) { var source = new StringSource(str); var result = source.ParseMedia(factory); return source.IsDone ? result : null; } + /// + /// Parses the CSS media value. + /// public static IEnumerable ParseMedia(this StringSource source, IFeatureValidatorFactory factory) { var current = source.SkipSpacesAndComments(); @@ -24,7 +30,9 @@ public static IEnumerable ParseMedia(this StringSource source, IFeatu if (media.Count > 0) { if (current != Symbols.Comma) + { return null; + } source.SkipCurrentAndSpaces(); } @@ -32,7 +40,9 @@ public static IEnumerable ParseMedia(this StringSource source, IFeatu var medium = source.ParseMedium(factory); if (medium == null) + { return null; + } media.Add(medium); current = source.SkipSpacesAndComments(); diff --git a/src/AngleSharp.Css/Parser/Micro/MediumParser.cs b/src/AngleSharp.Css/Parser/Micro/MediumParser.cs index 6eb566f9..b1222c37 100644 --- a/src/AngleSharp.Css/Parser/Micro/MediumParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/MediumParser.cs @@ -5,15 +5,21 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class MediumParser + /// + /// Represents extensions to for medium (media type) values. + /// + public static class MediumParser { - public static CssMedium Parse(String str, IFeatureValidatorFactory factory) + internal static CssMedium Parse(String str, IFeatureValidatorFactory factory) { var source = new StringSource(str); var result = source.ParseMedium(factory); return source.IsDone ? result : null; } + /// + /// Parses a medium value. + /// public static CssMedium ParseMedium(this StringSource source, IFeatureValidatorFactory factory) { source.SkipSpacesAndComments(); diff --git a/src/AngleSharp.Css/Parser/Micro/NumberParser.cs b/src/AngleSharp.Css/Parser/Micro/NumberParser.cs index 65a01adf..bdb94895 100644 --- a/src/AngleSharp.Css/Parser/Micro/NumberParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/NumberParser.cs @@ -5,8 +5,14 @@ namespace AngleSharp.Css.Parser using System.Globalization; using System.Linq; - static class NumberParser + /// + /// Represents extensions to for number values. + /// + public static class NumberParser { + /// + /// Parses the number (double) value. + /// public static Double? ParseNumber(this StringSource source) { var unit = source.ParseUnit(); @@ -21,6 +27,9 @@ static class NumberParser return null; } + /// + /// Parses the ratio (double) value. + /// public static Double? ParseRatio(this StringSource source) { var pos = source.Index; @@ -37,6 +46,9 @@ static class NumberParser return null; } + /// + /// Parses the integer (double) value. + /// public static Double? ParseNaturalNumber(this StringSource source) { var pos = source.Index; @@ -51,6 +63,9 @@ static class NumberParser return null; } + /// + /// Parses the natural number (double) value. + /// public static Double? ParseGreaterOrEqualOneNumber(this StringSource source) { var pos = source.Index; @@ -65,6 +80,9 @@ static class NumberParser return null; } + /// + /// Parses the natural integer (int) value. + /// public static Int32? ParseNaturalInteger(this StringSource source) { var pos = source.Index; @@ -79,6 +97,9 @@ static class NumberParser return null; } + /// + /// Parses the positive integer (int) value. + /// public static Int32? ParsePositiveInteger(this StringSource source) { var pos = source.Index; @@ -93,6 +114,9 @@ static class NumberParser return null; } + /// + /// Parses the weight (int) value. + /// public static Int32? ParseWeightInteger(this StringSource source) { var pos = source.Index; @@ -107,6 +131,9 @@ static class NumberParser return null; } + /// + /// Parses the binary (int) value. + /// public static Int32? ParseBinary(this StringSource source) { var pos = source.Index; @@ -121,6 +148,9 @@ static class NumberParser return null; } + /// + /// Parses the integer (int) value. + /// public static Int32? ParseInteger(this StringSource source) { var unit = source.ParseUnit(); diff --git a/src/AngleSharp.Css/Parser/Micro/PointParser.cs b/src/AngleSharp.Css/Parser/Micro/PointParser.cs index d8a22d7c..66fbcf7f 100644 --- a/src/AngleSharp.Css/Parser/Micro/PointParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/PointParser.cs @@ -5,14 +5,26 @@ namespace AngleSharp.Css.Parser using AngleSharp.Text; using System; - static class PointParser + /// + /// Represents extensions to for point values. + /// + public static class PointParser { + /// + /// Parses a point's x value. + /// public static ICssValue ParsePointX(this StringSource source) => source.ParsePointDir(IsHorizontal); + /// + /// Parses a point's y value. + /// public static ICssValue ParsePointY(this StringSource source) => source.ParsePointDir(IsVertical); + /// + /// Parses a point's direction value. + /// private static ICssValue ParsePointDir(this StringSource source, Predicate checkKeyword) { var pos = source.Index; @@ -37,6 +49,9 @@ private static ICssValue ParsePointDir(this StringSource source, Predicate + /// Parses a point's origin value. + /// public static CssOriginValue ParseOrigin(this StringSource source) { var pt = source.ParsePoint(); @@ -51,6 +66,9 @@ public static CssOriginValue ParseOrigin(this StringSource source) return null; } + /// + /// Parses a point value. + /// public static Point? ParsePoint(this StringSource source) { var pos = source.Index; @@ -132,6 +150,9 @@ public static CssOriginValue ParseOrigin(this StringSource source) return null; } + /// + /// Parses a size value. + /// public static CssBackgroundSizeValue ParseSize(this StringSource source) { if (source.IsIdentifier(CssKeywords.Cover)) diff --git a/src/AngleSharp.Css/Parser/Micro/ShadowParser.cs b/src/AngleSharp.Css/Parser/Micro/ShadowParser.cs index 2d5d4932..8aab19bc 100644 --- a/src/AngleSharp.Css/Parser/Micro/ShadowParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/ShadowParser.cs @@ -4,8 +4,14 @@ namespace AngleSharp.Css.Parser using AngleSharp.Css.Values; using AngleSharp.Text; - static class ShadowParser + /// + /// Represents extensions to for shadow values. + /// + public static class ShadowParser { + /// + /// Parses the CSS shadow value. + /// public static CssShadowValue ParseShadow(this StringSource source) { var start = source.Index; diff --git a/src/AngleSharp.Css/Parser/Micro/ShapeParser.cs b/src/AngleSharp.Css/Parser/Micro/ShapeParser.cs index abd539ab..10277f35 100644 --- a/src/AngleSharp.Css/Parser/Micro/ShapeParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/ShapeParser.cs @@ -4,8 +4,14 @@ namespace AngleSharp.Css.Parser using AngleSharp.Text; using System; - static class ShapeParser + /// + /// Represents extensions to for shape values. + /// + public static class ShapeParser { + /// + /// Parses the shape value. + /// public static CssShapeValue ParseShape(this StringSource source) { var pos = source.Index; diff --git a/src/AngleSharp.Css/Parser/Micro/StringParser.cs b/src/AngleSharp.Css/Parser/Micro/StringParser.cs index 5160dd36..9015f7f4 100644 --- a/src/AngleSharp.Css/Parser/Micro/StringParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/StringParser.cs @@ -3,10 +3,13 @@ namespace AngleSharp.Css.Parser using AngleSharp.Text; using System; - static class StringParser + /// + /// Represents extensions to for string values. + /// + public static class StringParser { /// - /// Represents a string object. + /// Parses a string object. /// https://developer.mozilla.org/en-US/docs/Web/CSS/string /// public static String ParseString(this StringSource source) diff --git a/src/AngleSharp.Css/Parser/Micro/TimingFunctionParser.cs b/src/AngleSharp.Css/Parser/Micro/TimingFunctionParser.cs index 70cb580e..013997bb 100644 --- a/src/AngleSharp.Css/Parser/Micro/TimingFunctionParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/TimingFunctionParser.cs @@ -5,7 +5,10 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class TimingFunctionParser + /// + /// Represents extensions to for timing values. + /// + public static class TimingFunctionParser { private static readonly Dictionary> TimingFunctions = new Dictionary>(StringComparer.OrdinalIgnoreCase) { @@ -13,6 +16,9 @@ static class TimingFunctionParser { FunctionNames.CubicBezier, ParseCubicBezier }, }; + /// + /// Parses the timing value. + /// public static ICssTimingFunctionValue ParseTimingFunction(this StringSource source) { var pos = source.Index; diff --git a/src/AngleSharp.Css/Parser/Micro/TransformParser.cs b/src/AngleSharp.Css/Parser/Micro/TransformParser.cs index a90d379b..ae3cbb5e 100644 --- a/src/AngleSharp.Css/Parser/Micro/TransformParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/TransformParser.cs @@ -6,7 +6,10 @@ namespace AngleSharp.Css.Parser using System; using System.Collections.Generic; - static class TransformParser + /// + /// Represents extensions to for transform values. + /// + public static class TransformParser { private static readonly Dictionary> TransformFunctions = new Dictionary>(StringComparer.OrdinalIgnoreCase) { @@ -33,6 +36,9 @@ static class TransformParser { FunctionNames.Perspective, ParsePerspective }, }; + /// + /// Parses a transform value. + /// public static ICssTransformFunctionValue ParseTransform(this StringSource source) { var pos = source.Index; diff --git a/src/AngleSharp.Css/Parser/Micro/UnitParser.cs b/src/AngleSharp.Css/Parser/Micro/UnitParser.cs index be0057ac..86079949 100644 --- a/src/AngleSharp.Css/Parser/Micro/UnitParser.cs +++ b/src/AngleSharp.Css/Parser/Micro/UnitParser.cs @@ -7,9 +7,12 @@ namespace AngleSharp.Css.Parser using System.Globalization; using System.Text; - static class UnitParser + /// + /// Represents extensions to for unit values. + /// + public static class UnitParser { - public static Unit ParseUnit(this StringSource source) + internal static Unit ParseUnit(this StringSource source) { var pos = source.Index; var result = UnitStart(source); @@ -22,6 +25,9 @@ public static Unit ParseUnit(this StringSource source) return result; } + /// + /// Parses an auto length value. + /// public static ICssValue ParseAutoLength(this StringSource source) { if (source.IsIdentifier(CssKeywords.Auto)) @@ -32,6 +38,9 @@ public static ICssValue ParseAutoLength(this StringSource source) return null; } + /// + /// Parses a length value. + /// public static Length? ParseNormalLength(this StringSource source) { if (source.IsIdentifier(CssKeywords.Normal)) @@ -42,20 +51,32 @@ public static ICssValue ParseAutoLength(this StringSource source) return null; } + /// + /// Parses a border width value. + /// public static ICssValue ParseBorderWidth(this StringSource source) => source.ParseLengthOrCalc() ?? source.ParsePercentOrNumber() ?? source.ParseAutoLength(); + /// + /// Parses a line width value. + /// public static ICssValue ParseLineWidth(this StringSource source) => source.ParseLengthOrCalc() ?? source.ParseConstant(Map.BorderWidths); + /// + /// Parses a line height value. + /// public static ICssValue ParseLineHeight(this StringSource source) => source.ParseLengthOrCalc() ?? source.ParsePercentOrNumber() ?? source.ParseNormalLength(); + /// + /// Parses a percent (double) value. + /// public static Double? ParsePercent(this StringSource source) { var pos = source.Index; @@ -71,6 +92,9 @@ public static ICssValue ParseLineHeight(this StringSource source) => return null; } + /// + /// Parses a percent or number value. + /// public static Length? ParsePercentOrNumber(this StringSource source) { var pos = source.Index; @@ -92,6 +116,9 @@ public static ICssValue ParseLineHeight(this StringSource source) => return null; } + /// + /// Parses an angle value. + /// public static Angle? ParseAngle(this StringSource source) { var pos = source.Index; @@ -113,9 +140,15 @@ public static ICssValue ParseLineHeight(this StringSource source) => return null; } + /// + /// Parses an angle or calc value. + /// public static ICssValue ParseAngleOrCalc(this StringSource source) => source.ParseAngle().OrCalc(source); + /// + /// Parses a frequency value. + /// public static Frequency? ParseFrequency(this StringSource source) { var pos = source.Index; @@ -137,10 +170,16 @@ public static ICssValue ParseAngleOrCalc(this StringSource source) => return null; } + /// + /// Parses a font size value. + /// public static ICssValue ParseFontSize(this StringSource source) => source.ParseDistanceOrCalc() ?? source.ParseConstant(Map.FontSizes); + /// + /// Parses a track breadth value. + /// public static ICssValue ParseTrackBreadth(this StringSource source, Boolean flexible = true) { var pos = source.Index; @@ -186,6 +225,9 @@ public static ICssValue ParseTrackBreadth(this StringSource source, Boolean flex return source.ParseCalc(); } + /// + /// Parses a distance value. + /// public static Length? ParseDistance(this StringSource source) { var pos = source.Index; @@ -200,9 +242,15 @@ public static ICssValue ParseTrackBreadth(this StringSource source, Boolean flex return length; } + /// + /// Parses a distance or calc value. + /// public static ICssValue ParseDistanceOrCalc(this StringSource source) => source.ParseDistance().OrCalc(source); + /// + /// Parses a length value. + /// public static Length? ParseLength(this StringSource source) { var pos = source.Index; @@ -218,9 +266,15 @@ public static ICssValue ParseDistanceOrCalc(this StringSource source) => return length; } + /// + /// Parses a length or calc value. + /// public static ICssValue ParseLengthOrCalc(this StringSource source) => source.ParseLength().OrCalc(source); + /// + /// Parses a resolution value. + /// public static Resolution? ParseResolution(this StringSource source) { var pos = source.Index; @@ -242,6 +296,9 @@ public static ICssValue ParseLengthOrCalc(this StringSource source) => return null; } + /// + /// Parses a time value. + /// public static Time? ParseTime(this StringSource source) { var pos = source.Index; @@ -263,10 +320,10 @@ public static ICssValue ParseLengthOrCalc(this StringSource source) => return null; } - public static ICssValue ParseTimeOrCalc(this StringSource source) - { - return source.ParseTime().OrCalc(source); - } + /// + /// Parses a time or calc value. + /// + public static ICssValue ParseTimeOrCalc(this StringSource source) => source.ParseTime().OrCalc(source); private static Length? GetLength(Unit test) { diff --git a/src/AngleSharp.Css/Parser/StringSourceExtensions.cs b/src/AngleSharp.Css/Parser/StringSourceExtensions.cs index c6bcfdc0..48ff2ff6 100644 --- a/src/AngleSharp.Css/Parser/StringSourceExtensions.cs +++ b/src/AngleSharp.Css/Parser/StringSourceExtensions.cs @@ -3,8 +3,14 @@ namespace AngleSharp.Css.Parser using AngleSharp.Text; using System; - static class StringSourceExtensions + /// + /// Extensions to simplify parsing efforts using a StringSource instance. + /// + public static class StringSourceExtensions { + /// + /// Gets the substring starting at the given string. + /// public static String Substring(this StringSource source, Int32 startIndex) { if (startIndex == 0 && source.IsDone) @@ -19,6 +25,10 @@ public static String Substring(this StringSource source, Int32 startIndex) return String.Empty; } + /// + /// Takes a string out until a round bracket is closed. + /// Considers newly opened round brackets to keep it balanced. + /// public static String TakeUntilClosed(this StringSource source) { var start = source.Index; @@ -73,6 +83,9 @@ public static String TakeUntilClosed(this StringSource source) return content; } + /// + /// Skips spaces and comments, as well as one non-space token that will be obtained. + /// public static Char SkipGetSkip(this StringSource source) { var c = source.SkipSpacesAndComments(); @@ -80,6 +93,9 @@ public static Char SkipGetSkip(this StringSource source) return c; } + /// + /// Skips all spaces and comments. + /// public static Char SkipSpacesAndComments(this StringSource source) { while (true) @@ -97,12 +113,18 @@ public static Char SkipSpacesAndComments(this StringSource source) } } + /// + /// Skips the current character, as well as spaces and comments. + /// public static Char SkipCurrentAndSpaces(this StringSource source) { source.Next(); return source.SkipSpacesAndComments(); } + /// + /// Goes back in the source until the given index is reached. + /// public static Char BackTo(this StringSource source, Int32 index) { var diff = source.Index - index; @@ -117,6 +139,9 @@ public static Char BackTo(this StringSource source, Int32 index) return current; } + /// + /// Goes forward in the source until the given index is reached. + /// public static Char NextTo(this StringSource source, Int32 index) { var diff = index - source.Index; diff --git a/src/AngleSharp.Css/Values/Composites/CssBackgroundSizeValue.cs b/src/AngleSharp.Css/Values/Composites/CssBackgroundSizeValue.cs index 74f187ae..5ad1aee2 100644 --- a/src/AngleSharp.Css/Values/Composites/CssBackgroundSizeValue.cs +++ b/src/AngleSharp.Css/Values/Composites/CssBackgroundSizeValue.cs @@ -6,7 +6,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS background size definition. /// - sealed class CssBackgroundSizeValue : IEquatable, ICssPrimitiveValue + public sealed class CssBackgroundSizeValue : IEquatable, ICssPrimitiveValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Composites/CssBorderImageSliceValue.cs b/src/AngleSharp.Css/Values/Composites/CssBorderImageSliceValue.cs index e270c3fb..de21a1ed 100644 --- a/src/AngleSharp.Css/Values/Composites/CssBorderImageSliceValue.cs +++ b/src/AngleSharp.Css/Values/Composites/CssBorderImageSliceValue.cs @@ -6,7 +6,7 @@ namespace AngleSharp.Css.Values /// /// Represents the CSS border image slice definition. /// - sealed class CssBorderImageSliceValue : ICssCompositeValue + public sealed class CssBorderImageSliceValue : ICssCompositeValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Composites/CssGradientStopValue.cs b/src/AngleSharp.Css/Values/Composites/CssGradientStopValue.cs index e29609ee..64bbc226 100644 --- a/src/AngleSharp.Css/Values/Composites/CssGradientStopValue.cs +++ b/src/AngleSharp.Css/Values/Composites/CssGradientStopValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// More information can be found at the W3C: /// http://dev.w3.org/csswg/css-images-3/#color-stop-syntax /// - sealed class CssGradientStopValue : ICssCompositeValue + public sealed class CssGradientStopValue : ICssCompositeValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Composites/CssImageRepeatsValue.cs b/src/AngleSharp.Css/Values/Composites/CssImageRepeatsValue.cs index 380bcd43..4ecba3eb 100644 --- a/src/AngleSharp.Css/Values/Composites/CssImageRepeatsValue.cs +++ b/src/AngleSharp.Css/Values/Composites/CssImageRepeatsValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS image repeat definition. /// - sealed class CssImageRepeatsValue : ICssCompositeValue + public sealed class CssImageRepeatsValue : ICssCompositeValue { private readonly ICssValue _horizontal; private readonly ICssValue _vertical; diff --git a/src/AngleSharp.Css/Values/Composites/CssOriginValue.cs b/src/AngleSharp.Css/Values/Composites/CssOriginValue.cs index 8cc1ed4d..49febc04 100644 --- a/src/AngleSharp.Css/Values/Composites/CssOriginValue.cs +++ b/src/AngleSharp.Css/Values/Composites/CssOriginValue.cs @@ -6,7 +6,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS origin definition. /// - sealed class CssOriginValue : ICssCompositeValue + public sealed class CssOriginValue : ICssCompositeValue { private readonly ICssValue _x; private readonly ICssValue _y; diff --git a/src/AngleSharp.Css/Values/Composites/CssShadowValue.cs b/src/AngleSharp.Css/Values/Composites/CssShadowValue.cs index 498cbc97..938928fa 100644 --- a/src/AngleSharp.Css/Values/Composites/CssShadowValue.cs +++ b/src/AngleSharp.Css/Values/Composites/CssShadowValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// /// The shadow class for holding information about a box or text-shadow. /// - sealed class CssShadowValue : ICssCompositeValue + public sealed class CssShadowValue : ICssCompositeValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssAttrValue.cs b/src/AngleSharp.Css/Values/Functions/CssAttrValue.cs index 9dc9cd67..2479d83b 100644 --- a/src/AngleSharp.Css/Values/Functions/CssAttrValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssAttrValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS attr function call. /// - sealed class CssAttrValue : ICssFunctionValue + public sealed class CssAttrValue : ICssFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssCalcValue.cs b/src/AngleSharp.Css/Values/Functions/CssCalcValue.cs index 3bacbd5a..66d6357a 100644 --- a/src/AngleSharp.Css/Values/Functions/CssCalcValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssCalcValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS calculated value. /// - sealed class CssCalcValue : ICssRawValue, ICssFunctionValue + public sealed class CssCalcValue : ICssRawValue, ICssFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssContentValue.cs b/src/AngleSharp.Css/Values/Functions/CssContentValue.cs index a90f869c..96b6ab2f 100644 --- a/src/AngleSharp.Css/Values/Functions/CssContentValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssContentValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS content function call. /// - sealed class CssContentValue : ICssFunctionValue + public sealed class CssContentValue : ICssFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssRadialGradientValue.cs b/src/AngleSharp.Css/Values/Functions/CssRadialGradientValue.cs index aae01af2..4bd969e4 100644 --- a/src/AngleSharp.Css/Values/Functions/CssRadialGradientValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssRadialGradientValue.cs @@ -11,7 +11,7 @@ namespace AngleSharp.Css.Values /// Represents a radial gradient: /// http://dev.w3.org/csswg/css-images-3/#radial-gradients /// - sealed class CssRadialGradientValue : ICssGradientFunctionValue + public sealed class CssRadialGradientValue : ICssGradientFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssRunningValue.cs b/src/AngleSharp.Css/Values/Functions/CssRunningValue.cs index 674fb67d..5cb15c39 100644 --- a/src/AngleSharp.Css/Values/Functions/CssRunningValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssRunningValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS running function call. /// - sealed class CssRunningValue : ICssFunctionValue + public sealed class CssRunningValue : ICssFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssShapeValue.cs b/src/AngleSharp.Css/Values/Functions/CssShapeValue.cs index 8ac45eee..9a903d10 100644 --- a/src/AngleSharp.Css/Values/Functions/CssShapeValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssShapeValue.cs @@ -9,7 +9,7 @@ namespace AngleSharp.Css.Values /// Represents a CSS shape. /// https://developer.mozilla.org/en-US/docs/Web/CSS/shape /// - sealed class CssShapeValue : ICssValue, ICssFunctionValue + public sealed class CssShapeValue : ICssValue, ICssFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssSkewValue.cs b/src/AngleSharp.Css/Values/Functions/CssSkewValue.cs index d287a646..7ec6bb0e 100644 --- a/src/AngleSharp.Css/Values/Functions/CssSkewValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssSkewValue.cs @@ -7,7 +7,7 @@ namespace AngleSharp.Css.Values /// /// Represents the skew transformation. /// - sealed class CssSkewValue : ICssTransformFunctionValue + public sealed class CssSkewValue : ICssTransformFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssUrlValue.cs b/src/AngleSharp.Css/Values/Functions/CssUrlValue.cs index 0fd2d32e..0166ab98 100644 --- a/src/AngleSharp.Css/Values/Functions/CssUrlValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssUrlValue.cs @@ -8,7 +8,7 @@ namespace AngleSharp.Css.Values /// Represents an URL object. /// https://developer.mozilla.org/en-US/docs/Web/CSS/uri /// - sealed class CssUrlValue : ICssImageValue, ICssFunctionValue + public sealed class CssUrlValue : ICssImageValue, ICssFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Functions/CssVarValue.cs b/src/AngleSharp.Css/Values/Functions/CssVarValue.cs index b71e014c..f10662f6 100644 --- a/src/AngleSharp.Css/Values/Functions/CssVarValue.cs +++ b/src/AngleSharp.Css/Values/Functions/CssVarValue.cs @@ -8,7 +8,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS var replacement. /// - sealed class CssVarValue : ICssFunctionValue + public sealed class CssVarValue : ICssFunctionValue { #region Fields diff --git a/src/AngleSharp.Css/Values/ICssGradientFunctionValue.cs b/src/AngleSharp.Css/Values/ICssGradientFunctionValue.cs index 2dd201bf..91cf0383 100644 --- a/src/AngleSharp.Css/Values/ICssGradientFunctionValue.cs +++ b/src/AngleSharp.Css/Values/ICssGradientFunctionValue.cs @@ -5,7 +5,7 @@ namespace AngleSharp.Css.Values /// /// The common interface for all CSS gradients. /// - interface ICssGradientFunctionValue : ICssImageValue + public interface ICssGradientFunctionValue : ICssImageValue { /// /// Gets an enumeration of all stops. diff --git a/src/AngleSharp.Css/Values/Multiples/CssTupleValue.cs b/src/AngleSharp.Css/Values/Multiples/CssTupleValue.cs index a5c0c3b2..ce23d3c3 100644 --- a/src/AngleSharp.Css/Values/Multiples/CssTupleValue.cs +++ b/src/AngleSharp.Css/Values/Multiples/CssTupleValue.cs @@ -69,10 +69,15 @@ IEnumerator IEnumerable.GetEnumerator() => /// /// Represents a tuple of CSS values. /// - sealed class CssTupleValue : CssTupleValue + public sealed class CssTupleValue : CssTupleValue { #region ctor - + + /// + /// Creates a new tuple instance. + /// + /// The items to contain. + /// The separator for display purposes. public CssTupleValue(ICssValue[] items = null, String separator = null) : base(items, separator) { diff --git a/src/AngleSharp.Css/Values/Primitives/Angle.cs b/src/AngleSharp.Css/Values/Primitives/Angle.cs index dbeb6c8e..246701de 100644 --- a/src/AngleSharp.Css/Values/Primitives/Angle.cs +++ b/src/AngleSharp.Css/Values/Primitives/Angle.cs @@ -6,7 +6,7 @@ namespace AngleSharp.Css.Values /// Represents an angle object. /// https://developer.mozilla.org/en-US/docs/Web/CSS/angle /// - struct Angle : IEquatable, IComparable, ICssPrimitiveValue + public struct Angle : IEquatable, IComparable, ICssPrimitiveValue { #region Basic angles diff --git a/src/AngleSharp.Css/Values/Primitives/Constant.cs b/src/AngleSharp.Css/Values/Primitives/Constant.cs index 74927b11..9f58e7ad 100644 --- a/src/AngleSharp.Css/Values/Primitives/Constant.cs +++ b/src/AngleSharp.Css/Values/Primitives/Constant.cs @@ -5,7 +5,7 @@ namespace AngleSharp.Css.Values /// /// Represents a selected CSS enum value. /// - struct Constant : ICssPrimitiveValue, IEquatable> + public struct Constant : ICssPrimitiveValue, IEquatable> { #region Fields diff --git a/src/AngleSharp.Css/Values/Primitives/CounterDefinition.cs b/src/AngleSharp.Css/Values/Primitives/CounterDefinition.cs index 65b65584..2be72db7 100644 --- a/src/AngleSharp.Css/Values/Primitives/CounterDefinition.cs +++ b/src/AngleSharp.Css/Values/Primitives/CounterDefinition.cs @@ -6,7 +6,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS counter. /// - struct CounterDefinition : ICssPrimitiveValue, IEquatable + public struct CounterDefinition : ICssPrimitiveValue, IEquatable { #region Fields diff --git a/src/AngleSharp.Css/Values/Primitives/Frequency.cs b/src/AngleSharp.Css/Values/Primitives/Frequency.cs index dc8ba3ac..f75b2067 100644 --- a/src/AngleSharp.Css/Values/Primitives/Frequency.cs +++ b/src/AngleSharp.Css/Values/Primitives/Frequency.cs @@ -5,7 +5,7 @@ namespace AngleSharp.Css.Values /// /// Represents a time value. /// - struct Frequency : IEquatable, IComparable, ICssPrimitiveValue + public struct Frequency : IEquatable, IComparable, ICssPrimitiveValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Primitives/Length.cs b/src/AngleSharp.Css/Values/Primitives/Length.cs index 317002ec..f60304f0 100644 --- a/src/AngleSharp.Css/Values/Primitives/Length.cs +++ b/src/AngleSharp.Css/Values/Primitives/Length.cs @@ -5,7 +5,7 @@ namespace AngleSharp.Css.Values /// /// Represents an absolute length value. /// - struct Length : IEquatable, IComparable, ICssPrimitiveValue + public struct Length : IEquatable, IComparable, ICssPrimitiveValue { #region Basic lengths diff --git a/src/AngleSharp.Css/Values/Primitives/LineNames.cs b/src/AngleSharp.Css/Values/Primitives/LineNames.cs index 5ea79f26..fad26e29 100644 --- a/src/AngleSharp.Css/Values/Primitives/LineNames.cs +++ b/src/AngleSharp.Css/Values/Primitives/LineNames.cs @@ -8,7 +8,7 @@ namespace AngleSharp.Css.Values /// /// Represents a CSS line names definition. /// - struct LineNames : ICssPrimitiveValue, IEquatable + public struct LineNames : ICssPrimitiveValue, IEquatable { #region Fields diff --git a/src/AngleSharp.Css/Values/Primitives/Point.cs b/src/AngleSharp.Css/Values/Primitives/Point.cs index 2afaf130..a496212d 100644 --- a/src/AngleSharp.Css/Values/Primitives/Point.cs +++ b/src/AngleSharp.Css/Values/Primitives/Point.cs @@ -6,7 +6,7 @@ namespace AngleSharp.Css.Values /// /// Represents a point value consisting of two distances. /// - struct Point : IEquatable, ICssPrimitiveValue + public struct Point : IEquatable, ICssPrimitiveValue { #region Basic values diff --git a/src/AngleSharp.Css/Values/Primitives/Resolution.cs b/src/AngleSharp.Css/Values/Primitives/Resolution.cs index 0f55bb21..a701762f 100644 --- a/src/AngleSharp.Css/Values/Primitives/Resolution.cs +++ b/src/AngleSharp.Css/Values/Primitives/Resolution.cs @@ -5,7 +5,7 @@ namespace AngleSharp.Css.Values /// /// Represents a resolution value. /// - struct Resolution : IEquatable, IComparable, ICssPrimitiveValue + public struct Resolution : IEquatable, IComparable, ICssPrimitiveValue { #region Fields diff --git a/src/AngleSharp.Css/Values/Primitives/Time.cs b/src/AngleSharp.Css/Values/Primitives/Time.cs index 078c1992..873f1ee1 100644 --- a/src/AngleSharp.Css/Values/Primitives/Time.cs +++ b/src/AngleSharp.Css/Values/Primitives/Time.cs @@ -5,7 +5,7 @@ namespace AngleSharp.Css.Values /// /// Represents a time value. /// - struct Time : IEquatable