Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0.0 #157

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
2a2f5da
Empty string behaves like null
FlorianRappl Feb 16, 2023
8ecae08
Update ColorParser.cs
jogibear9988 Apr 20, 2023
49b4877
Merge pull request #141 from jogibear9988/patch-1
FlorianRappl Apr 20, 2023
6ab7166
WIP
FlorianRappl Jun 6, 2023
c8321b8
Working on new media list parser
FlorianRappl Jun 10, 2023
3b89d01
Fixed serialization due to broken longhands #129
FlorianRappl Jun 14, 2023
b9aef4c
Fixed appending eof character #123
FlorianRappl Jun 14, 2023
6905fa5
Fixed missing semicolon separator #135
FlorianRappl Jun 14, 2023
1f3d718
Fixed keyframe stop truncation #128
FlorianRappl Jun 14, 2023
12f61a1
Fixed grid and grid-gap ordering #137
FlorianRappl Jun 14, 2023
ad7aff4
Improved CSS minification of grid #89
FlorianRappl Jun 14, 2023
78740fe
Added more tests for background-size
FlorianRappl Jun 14, 2023
6d52e79
Updated media parsing #133
FlorianRappl Jun 15, 2023
10845f2
Added test to verify fix for #133
FlorianRappl Jun 15, 2023
314805d
Added test to validate #140
FlorianRappl Jun 15, 2023
9fe8a86
Added 8-digit hex color #132
FlorianRappl Jun 15, 2023
50d8e9d
WIP #136
FlorianRappl Jun 15, 2023
15cb522
Validate that #126 can be done
FlorianRappl Jun 16, 2023
c9bc34e
Added rgb function syntax L4 #131
FlorianRappl Jun 18, 2023
4ceb46c
Prepare for more color functions
FlorianRappl Jun 18, 2023
649beb7
Added implementation of new color functions #131
FlorianRappl Jun 18, 2023
240cee3
Update Directory.Build.props
FlorianRappl Dec 15, 2023
7a96a55
Added support for recent list-type
FlorianRappl Jan 16, 2024
dba9069
Fixed text align behavior
FlorianRappl Jan 16, 2024
6ab4a63
Improved rule prios
FlorianRappl Jan 16, 2024
0c3aa78
Fix for GetInnerText #155
FlorianRappl Jan 16, 2024
c39af8a
Working on CSS nesting
FlorianRappl Jan 17, 2024
bf4db74
Allow disabling of nesting
FlorianRappl Jan 17, 2024
06b15e3
Updated nested implementation #148
FlorianRappl Jan 17, 2024
e97935a
Added margin and padding decls
FlorianRappl Jan 17, 2024
a5bcabf
Improved render tree
FlorianRappl Jan 17, 2024
baca67a
Improved computation #136
FlorianRappl Jan 17, 2024
1c9efd4
Prepared computation model
FlorianRappl Jan 18, 2024
8295892
Implemented CSS variable resolution #62
FlorianRappl Jan 18, 2024
9abdd1b
Added new metric values
FlorianRappl Jan 18, 2024
ed2b542
Activated disabled test
FlorianRappl Jan 18, 2024
64df5cf
Refactored naming to be consistent
FlorianRappl Jan 18, 2024
e8dab26
Refactored value model names
FlorianRappl Jan 18, 2024
2a44071
Extended model for css integer
FlorianRappl Jan 19, 2024
d856b31
Integrate percentage
FlorianRappl Jan 19, 2024
8205cf8
Added extra API method for computing style
FlorianRappl Jan 19, 2024
caab82a
Added test for new API
FlorianRappl Jan 19, 2024
c51cd43
Use latest version of AngleSharp
FlorianRappl Jan 19, 2024
973d83c
Prepare docs update
FlorianRappl Jan 19, 2024
b755de0
Updated CI/CD
FlorianRappl Jan 19, 2024
adba277
Updated CI/CD
FlorianRappl Feb 25, 2024
0652a66
Re-added dropped character
FlorianRappl Feb 25, 2024
333885b
Fix NullReferenceException in ChangeDeclarations
meziantou Feb 26, 2024
b36924d
review
meziantou Feb 26, 2024
46635ab
Fix nullable reference exception in CssOriginValue
meziantou Feb 26, 2024
c1c83ee
Merge pull request #160 from meziantou/fix-nre
FlorianRappl Feb 26, 2024
e68db8f
Update CssOriginValue.cs
meziantou Feb 26, 2024
102cc32
Merge pull request #162 from meziantou/nre-CssOriginValue
FlorianRappl Feb 26, 2024
dbf8aca
Uniformize CssValue.Equals implementation
meziantou Feb 26, 2024
151244d
Fix NullReferenceException in CssShadowValue
meziantou Feb 26, 2024
1d40f1c
Merge pull request #163 from meziantou/uniformize-cssvalue-comparison
FlorianRappl Feb 26, 2024
ff33ad7
Merge pull request #164 from meziantou/fix-nre-CssShadowValue
FlorianRappl Feb 26, 2024
4c9f16a
Get declarations
SebastianStehle Sep 19, 2024
459b48c
Merge pull request #176 from SebastianStehle/devel
FlorianRappl Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Bug Report
description: "Create a report to help us improve"
labels: ["bug"]
body:
- type: checkboxes
id: prerequisites
attributes:
label: Prerequisites
description: For more information, see the [CONTRIBUTING guide](https://github.com/AngleSharp/AngleSharp.Css/blob/devel/.github/CONTRIBUTING.md).
options:
- label: Can you reproduce the problem in a [MWE](https://en.wikipedia.org/wiki/Minimal_working_example)?
required: true
- label: Are you running the latest version of AngleSharp.Css?
required: true
- label: Did you check the FAQs to see if that helps you?
required: true
- label: Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., `AngleSharp.Xml` for Xml support)
required: true
- label: Did you perform a search in the issues?
required: true

- type: textarea
id: description
attributes:
label: Description
description: Share a clear and concise description of the problem.
placeholder: Description
validations:
required: true

- type: textarea
id: reproduction-steps
attributes:
label: Steps to Reproduce
description: |
Include minimal steps to reproduce the problem if possible. E.g.: the smallest possible code snippet; or a small project, with steps to run it. Make sure to include logs and exceptions as text rather than screenshots.
placeholder: Minimal Reproduction
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: |
Provide a description of the expected behavior.
placeholder: Expected Behavior
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual Behavior
description: |
Provide a description of the actual behavior observed. If applicable, include the error messages and the exception stacktrace.
placeholder: Actual Behavior
validations:
required: true

- type: textarea
id: known-workarounds
attributes:
label: Possible Solution / Known Workarounds
description: |
Provide a description of any possible solution or known workarounds.
placeholder: Possible Solution / Known Workarounds
validations:
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://anglesharp.github.io/
about: Read our comprehensive documentation
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Feature Idea
description: "Suggest an idea for this project"
labels: ["enhancement"]
body:
- type: textarea
attributes:
label: Description
description: What should the new feature do?
validations:
required: true

- type: textarea
attributes:
label: Background
description: Provide any additional background for the feature. e.g., user scenarios.

- type: textarea
attributes:
label: Specification
description: In case of updates that adhere to specification changes, please reference the used specification.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x

- name: Build
run: ./build.sh
Expand All @@ -72,6 +73,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x

- name: Build
run: |
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# 1.0.0

Released on Sunday, January 21 2024.

- Updated to use AngleSharp 1.0 (#150)
- Updated media parsing to media L4 spec (#133)
- Updated naming of CSS values (e.g., `Color` to `CssColorValue`)
- Fixed issue when updating shorthands with invalid values (#129)
- Fixed issue with appended EOF character in `CssText` (#123)
- Fixed missing semicolon in `@page` rule (#135)
- Fixed integer serialization of keyframe stops (#128)
- Fixed ordering of rows and columns in `grid` and `grid-gap` (#137)
- Fixed inclusion of CSS from stylesheets (#116, #140)
- Fixed style empty if `text-align` is `start` (#151)
- Fixed computation of priority in CSS rules using multi selector
- Fixed `GetInnerText` multi-line / text node behavior (#155) @Seyden
- Fixed computation of relative (`em`) values to absolute (`px`) for `Length` (#136)
- Added further compactification of CSS tuples (#89, #93)
- Added new value types `CssPercentageValue`, `CssNumberValue`, and `CssIntegerValue`
- Added support for CSS nesting in style rules (#148)
- Added resolution of CSS variable names (#62)
- Added support for 8-digit hex color codes (#132)
- Added support for `margin-block` and `margin-inline` declarations
- Added support for `padding-block` and `padding-inline` declarations
- Added more CSSOM possibilities and helpers (#6)
- Added parts of recent color spec update such as `rgb` with spaces (#131)
- Added now Color L4 parsing with `hsl`, `hwb`, `lab`, `lch`, `oklab`, and `oklch`
- Added support for recent CSS `list-type` values (#152)

# 0.17.0

Released on Sunday, January 15 2023.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ AngleSharp.Css contains code written by (in order of first pull request / commit
* [Bastian Buchholz](https://github.com/campersau)
* [Fraaankes](https://github.com/Fraaankes)
* [Eric Mutta](https://github.com/ericmutta)
* [Seyden](https://github.com/Seyden)
* [Dave Dunkin](https://github.com/ddunkin)

Without these awesome people AngleSharp.Css could not exist. Thanks to everyone for your contributions! :beers:

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013 - 2023 AngleSharp
Copyright (c) 2013 - 2024 AngleSharp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ This project is supported by the [.NET Foundation](https://dotnetfoundation.org)

The MIT License (MIT)

Copyright (c) 2016 - 2022 AngleSharp
Copyright (c) 2016 - 2024 AngleSharp

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:

Expand Down
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

We have more detailed information regarding the following subjects:

- [Getting Started](general/01-Basics.md)
- [Value Model](general/02-Values.md)
- [API Documentation](tutorials/01-API.md)
- [Examples](tutorials/02-Examples.md)
- [FAQ](tutorials/03-Questions.md)
4 changes: 2 additions & 2 deletions nuke/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ protected override void OnBuildInitialized()

if (ScheduledTargets.Contains(Default))
{
Version = $"{Version}-ci-{buildNumber}";
Version = $"{Version}-ci.{buildNumber}";
}
else if (ScheduledTargets.Contains(PrePublish))
{
Version = $"{Version}-alpha-{buildNumber}";
Version = $"{Version}-beta.{buildNumber}";
}
}

Expand Down
10 changes: 0 additions & 10 deletions nuke/ReleaseNotesParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
/// </remarks>
public sealed class ReleaseNotesParser
{
private readonly Regex _versionRegex;

/// <summary>
/// Initializes a new instance of the <see cref="ReleaseNotesParser"/> class.
/// </summary>
public ReleaseNotesParser()
{
_versionRegex = new Regex(@"(?<Version>\d+(\s*\.\s*\d+){0,3})(?<Release>-[a-z][0-9a-z-]*)?");
}

/// <summary>
/// Parses all release notes.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/AngleSharp.Css.Tests/AngleSharp.Css.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AngleSharp.Xml" Version="0.17.0" />
<PackageReference Include="AngleSharp.Xml" Version="1.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/AngleSharp.Css.Tests/CssConstructionFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace AngleSharp.Css.Tests
{
using AngleSharp.Css.Dom;
using AngleSharp.Css.Parser;
using AngleSharp.Css.Values;
using AngleSharp.Html.Dom;
using AngleSharp.Html.Parser;
using System;
Expand Down Expand Up @@ -70,7 +71,6 @@ internal static CssProperty ParseDeclaration(String source, CssParserOptions opt
internal static CssStyleDeclaration ParseDeclarations(String declarations)
{
var context = BrowsingContext.New(Configuration.Default.WithCss());
var parser = context.GetService<ICssParser>();
var style = new CssStyleDeclaration(context);
style.Update(declarations);
return style;
Expand All @@ -93,7 +93,7 @@ internal static CssImportRule ParseImportRule(String source)
internal static Predicate<IRenderDevice> CreateValidator(String name, String value)
{
var validator = CreateMediaFeatureValidator(name);
var feature = new MediaFeature(name, value);
var feature = new MediaFeature(name, new CssAnyValue(value));
return device => validator.Validate(feature, device);
}

Expand Down
24 changes: 24 additions & 0 deletions src/AngleSharp.Css.Tests/Declarations/CssBackgroundProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ namespace AngleSharp.Css.Tests.Declarations
[TestFixture]
public class CssBackgroundPropertyTests
{
[Test]
public void CssBackgroundSizeCoverTest()
{
var snippet = "background-size : cover";
var property = ParseDeclaration(snippet);
Assert.AreEqual("background-size", property.Name);
Assert.IsFalse(property.IsImportant);
Assert.IsFalse(property.IsInherited);
Assert.IsTrue(property.HasValue);
Assert.AreEqual("cover", property.Value);
}

[Test]
public void CssBackgroundSizeContainTest()
{
var snippet = "background-size : contain";
var property = ParseDeclaration(snippet);
Assert.AreEqual("background-size", property.Name);
Assert.IsFalse(property.IsImportant);
Assert.IsFalse(property.IsInherited);
Assert.IsTrue(property.HasValue);
Assert.AreEqual("contain", property.Value);
}

[Test]
public void CssBackgroundAttachmentScrollLegal()
{
Expand Down
18 changes: 17 additions & 1 deletion src/AngleSharp.Css.Tests/Declarations/CssGridProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ public void CssGridAreaTextValueLegal1()
var css = ParseStyleSheet(source);
var text = css.Rules[0].CssText;

var expected = "#nav-header { grid-area: aaa / aaa / aaa / aaa }";
var expected = "#nav-header { grid-area: aaa }";
Assert.AreEqual(expected, text);
}

Expand Down Expand Up @@ -909,5 +909,21 @@ public void CssGridTemplateLonghands_Issue68()
var style = ParseDeclarations(snippet);
Assert.AreEqual("grid-template: none", style.CssText);
}

[Test]
public void CssGridPreservesParts_Issue137()
{
var snippet = "grid: 10px / 80px";
var style = ParseDeclarations(snippet);
Assert.AreEqual("grid: 10px / 80px", style.CssText);
}

[Test]
public void CssGridGapPreservesParts_Issue137()
{
var snippet = "grid-gap: 10px 80px";
var style = ParseDeclarations(snippet);
Assert.AreEqual("grid-gap: 10px 80px", style.CssText);
}
}
}
Loading
Loading