Skip to content

Commit 275b0f4

Browse files
committed
Fixed border-style #34
1 parent 3b64972 commit 275b0f4

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Added `GetMatchingStyles` extension for `ICssRuleList`
77
- Added `MinifyStyleFormatter`
88
- Added `Prettify` and `Minify` extension methods
9+
- Fixed border-style expansion order (#34)
910

1011
# 0.12.1
1112

src/AngleSharp.Css.Tests/Declarations/CssBorderProperty.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace AngleSharp.Css.Tests.Declarations
55
{
6+
using AngleSharp.Dom;
67
using NUnit.Framework;
78
using static CssConstructionFunctions;
89

@@ -244,6 +245,22 @@ public void CssBorderStyleHiddenDottedNoneNoneLegal()
244245
Assert.AreEqual("hidden dotted none none", property.Value);
245246
}
246247

248+
[Test]
249+
public void CssBorderStyleMultipleExpandCorrectly_Issue34()
250+
{
251+
var source = @"<!DOCTYPE html>
252+
<html>
253+
<head><title></title></head>
254+
<body style=""border-style: hidden double dashed;""></body>
255+
</html>";
256+
var document = source.ToHtmlDocument(Configuration.Default.WithCss());
257+
var styleDeclaration = document.Body.ComputeCurrentStyle();
258+
Assert.AreEqual("hidden", styleDeclaration.GetBorderTopStyle());
259+
Assert.AreEqual("double", styleDeclaration.GetBorderLeftStyle());
260+
Assert.AreEqual("double", styleDeclaration.GetBorderRightStyle());
261+
Assert.AreEqual("dashed", styleDeclaration.GetBorderBottomStyle());
262+
}
263+
247264
[Test]
248265
public void CssBorderStyleWavyIllegal()
249266
{

src/AngleSharp.Css/Declarations/BorderStyleDeclaration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ static class BorderStyleDeclaration
2121

2222
public static String[] Longhands = new[]
2323
{
24-
PropertyNames.BorderRightStyle,
2524
PropertyNames.BorderTopStyle,
25+
PropertyNames.BorderRightStyle,
2626
PropertyNames.BorderBottomStyle,
2727
PropertyNames.BorderLeftStyle,
2828
};

0 commit comments

Comments
 (0)