Skip to content

Commit 7a96a55

Browse files
committed
Added support for recent list-type
1 parent 240cee3 commit 7a96a55

Some content is hidden

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

42 files changed

+875
-181
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Released on tbd.
1515
- Added more CSSOM possibilities and helpers (#6)
1616
- Added parts of recent color spec update such as `rgb` with spaces (#131)
1717
- Added now Color L4 parsing with `hsl`, `hwb`, `lab`, `lch`, `oklab`, and `oklch`
18+
- Added support for recent CSS `list-type` values (#152)
1819

1920
# 0.17.0
2021

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013 - 2023 AngleSharp
3+
Copyright (c) 2013 - 2024 AngleSharp
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ This project is supported by the [.NET Foundation](https://dotnetfoundation.org)
9999

100100
The MIT License (MIT)
101101

102-
Copyright (c) 2016 - 2022 AngleSharp
102+
Copyright (c) 2016 - 2024 AngleSharp
103103

104104
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
105105

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

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace AngleSharp.Css.Tests.Declarations
1+
namespace AngleSharp.Css.Tests.Declarations
22
{
33
using NUnit.Framework;
44
using static CssConstructionFunctions;
@@ -125,14 +125,15 @@ public void CssListStyleTypeDecimalLeadingZeroLegal()
125125
}
126126

127127
[Test]
128-
public void CssListStyleTypeNumberIllegal()
128+
public void CssListStyleTypeSomeValueLegal()
129129
{
130130
var snippet = "list-style-type: number ";
131131
var property = ParseDeclaration(snippet);
132132
Assert.AreEqual("list-style-type", property.Name);
133133
Assert.IsFalse(property.IsImportant);
134-
Assert.IsTrue(property.IsInherited);
135-
Assert.IsFalse(property.HasValue);
134+
Assert.IsFalse(property.IsInherited);
135+
Assert.IsTrue(property.HasValue);
136+
Assert.AreEqual("number", property.Value);
136137
}
137138

138139
[Test]
@@ -277,5 +278,94 @@ public void CssCounterIncrementLegal()
277278
Assert.IsTrue(property.HasValue);
278279
Assert.AreEqual("chapter 1 section 2 page 1", property.Value);
279280
}
281+
282+
[Test]
283+
public void CssListStyleStringValue_Issue152()
284+
{
285+
var snippet = "list-style-type: \"-\"";
286+
var property = ParseDeclaration(snippet);
287+
Assert.AreEqual("list-style-type", property.Name);
288+
Assert.IsTrue(property.HasValue);
289+
Assert.AreEqual("\"-\"", property.Value);
290+
}
291+
292+
[Test]
293+
public void CssListStyleKannada_Issue152()
294+
{
295+
var snippet = "list-style-type: kannada";
296+
var property = ParseDeclaration(snippet);
297+
Assert.AreEqual("list-style-type", property.Name);
298+
Assert.IsTrue(property.HasValue);
299+
Assert.AreEqual("kannada", property.Value);
300+
}
301+
302+
[Test]
303+
public void CssListStyleTradChineseInformal_Issue152()
304+
{
305+
var snippet = "list-style-type: trad-chinese-informal;";
306+
var property = ParseDeclaration(snippet);
307+
Assert.AreEqual("list-style-type", property.Name);
308+
Assert.IsTrue(property.HasValue);
309+
Assert.AreEqual("trad-chinese-informal", property.Value);
310+
}
311+
312+
[Test]
313+
public void CssListStyleGeorgian_Issue152()
314+
{
315+
var snippet = "list-style-type: georgian";
316+
var property = ParseDeclaration(snippet);
317+
Assert.AreEqual("list-style-type", property.Name);
318+
Assert.IsTrue(property.HasValue);
319+
Assert.AreEqual("georgian", property.Value);
320+
}
321+
322+
[Test]
323+
public void CssListStyleDecimal_Issue152()
324+
{
325+
var snippet = "list-style-type: decimal";
326+
var property = ParseDeclaration(snippet);
327+
Assert.AreEqual("list-style-type", property.Name);
328+
Assert.IsTrue(property.HasValue);
329+
Assert.AreEqual("decimal", property.Value);
330+
}
331+
332+
[Test]
333+
public void CssListStyleSquare_Issue152()
334+
{
335+
var snippet = "list-style-type: square";
336+
var property = ParseDeclaration(snippet);
337+
Assert.AreEqual("list-style-type", property.Name);
338+
Assert.IsTrue(property.HasValue);
339+
Assert.AreEqual("square", property.Value);
340+
}
341+
342+
[Test]
343+
public void CssListStyleCircle_Issue152()
344+
{
345+
var snippet = "list-style-type: circle";
346+
var property = ParseDeclaration(snippet);
347+
Assert.AreEqual("list-style-type", property.Name);
348+
Assert.IsTrue(property.HasValue);
349+
Assert.AreEqual("circle", property.Value);
350+
}
351+
352+
[Test]
353+
public void CssListStyleSymbolsFunction_Issue152()
354+
{
355+
var snippet = "list-style-type: symbols(cyclic \"*\" \"\" \"\")";
356+
var property = ParseDeclaration(snippet);
357+
Assert.AreEqual("list-style-type", property.Name);
358+
Assert.IsTrue(property.HasValue);
359+
Assert.AreEqual("symbols(cyclic \"*\" \"\" \"\")", property.Value);
360+
}
361+
362+
[Test]
363+
public void CssListStyleSymbolsFailingForWrongType_Issue152()
364+
{
365+
var snippet = "list-style-type: symbols(foo \"*\" \"\" \"\")";
366+
var property = ParseDeclaration(snippet);
367+
Assert.AreEqual("list-style-type", property.Name);
368+
Assert.IsFalse(property.HasValue);
369+
}
280370
}
281371
}

src/AngleSharp.Css.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>Extends the CSSOM from the core AngleSharp library.</description>
1414
<releaseNotes>https://github.com/AngleSharp/AngleSharp.Css/blob/main/CHANGELOG.md</releaseNotes>
15-
<copyright>Copyright 2016-2023, AngleSharp</copyright>
15+
<copyright>Copyright 2016-2024, AngleSharp</copyright>
1616
<tags>html html5 css css3 dom styling library anglesharp angle</tags>
1717
<dependencies>
1818
<dependency id="AngleSharp" version="[1.0.0,2.0.0)" />

0 commit comments

Comments
 (0)