Skip to content

Commit 1496823

Browse files
authored
Merge pull request #1225 from AngleSharp/devel
Release 1.3.0
2 parents 8d12af1 + 3a6e056 commit 1496823

34 files changed

+1294
-1085442
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ csharp_prefer_braces = true:suggestion
2020
csharp_using_directive_placement = inside_namespace:suggestion
2121
csharp_style_var_for_built_in_types=true:suggestion
2222
csharp_style_var_when_type_is_apparent=true:suggestion
23+
csharp_new_line_before_open_brace = all

.nuke/build.schema.json

Lines changed: 77 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,56 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"$ref": "#/definitions/build",
4-
"title": "Build Schema",
53
"definitions": {
6-
"build": {
7-
"type": "object",
4+
"Host": {
5+
"type": "string",
6+
"enum": [
7+
"AppVeyor",
8+
"AzurePipelines",
9+
"Bamboo",
10+
"Bitbucket",
11+
"Bitrise",
12+
"GitHubActions",
13+
"GitLab",
14+
"Jenkins",
15+
"Rider",
16+
"SpaceAutomation",
17+
"TeamCity",
18+
"Terminal",
19+
"TravisCI",
20+
"VisualStudio",
21+
"VSCode"
22+
]
23+
},
24+
"ExecutableTarget": {
25+
"type": "string",
26+
"enum": [
27+
"Clean",
28+
"Compile",
29+
"CopyFiles",
30+
"CreatePackage",
31+
"Default",
32+
"Package",
33+
"PrePublish",
34+
"Publish",
35+
"PublishPackage",
36+
"PublishPreRelease",
37+
"PublishRelease",
38+
"Restore",
39+
"RunUnitTests"
40+
]
41+
},
42+
"Verbosity": {
43+
"type": "string",
44+
"description": "",
45+
"enum": [
46+
"Verbose",
47+
"Normal",
48+
"Minimal",
49+
"Quiet"
50+
]
51+
},
52+
"NukeBuild": {
853
"properties": {
9-
"Configuration": {
10-
"type": "string",
11-
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
12-
"enum": [
13-
"Debug",
14-
"Release"
15-
]
16-
},
1754
"Continue": {
1855
"type": "boolean",
1956
"description": "Indicates to continue a previously failed build attempt"
@@ -23,25 +60,8 @@
2360
"description": "Shows the help text for this build assembly"
2461
},
2562
"Host": {
26-
"type": "string",
2763
"description": "Host for execution. Default is 'automatic'",
28-
"enum": [
29-
"AppVeyor",
30-
"AzurePipelines",
31-
"Bamboo",
32-
"Bitbucket",
33-
"Bitrise",
34-
"GitHubActions",
35-
"GitLab",
36-
"Jenkins",
37-
"Rider",
38-
"SpaceAutomation",
39-
"TeamCity",
40-
"Terminal",
41-
"TravisCI",
42-
"VisualStudio",
43-
"VSCode"
44-
]
64+
"$ref": "#/definitions/Host"
4565
},
4666
"NoLogo": {
4767
"type": "boolean",
@@ -62,10 +82,6 @@
6282
"type": "string"
6383
}
6484
},
65-
"ReleaseNotesFilePath": {
66-
"type": "string",
67-
"description": "ReleaseNotesFilePath - To determine the SemanticVersion"
68-
},
6985
"Root": {
7086
"type": "string",
7187
"description": "Root directory during build execution"
@@ -74,61 +90,46 @@
7490
"type": "array",
7591
"description": "List of targets to be skipped. Empty list skips all dependencies",
7692
"items": {
77-
"type": "string",
78-
"enum": [
79-
"Clean",
80-
"Compile",
81-
"CopyFiles",
82-
"CreatePackage",
83-
"Default",
84-
"Package",
85-
"PrePublish",
86-
"Publish",
87-
"PublishPackage",
88-
"PublishPreRelease",
89-
"PublishRelease",
90-
"Restore",
91-
"RunUnitTests"
92-
]
93+
"$ref": "#/definitions/ExecutableTarget"
9394
}
9495
},
95-
"Solution": {
96-
"type": "string",
97-
"description": "Path to a solution file that is automatically loaded"
98-
},
9996
"Target": {
10097
"type": "array",
10198
"description": "List of targets to be invoked. Default is '{default_target}'",
10299
"items": {
103-
"type": "string",
104-
"enum": [
105-
"Clean",
106-
"Compile",
107-
"CopyFiles",
108-
"CreatePackage",
109-
"Default",
110-
"Package",
111-
"PrePublish",
112-
"Publish",
113-
"PublishPackage",
114-
"PublishPreRelease",
115-
"PublishRelease",
116-
"Restore",
117-
"RunUnitTests"
118-
]
100+
"$ref": "#/definitions/ExecutableTarget"
119101
}
120102
},
121103
"Verbosity": {
122-
"type": "string",
123104
"description": "Logging verbosity during build execution. Default is 'Normal'",
105+
"$ref": "#/definitions/Verbosity"
106+
}
107+
}
108+
}
109+
},
110+
"allOf": [
111+
{
112+
"properties": {
113+
"Configuration": {
114+
"type": "string",
115+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
124116
"enum": [
125-
"Minimal",
126-
"Normal",
127-
"Quiet",
128-
"Verbose"
117+
"Debug",
118+
"Release"
129119
]
120+
},
121+
"ReleaseNotesFilePath": {
122+
"type": "string",
123+
"description": "ReleaseNotesFilePath - To determine the SemanticVersion"
124+
},
125+
"Solution": {
126+
"type": "string",
127+
"description": "Path to a solution file that is automatically loaded"
130128
}
131129
}
130+
},
131+
{
132+
"$ref": "#/definitions/NukeBuild"
132133
}
133-
}
134+
]
134135
}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# 1.3.0
2+
3+
Released on Friday, April 18 2025.
4+
5+
- Fixed DOM exposed type of `HasChildNodes` (#1219) @arekdygas
6+
- Fixed `NodeIterator` behavior when nodes are removed (#1222)
7+
- Improved form documentation (#1220) @RedZone908
8+
- Updated to NUKE 9 and removed obsolete .NET 6 and 9 targets (#1216) @lahma
9+
- Added `GetAttributeNode` methods to `IElement` (#1223) @arekdygas
10+
- Added support for finding targets in browsing contexts (#1218) @TheJayMann
11+
- Added support for targetting iframes (#1205) @TheJayMann
12+
113
# 1.2.0
214

315
Released on Tuesday, December 31 2024.

CONTRIBUTORS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ AngleSharp contains code written by (in order of first pull request / commit):
6161
* [noobow](https://github.com/noobow34)
6262
* [Martin Parkin](https://github.com/memiamp)
6363
* [Hakob Grigoryan](https://github.com/hflexgrig)
64+
* [TheJayMann](https://github.com/TheJayMann)
65+
* [arekdygas](https://github.com/arekdygas)
66+
* [RedZone908](https://github.com/RedZone908)
6467

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

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 - 2024 AngleSharp
3+
Copyright (c) 2013 - 2025 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

docs/tutorials/04-Forms.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ if (queryInput != null)
3030

3131
The latter version is much more verbose and requires additional checking on our side. The upside of this version is that we can also treat the error case (i.e., the expected field with the name `q` is not found or is not an `IHtmlInputElement`), which is completely ignored in the former version.
3232

33+
Some webpages will not handle the form submission correctly unless it is triggered from a specific control on the page. This can be done like:
34+
35+
``` cs
36+
// first research how to identify the submit element on the page you're working with, then...
37+
IHtmlInputElement submitButton = queryDocument.QuerySelection<IHtmlInputElement>("#submitbutton");
38+
IDocument resultDocument = await form.SubmitAsync(submitButton);
39+
```
40+
Note that the above scenario requires setting the form values via the more verbose mechanism.
41+
3342
An important aspect of submitting forms is that we require at least a default loader. Forms usually require making an HTTP request for loading a new document (mostly using the POST verb), which yields the demand for having a requester configured upfront. Note that sometimes forms even come with stronger requirements, especially if they are properly secured. In such cases the use of `WithCookies()` to configure a cookie container could be mandatory.
3443

3544
The code for using a cookie container looks almost identical:

docs/tutorials/06-Questions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ var input = document.QuerySelector<IHtmlInputElement>("input[type=file][name=myI
188188
input?.Files.Add(file);
189189
```
190190

191+
Depending on the webpage, you may also need to set `input.Value` to the name of the file, or alternatively set it in `SubmitAsync()`'s overload that accepts the form values. If your file-based form submission results in a `System.NullReferenceException` from `HtmlFormElement.SubmitAsync()`, that indicates that `input.Value` is what is missing.
192+
191193
In the previously used example the file variable refers to any IFile instance. AngleSharp is a PCL does not come with a proper implementation out of the box, however, a simple one may look like:
192194

193195
```cs

nuke/Build.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
using System.IO;
1616
using System.Linq;
1717
using Nuke.Common.Tooling;
18-
using static Nuke.Common.IO.FileSystemTasks;
19-
using static Nuke.Common.IO.PathConstruction;
18+
2019
using static Nuke.Common.Tools.DotNet.DotNetTasks;
2120
using static Nuke.Common.Tools.NuGet.NuGetTasks;
21+
2222
using Project = Nuke.Common.ProjectModel.Project;
2323

2424
class Build : NukeBuild
@@ -144,7 +144,7 @@ protected override void OnBuildInitialized()
144144
.EnableNoRestore()
145145
.EnableNoBuild()
146146
.SetProcessEnvironmentVariable("prefetched", "false")
147-
.When(GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions"))
147+
.When(_ => GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions"))
148148
);
149149

150150
DotNetTest(s => s
@@ -153,7 +153,7 @@ protected override void OnBuildInitialized()
153153
.EnableNoRestore()
154154
.EnableNoBuild()
155155
.SetProcessEnvironmentVariable("prefetched", "true")
156-
.When(GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions"))
156+
.When(_ => GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions"))
157157
);
158158
});
159159

@@ -166,14 +166,14 @@ protected override void OnBuildInitialized()
166166
var targetDir = NugetDirectory / "lib" / item;
167167
var srcDir = BuildDirectory / item;
168168

169-
CopyFile(srcDir / $"{TargetProjectName}.dll", targetDir / $"{TargetProjectName}.dll", FileExistsPolicy.OverwriteIfNewer);
170-
CopyFile(srcDir / $"{TargetProjectName}.pdb", targetDir / $"{TargetProjectName}.pdb", FileExistsPolicy.OverwriteIfNewer);
171-
CopyFile(srcDir / $"{TargetProjectName}.xml", targetDir / $"{TargetProjectName}.xml", FileExistsPolicy.OverwriteIfNewer);
169+
(srcDir / $"{TargetProjectName}.dll").Copy(targetDir / $"{TargetProjectName}.dll", policy: ExistsPolicy.FileOverwriteIfNewer);
170+
(srcDir / $"{TargetProjectName}.pdb").Copy(targetDir / $"{TargetProjectName}.pdb", policy: ExistsPolicy.FileOverwriteIfNewer);
171+
(srcDir / $"{TargetProjectName}.xml").Copy(targetDir / $"{TargetProjectName}.xml", policy: ExistsPolicy.FileOverwriteIfNewer);
172172
}
173173

174-
CopyFile(SourceDirectory / $"{TargetProjectName}.nuspec", NugetDirectory / $"{TargetProjectName}.nuspec", FileExistsPolicy.OverwriteIfNewer);
175-
CopyFile(RootDirectory / "logo.png", NugetDirectory / "logo.png", FileExistsPolicy.OverwriteIfNewer);
176-
CopyFile(RootDirectory / "README.md", NugetDirectory / "README.md", FileExistsPolicy.OverwriteIfNewer);
174+
(SourceDirectory / $"{TargetProjectName}.nuspec").Copy(NugetDirectory / $"{TargetProjectName}.nuspec", policy: ExistsPolicy.FileOverwriteIfNewer);
175+
(RootDirectory / "logo.png").Copy(NugetDirectory / "logo.png", policy: ExistsPolicy.FileOverwriteIfNewer);
176+
(RootDirectory / "README.md").Copy(NugetDirectory / "README.md", policy: ExistsPolicy.FileOverwriteIfNewer);
177177
});
178178

179179
Target CreatePackage => _ => _

nuke/_build.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="8.0.0" />
14+
<PackageReference Include="Nuke.Common" Version="9.0.4" />
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageDownload Include="NuGet.CommandLine" Version="[6.3.1]" />
18+
<PackageDownload Include="NuGet.CommandLine" Version="[6.12.2]" />
1919
</ItemGroup>
2020

2121
</Project>

src/AngleSharp.Benchmarks/AngleSharp.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFrameworks>net472;net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net8.0</TargetFrameworks>
55
<SignAssembly>false</SignAssembly>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

0 commit comments

Comments
 (0)