Fixed stroke-width without unit #18
This commit is contained in:
Родитель
847d59a3bd
Коммит
54ac3a8276
|
@ -6,6 +6,7 @@ Released on Thursday, May 5 2019.
|
|||
- Fixed empty value when removing properties (#14)
|
||||
- Returns `null` in `GetStyle` if CSS not configured (#15)
|
||||
- Added `pointer-events` and fixed border recombination (#16)
|
||||
- Fixed `stroke-width` value without unit (#18)
|
||||
- Fixed exception when not providing an `IRenderDevice` (#20)
|
||||
- Fixed missing `CssStylingService.Default` in cascade (#21)
|
||||
- Added extension helper `SetStyle` to modify all styles of many elements (#22)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace AngleSharp.Css.Tests.Declarations
|
||||
namespace AngleSharp.Css.Tests.Declarations
|
||||
{
|
||||
using NUnit.Framework;
|
||||
using static CssConstructionFunctions;
|
||||
|
@ -370,5 +370,17 @@
|
|||
Assert.IsFalse(property.IsInherited);
|
||||
Assert.IsFalse(property.HasValue);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CssStrokeWithoutUnit_Issue18()
|
||||
{
|
||||
var snippet = "stroke-width: 3";
|
||||
var property = ParseDeclaration(snippet);
|
||||
Assert.AreEqual("stroke-width", property.Name);
|
||||
Assert.IsFalse(property.IsImportant);
|
||||
Assert.IsFalse(property.IsInherited);
|
||||
Assert.IsTrue(property.HasValue);
|
||||
Assert.AreEqual("3", property.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,10 @@ namespace AngleSharp.Css.Declarations
|
|||
{
|
||||
public static String Name = PropertyNames.StrokeWidth;
|
||||
|
||||
public static IValueConverter Converter = LengthOrPercentConverter;
|
||||
public static IValueConverter Converter = Or(
|
||||
LengthOrPercentConverter,
|
||||
NumberConverter);
|
||||
|
||||
public static PropertyFlags Flags = PropertyFlags.Animatable;
|
||||
public static PropertyFlags Flags = PropertyFlags.Unitless | PropertyFlags.Animatable;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче