Skip to content

Commit

Permalink
Merge pull request #54 from AngleSharp/devel
Browse files Browse the repository at this point in the history
Release 0.12.1
  • Loading branch information
FlorianRappl authored May 14, 2019
2 parents 08afe8c + 99973db commit c25fe98
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 94 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.12.1

Released on Wednesday, May 15 2019.

- Binary version fix

# 0.12.0

Released on Tuesday, May 14 2019.
Expand Down
4 changes: 2 additions & 2 deletions src/AngleSharp.Js.Tests/AngleSharp.Js.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AngleSharp.Css" Version="0.12.0" />
<PackageReference Include="AngleSharp.Xml" Version="0.12.0" />
<PackageReference Include="AngleSharp.Css" Version="0.12.1" />
<PackageReference Include="AngleSharp.Xml" Version="0.12.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/AngleSharp.Js.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<copyright>Copyright 2017-2019, AngleSharp</copyright>
<tags>html html5 css css3 dom javascript scripting library js scripts runtime jint anglesharp angle</tags>
<dependencies>
<dependency id="AngleSharp" version="0.10.0" />
<dependency id="Jint" version="3.0.0-beta-1353" />
<dependency id="AngleSharp" version="0.12.1" />
<dependency id="Jint" version="2.10.4" />
</dependencies>
</metadata>
</package>
2 changes: 1 addition & 1 deletion src/AngleSharp.Js/AngleSharp.Js.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AngleSharp" Version="0.12.0" />
<PackageReference Include="AngleSharp" Version="0.12.1" />
<PackageReference Include="Jint" Version="2.10.4" />
</ItemGroup>

Expand Down
12 changes: 0 additions & 12 deletions src/AngleSharp.Js/Attributes/DomEventAttribute.cs

This file was deleted.

29 changes: 0 additions & 29 deletions src/AngleSharp.Js/Attributes/DomInstanceAttribute.cs

This file was deleted.

10 changes: 2 additions & 8 deletions src/AngleSharp.Js/EngineInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,9 @@ public JsValue RunScript(String source, JsValue context)

#region Helpers

private DomNodeInstance CreateInstance(Object obj)
{
return new DomNodeInstance(this, obj);
}
private DomNodeInstance CreateInstance(Object obj) => new DomNodeInstance(this, obj);

private ObjectInstance CreatePrototype(Type type)
{
return new DomPrototypeInstance(this, type);
}
private ObjectInstance CreatePrototype(Type type) => new DomPrototypeInstance(this, type);

#endregion
}
Expand Down
24 changes: 8 additions & 16 deletions src/AngleSharp.Js/Extensions/ElementPseudoExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,71 +98,63 @@ public static class ElementPseudoExtensions
/// Adds the focus in event.
/// </summary>
[DomName("focusin")]
[DomEvent]
[DomAccessor(Accessors.Setter)]
[DomAccessor(Accessors.Adder)]
public static void AddFocusIn(this IElement element, DomEventHandler handler) =>
element.AddEventListener("focusin", handler);

/// <summary>
/// Removes the focus in event.
/// </summary>
[DomName("focusin")]
[DomEvent]
[DomAccessor(Accessors.Deleter)]
[DomAccessor(Accessors.Remover)]
public static void RemoveFocusIn(this IElement element, DomEventHandler handler) =>
element.RemoveEventListener("focusin", handler);

/// <summary>
/// Adds the focus out event.
/// </summary>
[DomName("focusout")]
[DomEvent]
[DomAccessor(Accessors.Setter)]
[DomAccessor(Accessors.Adder)]
public static void AddFocusOut(this IElement element, DomEventHandler handler) =>
element.AddEventListener("focusout", handler);

/// <summary>
/// Removes the focus out event.
/// </summary>
[DomName("focusout")]
[DomEvent]
[DomAccessor(Accessors.Deleter)]
[DomAccessor(Accessors.Remover)]
public static void RemoveFocusOut(this IElement element, DomEventHandler handler) =>
element.RemoveEventListener("focusout", handler);

/// <summary>
/// Adds the unload event.
/// </summary>
[DomName("unload")]
[DomEvent]
[DomAccessor(Accessors.Setter)]
[DomAccessor(Accessors.Adder)]
public static void AddUnload(this IElement element, DomEventHandler handler) =>
element.AddEventListener("unload", handler);

/// <summary>
/// Removes the unload event.
/// </summary>
[DomName("unload")]
[DomEvent]
[DomAccessor(Accessors.Deleter)]
[DomAccessor(Accessors.Remover)]
public static void RemoveUnload(this IElement element, DomEventHandler handler) =>
element.RemoveEventListener("unload", handler);

/// <summary>
/// Adds the contextmenu event.
/// </summary>
[DomName("contextmenu")]
[DomEvent]
[DomAccessor(Accessors.Setter)]
[DomAccessor(Accessors.Adder)]
public static void AddContextMenu(this IElement element, DomEventHandler handler) =>
element.AddEventListener("contextmenu", handler);

/// <summary>
/// Removes the contextmenu event.
/// </summary>
[DomName("contextmenu")]
[DomEvent]
[DomAccessor(Accessors.Deleter)]
[DomAccessor(Accessors.Remover)]
public static void RemoveContextMenu(this IElement element, DomEventHandler handler) =>
element.RemoveEventListener("contextmenu", handler);
}
Expand Down
36 changes: 13 additions & 23 deletions src/AngleSharp.Js/Extensions/Extensibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public static IDictionary<String, ExtensionEntry> GetExtensions(this IEnumerable
.Select(m => m.OfficialName);
var accessors = method.GetCustomAttributes<DomAccessorAttribute>()
.Select(m => m.Type);
var isEvent = method.GetCustomAttribute<DomEventAttribute>() != null;
var forward = method.GetCustomAttribute<DomPutForwardsAttribute>();

foreach (var name in names)
Expand All @@ -36,29 +35,20 @@ public static IDictionary<String, ExtensionEntry> GetExtensions(this IEnumerable
{
var accessor = accessors.FirstOrDefault();

if (isEvent)
switch (accessor)
{
switch (accessor)
{
case Accessors.Deleter:
entry.Remover = method;
break;
case Accessors.Setter:
entry.Adder = method;
break;
}
}
else
{
switch (accessor)
{
case Accessors.Setter:
entry.Setter = method;
break;
case Accessors.Getter:
entry.Getter = method;
break;
}
case Accessors.Setter:
entry.Setter = method;
break;
case Accessors.Getter:
entry.Getter = method;
break;
case Accessors.Remover:
entry.Remover = method;
break;
case Accessors.Adder:
entry.Adder = method;
break;
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<Description>Integrates a JavaScript engine to AngleSharp.</Description>
<Product>AngleSharp.Js</Product>
<Version>0.12.0</Version>
<Version>0.12.1</Version>
</PropertyGroup>
</Project>

0 comments on commit c25fe98

Please sign in to comment.