Skip to content

Commit 801aa30

Browse files
authored
Merge pull request #65 from AngleSharp/devel
Release 0.14.0
2 parents 25b30c3 + 61fb713 commit 801aa30

19 files changed

+171
-82
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.14.0
2+
3+
Released on Tuesday, March 31 2020.
4+
5+
- Fixed deadlock with some versions of jQuery (#63)
6+
- Enabled the instance creator factory (#11)
7+
- Return `IDocument` from `WaitUntilAvailable()` (#61)
8+
19
# 0.13.0
210

311
Released on Friday, September 6 2019.

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ AngleSharp.Js contains code written by (in order of first pull request / commit)
77
* [Florian Rappl](https://github.com/FlorianRappl)
88
* [Georgios Diamantopoulos](https://github.com/georgiosd)
99
* [miroslav22](https://github.com/miroslav22)
10+
* [doominator42](https://github.com/doominator42)
1011

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

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ This project is supported by the [.NET Foundation](https://dotnetfoundation.org)
8383

8484
The MIT License (MIT)
8585

86-
Copyright (c) 2015 - 2019 AngleSharp
86+
Copyright (c) 2015 - 2020 AngleSharp
8787

8888
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:
8989

build.cake

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ var solutionName = "AngleSharp.Js";
44
var frameworks = new Dictionary<String, String>
55
{
66
{ "net46", "net46" },
7+
{ "net461", "net461" },
8+
{ "net472", "net472" },
79
{ "netstandard1.3", "netstandard1.3" },
810
{ "netstandard2.0", "netstandard2.0" },
911
};

src/AngleSharp.Js.Tests/AngleSharp.Js.Tests.csproj

+8-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="AngleSharp.Css" Version="0.13.0" />
19-
<PackageReference Include="AngleSharp.Xml" Version="0.13.0" />
20-
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
21-
<PackageReference Include="NUnit" Version="3.11.0" />
22-
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
18+
<PackageReference Include="AngleSharp.Css" Version="0.14.0-alpha-139" />
19+
<PackageReference Include="AngleSharp.Xml" Version="0.14.0" />
20+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
21+
<PackageReference Include="NUnit" Version="3.12.0" />
22+
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
23+
<PrivateAssets>all</PrivateAssets>
24+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25+
</PackageReference>
2326
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
2427
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
2528
</ItemGroup>

src/AngleSharp.Js.Tests/ComponentTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ComponentTests
1212
private static async Task<String> RunScriptComponent(String script)
1313
{
1414
var service = new JsScriptingService();
15-
var cfg = Configuration.Default.WithXml().With(service);
15+
var cfg = Configuration.Default.WithXml().WithEventLoop().With(service);
1616
var html = String.Concat("<!doctype html><script>", script, "</script>");
1717
var document = await BrowsingContext.New(cfg).OpenAsync(m => m.Content(html));
1818
var value = service.GetOrCreateJint(document).GetValue("assert");

src/AngleSharp.Js.Tests/FireEventTests.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class FireEventTests
1313
public async Task InvokeFunctionOnLoadEventShouldFireDelayed()
1414
{
1515
var service = new JsScriptingService();
16-
var cfg = Configuration.Default.With(service);
16+
var cfg = Configuration.Default.With(service).WithEventLoop();
1717
var html = "<!doctype html><div id=result></div><script>document.addEventListener('load', function () { document.querySelector('#result').textContent = 'done'; }, false);</script>";
1818
var document = await BrowsingContext.New(cfg).OpenAsync(m => m.Content(html))
1919
.WhenStable();
@@ -25,7 +25,7 @@ public async Task InvokeFunctionOnLoadEventShouldFireDelayed()
2525
public async Task InvokeFunctionOnCustomEvent()
2626
{
2727
var service = new JsScriptingService();
28-
var cfg = Configuration.Default.With(service);
28+
var cfg = Configuration.Default.With(service).WithEventLoop();
2929
var html = "<!doctype html><div id=result>0</div><script>var i = 0; document.addEventListener('hello', function () { i++; document.querySelector('#result').textContent = i.toString(); }, false);</script>";
3030
var document = await BrowsingContext.New(cfg).OpenAsync(m => m.Content(html));
3131
var div = document.QuerySelector("#result");
@@ -39,7 +39,7 @@ public async Task InvokeFunctionOnCustomEvent()
3939
public async Task InvokeLoadEventFromJsAndCustomEventFromJsAndCs()
4040
{
4141
var service = new JsScriptingService();
42-
var cfg = Configuration.Default.With(service);
42+
var cfg = Configuration.Default.With(service).WithEventLoop();
4343
var html = @"<!doctype html>
4444
<html>
4545
<body>
@@ -73,7 +73,7 @@ public async Task InvokeLoadEventFromJsAndCustomEventFromJsAndCs()
7373
public async Task AddClickHandlerClassicallyWillExecute()
7474
{
7575
var service = new JsScriptingService();
76-
var cfg = Configuration.Default.With(service);
76+
var cfg = Configuration.Default.With(service).WithEventLoop();
7777
var html = @"<!doctype html>
7878
<html>
7979
<body>
@@ -94,7 +94,7 @@ public async Task AddClickHandlerClassicallyWillExecute()
9494
public async Task AddAndRemoveClickHandlerWontExecute()
9595
{
9696
var service = new JsScriptingService();
97-
var cfg = Configuration.Default.With(service);
97+
var cfg = Configuration.Default.With(service).WithEventLoop();
9898
var html = @"<!doctype html>
9999
<html>
100100
<body>
@@ -116,7 +116,7 @@ public async Task AddAndRemoveClickHandlerWontExecute()
116116
public async Task AddAndInvokeClickHandlerWillChangeCapturedValue()
117117
{
118118
var service = new JsScriptingService();
119-
var cfg = Configuration.Default.With(service);
119+
var cfg = Configuration.Default.With(service).WithEventLoop();
120120
var html = @"<!doctype html>
121121
<html>
122122
<body>
@@ -137,7 +137,7 @@ public async Task AddAndInvokeClickHandlerWillChangeCapturedValue()
137137
public async Task AddAndInvokeClickHandlerWithStringFunctionWontWork()
138138
{
139139
var service = new JsScriptingService();
140-
var cfg = Configuration.Default.With(service);
140+
var cfg = Configuration.Default.With(service).WithEventLoop();
141141
var html = @"<!doctype html>
142142
<html>
143143
<body>
@@ -155,7 +155,7 @@ public async Task AddAndInvokeClickHandlerWithStringFunctionWontWork()
155155
[Test]
156156
public async Task BodyOnloadWorksWhenSetAsAttributeInitially()
157157
{
158-
var cfg = Configuration.Default.WithJs();
158+
var cfg = Configuration.Default.WithJs().WithEventLoop();
159159
var html = @"<!doctype html>
160160
<html>
161161
<body onload='window.foo = 2+3'>
@@ -173,7 +173,7 @@ public async Task BodyOnloadWorksWhenSetAsAttributeInitially()
173173
[Test]
174174
public async Task BodyOnloadWorksWhenSetAsAttributeLater()
175175
{
176-
var cfg = Configuration.Default.WithJs();
176+
var cfg = Configuration.Default.WithJs().WithEventLoop();
177177
var html = @"<!doctype html>
178178
<html>
179179
<body>
@@ -192,7 +192,7 @@ public async Task BodyOnloadWorksWhenSetAsAttributeLater()
192192
public async Task SetTimeoutWithNormalFunction()
193193
{
194194
var service = new JsScriptingService();
195-
var cfg = Configuration.Default.With(service);
195+
var cfg = Configuration.Default.With(service).WithEventLoop();
196196
var html = @"<!doctype html>
197197
<html>
198198
<body>
@@ -214,7 +214,7 @@ public async Task DomContentLoadedEventIsFired_Issue50()
214214
{
215215
//TODO Check this as well on the window level - currently works
216216
//only against document (se AngleSharp#789)
217-
var cfg = Configuration.Default.WithJs();
217+
var cfg = Configuration.Default.WithJs().WithEventLoop();
218218
var html = @"<!doctype html>
219219
<html>
220220
<body>
@@ -236,7 +236,7 @@ public async Task DomContentLoadedEventIsFired_Issue50()
236236
[Test]
237237
public async Task DocumentLoadEventIsFired_Issue42()
238238
{
239-
var cfg = Configuration.Default.WithJs();
239+
var cfg = Configuration.Default.WithJs().WithEventLoop();
240240
var html = @"<!doctype html>
241241
<html>
242242
<body>
@@ -260,7 +260,7 @@ public async Task DocumentLoadEventIsFired_Issue42()
260260
public async Task SetTimeoutWithStringAsFunction()
261261
{
262262
var service = new JsScriptingService();
263-
var cfg = Configuration.Default.With(service);
263+
var cfg = Configuration.Default.With(service).WithEventLoop();
264264
var html = @"<!doctype html>
265265
<html>
266266
<body>

src/AngleSharp.Js.Tests/Helpers.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static class Helpers
1414
public static async Task<String> EvalScriptAsync(this String source)
1515
{
1616
var console = new ConsoleLogger();
17-
var cfg = Configuration.Default.WithJs().WithConsoleLogger(context => console);
17+
var cfg = Configuration.Default.WithJs().WithEventLoop().WithConsoleLogger(context => console);
1818
var html = $"<!doctype html><script>console.log({source})</script>";
1919
await BrowsingContext.New(cfg).OpenAsync(m => m.Content(html));
2020
return console.Content.ToString().Trim();
@@ -23,6 +23,7 @@ public static async Task<String> EvalScriptAsync(this String source)
2323
internal static IConfiguration GetCssConfig() =>
2424
Configuration.Default
2525
.WithJs()
26+
.WithEventLoop()
2627
.WithCss()
2728
.WithRenderDevice();
2829

src/AngleSharp.Js.Tests/JavascriptErrorTests.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public class JavascriptErrorTests
1010
public async Task JavascriptErrorInListenerShouldNotThrowJavascriptException()
1111
{
1212
var config = Configuration.Default
13-
.WithJs();
13+
.WithJs()
14+
.WithEventLoop();
1415

1516
var context = BrowsingContext.New(config);
1617

@@ -50,7 +51,8 @@ public async Task CanComputeAndHoistLocalVariablesInForLoop()
5051
return ret;
5152
})('abc').length";
5253
var config = Configuration.Default
53-
.WithJs();
54+
.WithJs()
55+
.WithEventLoop();
5456
var document = await BrowsingContext.New(config).OpenNewAsync();
5557
var result = document.ExecuteScript(source);
5658
Assert.AreEqual(0.0, result);

src/AngleSharp.Js.Tests/JqueryTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public async Task JqueryWithAjaxToDelayedResponse()
6565
{
6666
var message = "Hi!";
6767
var req = new DelayedRequester(10, message);
68-
var cfg = Configuration.Default.WithJs().With(req).WithDefaultLoader();
68+
var cfg = Configuration.Default.WithJs().WithEventLoop().With(req).WithDefaultLoader();
6969
var sources = new [] { Constants.Jquery2_1_4, @"
7070
$.ajax('http://example.com/', {
7171
success: function (data, status, xhr) {

src/AngleSharp.Js.Tests/ScriptEvalTests.cs

+8-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ScriptEvalTests
1414
{
1515
public static async Task<String> EvaluateComplexScriptAsync(params String[] sources)
1616
{
17-
var cfg = Configuration.Default.WithJs();
17+
var cfg = Configuration.Default.WithJs().WithEventLoop();
1818
var scripts = "<script>" + String.Join("</script><script>", sources) + "</script>";
1919
var html = "<!doctype html><div id=result></div>" + scripts;
2020
var document = await BrowsingContext.New(cfg).OpenAsync(m => m.Content(html));
@@ -79,7 +79,7 @@ public async Task CreateXmlHttpRequestShouldWork()
7979
public async Task PerformXmlHttpRequestSynchronousToDataUrlShouldWork()
8080
{
8181
var req = new DataRequester();
82-
var cfg = Configuration.Default.With(req).WithJs().WithDefaultLoader();
82+
var cfg = Configuration.Default.With(req).WithJs().WithEventLoop().WithDefaultLoader();
8383
var script = "var xhr = new XMLHttpRequest(); xhr.open('GET', 'data:plain/text,Hello World!', false);xhr.send();document.querySelector('#result').textContent = xhr.responseText;";
8484
var html = "<!doctype html><div id=result></div><script>" + script + "</script>";
8585
var document = await BrowsingContext.New(cfg).OpenAsync(m => m.Content(html));
@@ -92,7 +92,7 @@ public async Task PerformXmlHttpRequestSynchronousToDelayedResponseShouldWork()
9292
{
9393
var message = "Hi!";
9494
var req = new DelayedRequester(10, message);
95-
var cfg = Configuration.Default.WithJs().With(req).WithDefaultLoader();
95+
var cfg = Configuration.Default.WithJs().WithEventLoop().With(req).WithDefaultLoader();
9696
var script = @"
9797
var xhr = new XMLHttpRequest();
9898
xhr.open('GET', 'http://example.com/', false);
@@ -109,7 +109,7 @@ public async Task PerformXmlHttpRequestAsynchronousToDelayedResponseShouldWork()
109109
{
110110
var message = "Hi!";
111111
var req = new DelayedRequester(10, message);
112-
var cfg = Configuration.Default.WithJs().With(req).WithDefaultLoader();
112+
var cfg = Configuration.Default.WithJs().WithEventLoop().With(req).WithDefaultLoader();
113113
var script = @"
114114
var xhr = new XMLHttpRequest();
115115
xhr.open('GET', 'http://example.com/');
@@ -131,9 +131,10 @@ public async Task PerformXmlHttpRequestAsynchronousToDelayedResponseShouldWork()
131131
[Test]
132132
public async Task SetContentOfIFrameElement()
133133
{
134-
var cfg = Configuration.Default.
135-
WithDefaultLoader(new LoaderOptions { IsResourceLoadingEnabled = true }).
136-
WithJs();
134+
var cfg = Configuration.Default
135+
.WithDefaultLoader(new LoaderOptions { IsResourceLoadingEnabled = true })
136+
.WithJs()
137+
.WithEventLoop();
137138
var html = @"<!doctype html><iframe id=myframe srcdoc=''></iframe><script>
138139
var iframe = document.querySelector('#myframe');
139140
var doc = iframe.contentWindow.document;

src/AngleSharp.Js.nuspec

+13-5
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,28 @@
1111
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1212
<description>Integrates a JavaScript engine to AngleSharp.</description>
1313
<releaseNotes>https://github.com/AngleSharp/AngleSharp.Js/blob/master/CHANGELOG.md</releaseNotes>
14-
<copyright>Copyright 2017-2019, AngleSharp</copyright>
14+
<copyright>Copyright 2017-2020, AngleSharp</copyright>
1515
<tags>html html5 css css3 dom javascript scripting library js scripts runtime jint anglesharp angle</tags>
1616
<dependencies>
1717
<group targetFramework="netstandard1.3">
18-
<dependency id="AngleSharp" version="0.13.0" />
18+
<dependency id="AngleSharp" version="0.14.0" />
1919
<dependency id="Jint" version="2.10.4" />
20-
<dependency id="System.Threading.Thread" version="4.0.0" />
20+
<dependency id="System.Threading.Thread" version="4.3.0" />
2121
</group>
2222
<group targetFramework="netstandard2.0">
23-
<dependency id="AngleSharp" version="0.13.0" />
23+
<dependency id="AngleSharp" version="0.14.0" />
2424
<dependency id="Jint" version="2.10.4" />
2525
</group>
2626
<group targetFramework="net46">
27-
<dependency id="AngleSharp" version="0.13.0" />
27+
<dependency id="AngleSharp" version="0.14.0" />
28+
<dependency id="Jint" version="2.10.4" />
29+
</group>
30+
<group targetFramework="net461">
31+
<dependency id="AngleSharp" version="0.14.0" />
32+
<dependency id="Jint" version="2.10.4" />
33+
</group>
34+
<group targetFramework="net472">
35+
<dependency id="AngleSharp" version="0.14.0" />
2836
<dependency id="Jint" version="2.10.4" />
2937
</group>
3038
</dependencies>

src/AngleSharp.Js/AngleSharp.Js.csproj

+13-3
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,30 @@
33
<AssemblyName>AngleSharp.Js</AssemblyName>
44
<RootNamespace>AngleSharp.Js</RootNamespace>
55
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.3;netstandard2.0</TargetFrameworks>
6-
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">netstandard1.3;netstandard2.0;net46</TargetFrameworks>
6+
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">netstandard1.3;netstandard2.0;net46;net461;net472</TargetFrameworks>
77
<SignAssembly>true</SignAssembly>
88
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
<LangVersion>7.1</LangVersion>
11+
<RepositoryUrl>https://github.com/AngleSharp/AngleSharp.Js</RepositoryUrl>
12+
<RepositoryType>git</RepositoryType>
13+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
14+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
15+
<IncludeSymbols>true</IncludeSymbols>
16+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1117
</PropertyGroup>
1218

1319
<ItemGroup>
14-
<PackageReference Include="AngleSharp" Version="0.13.0" />
20+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<PackageReference Include="AngleSharp" Version="0.14.0" />
1525
<PackageReference Include="Jint" Version="2.10.4" />
1626
</ItemGroup>
1727

1828
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
19-
<PackageReference Include="System.Threading.Thread" Version="4.0.0" />
29+
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
2030
</ItemGroup>
2131

2232
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">

0 commit comments

Comments
 (0)