This repository has been archived by the owner on Feb 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #784 - allow complex content for HTML
The logic that binds event handlers was interfering with the code that prevents component properties from receiving complex content. This check was a little overzealous.
- Loading branch information
Showing
10 changed files
with
275 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...Build.Test/TestFiles/DesignTimeCodeGenerationTest/Regression_784/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line hidden | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Blazor; | ||
using Microsoft.AspNetCore.Blazor.Components; | ||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent | ||
{ | ||
#pragma warning disable 219 | ||
private void __RazorDirectiveTokenHelpers__() { | ||
} | ||
#pragma warning restore 219 | ||
#pragma warning disable 0414 | ||
private static System.Object __o = null; | ||
#pragma warning restore 0414 | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder) | ||
{ | ||
base.BuildRenderTree(builder); | ||
__o = Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue<Microsoft.AspNetCore.Blazor.UIMouseEventArgs>(OnComponentHover); | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
__o = ParentBgColor; | ||
|
||
#line default | ||
#line hidden | ||
} | ||
#pragma warning restore 1998 | ||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
|
||
public string ParentBgColor { get; set; } = "#FFFFFF"; | ||
|
||
public void OnComponentHover(UIMouseEventArgs e) | ||
{ | ||
} | ||
|
||
#line default | ||
#line hidden | ||
} | ||
} | ||
#pragma warning restore 1591 |
40 changes: 40 additions & 0 deletions
40
...zor.Build.Test/TestFiles/DesignTimeCodeGenerationTest/Regression_784/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [12] ) - System | ||
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic | ||
UsingDirective - (53:3,1 [17] ) - System.Linq | ||
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks | ||
UsingDirective - (104:5,1 [33] ) - Microsoft.AspNetCore.Blazor | ||
UsingDirective - (140:6,1 [44] ) - Microsoft.AspNetCore.Blazor.Components | ||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent - | ||
DesignTimeDirective - | ||
DirectiveToken - (14:0,14 [32] ) - "*, Microsoft.AspNetCore.Blazor" | ||
DirectiveToken - (14:0,14 [9] ) - "*, Test" | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning disable 0414 | ||
CSharpCode - | ||
IntermediateToken - - CSharp - private static System.Object __o = null; | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning restore 0414 | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
CSharpCode - | ||
IntermediateToken - - CSharp - base.BuildRenderTree(builder); | ||
HtmlElement - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - p | ||
HtmlAttribute - (16:0,16 [17] x:\dir\subdir\Test\TestComponent.cshtml) - onmouseover=" - " | ||
CSharpExpressionAttributeValue - - | ||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue<Microsoft.AspNetCore.Blazor.UIMouseEventArgs>( | ||
IntermediateToken - (17:0,17 [16] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - OnComponentHover | ||
IntermediateToken - - CSharp - ) | ||
HtmlAttribute - - style=" - " | ||
HtmlAttributeValue - (42:0,42 [11] x:\dir\subdir\Test\TestComponent.cshtml) - | ||
IntermediateToken - (42:0,42 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Html - background: | ||
CSharpExpressionAttributeValue - (53:0,53 [15] x:\dir\subdir\Test\TestComponent.cshtml) - | ||
IntermediateToken - (55:0,55 [13] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentBgColor | ||
HtmlAttributeValue - (68:0,68 [1] x:\dir\subdir\Test\TestComponent.cshtml) - | ||
IntermediateToken - (68:0,68 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html - ; | ||
HtmlContent - (73:0,73 [2] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (73:0,73 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n | ||
HtmlContent - (220:7,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (220:7,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n | ||
CSharpCode - (87:1,12 [132] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (87:1,12 [132] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public string ParentBgColor { get; set; } = "#FFFFFF";\n\n public void OnComponentHover(UIMouseEventArgs e)\n {\n }\n |
27 changes: 27 additions & 0 deletions
27
...ild.Test/TestFiles/DesignTimeCodeGenerationTest/Regression_784/TestComponent.mappings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Source Location: (17:0,17 [16] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|OnComponentHover| | ||
Generated Location: (1005:24,136 [16] ) | ||
|OnComponentHover| | ||
|
||
Source Location: (55:0,55 [13] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|ParentBgColor| | ||
Generated Location: (1131:26,55 [13] ) | ||
|ParentBgColor| | ||
|
||
Source Location: (87:1,12 [132] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| | ||
public string ParentBgColor { get; set; } = "#FFFFFF"; | ||
|
||
public void OnComponentHover(UIMouseEventArgs e) | ||
{ | ||
} | ||
| | ||
Generated Location: (1290:33,12 [132] ) | ||
| | ||
public string ParentBgColor { get; set; } = "#FFFFFF"; | ||
|
||
public void OnComponentHover(UIMouseEventArgs e) | ||
{ | ||
} | ||
| | ||
|
36 changes: 36 additions & 0 deletions
36
...or.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_784/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line hidden | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Blazor; | ||
using Microsoft.AspNetCore.Blazor.Components; | ||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent | ||
{ | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder) | ||
{ | ||
base.BuildRenderTree(builder); | ||
builder.OpenElement(0, "p"); | ||
builder.AddAttribute(1, "onmouseover", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue<Microsoft.AspNetCore.Blazor.UIMouseEventArgs>(OnComponentHover)); | ||
builder.AddAttribute(2, "style", "background:" + " " + (ParentBgColor) + ";"); | ||
builder.CloseElement(); | ||
} | ||
#pragma warning restore 1998 | ||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
|
||
public string ParentBgColor { get; set; } = "#FFFFFF"; | ||
|
||
public void OnComponentHover(UIMouseEventArgs e) | ||
{ | ||
} | ||
|
||
#line default | ||
#line hidden | ||
} | ||
} | ||
#pragma warning restore 1591 |
27 changes: 27 additions & 0 deletions
27
...Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_784/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [14] ) - System | ||
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic | ||
UsingDirective - (53:3,1 [19] ) - System.Linq | ||
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks | ||
UsingDirective - (104:5,1 [35] ) - Microsoft.AspNetCore.Blazor | ||
UsingDirective - (140:6,1 [46] ) - Microsoft.AspNetCore.Blazor.Components | ||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent - | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
CSharpCode - | ||
IntermediateToken - - CSharp - base.BuildRenderTree(builder); | ||
HtmlElement - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - p | ||
HtmlAttribute - (16:0,16 [17] x:\dir\subdir\Test\TestComponent.cshtml) - onmouseover=" - " | ||
CSharpExpressionAttributeValue - - | ||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue<Microsoft.AspNetCore.Blazor.UIMouseEventArgs>( | ||
IntermediateToken - (17:0,17 [16] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - OnComponentHover | ||
IntermediateToken - - CSharp - ) | ||
HtmlAttribute - - style=" - " | ||
HtmlAttributeValue - (42:0,42 [11] x:\dir\subdir\Test\TestComponent.cshtml) - | ||
IntermediateToken - (42:0,42 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Html - background: | ||
CSharpExpressionAttributeValue - (53:0,53 [15] x:\dir\subdir\Test\TestComponent.cshtml) - | ||
IntermediateToken - (55:0,55 [13] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentBgColor | ||
HtmlAttributeValue - (68:0,68 [1] x:\dir\subdir\Test\TestComponent.cshtml) - | ||
IntermediateToken - (68:0,68 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html - ; | ||
CSharpCode - (87:1,12 [132] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (87:1,12 [132] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public string ParentBgColor { get; set; } = "#FFFFFF";\n\n public void OnComponentHover(UIMouseEventArgs e)\n {\n }\n |
17 changes: 17 additions & 0 deletions
17
....Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_784/TestComponent.mappings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Source Location: (87:1,12 [132] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| | ||
public string ParentBgColor { get; set; } = "#FFFFFF"; | ||
|
||
public void OnComponentHover(UIMouseEventArgs e) | ||
{ | ||
} | ||
| | ||
Generated Location: (1074:24,12 [132] ) | ||
| | ||
public string ParentBgColor { get; set; } = "#FFFFFF"; | ||
|
||
public void OnComponentHover(UIMouseEventArgs e) | ||
{ | ||
} | ||
| | ||
|