From 1a05359d122eb4b7938af8d13c2c46ed35934cec Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Tue, 4 Apr 2017 15:43:13 -0700 Subject: [PATCH] Reset writer scope for tag helpers inside template --- .../CodeGeneration/RuntimeTagHelperWriter.cs | 8 +- .../RuntimeTagHelperWriterTest.cs | 1 + .../CodeGenerationIntegrationTest.cs | 14 +++ .../TagHelpersWithTemplate.cshtml | 19 +++ ...gHelpersWithTemplate_DesignTime.codegen.cs | 61 +++++++++ .../TagHelpersWithTemplate_DesignTime.ir.txt | 53 ++++++++ ...elpersWithTemplate_DesignTime.mappings.txt | 47 +++++++ .../TagHelpersWithTemplate_Runtime.codegen.cs | 116 ++++++++++++++++++ .../TagHelpersWithTemplate_Runtime.ir.txt | 43 +++++++ 9 files changed, 360 insertions(+), 2 deletions(-) create mode 100644 test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml create mode 100644 test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs create mode 100644 test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt create mode 100644 test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt create mode 100644 test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs create mode 100644 test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/RuntimeTagHelperWriter.cs b/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/RuntimeTagHelperWriter.cs index 7981693d3e..cb5d222216 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/RuntimeTagHelperWriter.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/RuntimeTagHelperWriter.cs @@ -149,9 +149,13 @@ namespace Microsoft.AspNetCore.Razor.Evolution.CodeGeneration // This can be removed once all the tag helper nodes are moved out of the renderers. var initialRenderingConventions = context.RenderingConventions; context.RenderingConventions = new CSharpRenderingConventions(context.Writer); - using (context.Writer.BuildAsyncLambda(endLine: false)) + + using (context.Push(new RuntimeBasicWriter())) { - context.RenderChildren(node); + using (context.Writer.BuildAsyncLambda(endLine: false)) + { + context.RenderChildren(node); + } } context.RenderingConventions = initialRenderingConventions; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs index 918dbeda28..9ee12ad4c0 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs @@ -100,6 +100,7 @@ private global::MyTagHelper __MyTagHelper = null; var context = new CSharpRenderingContext() { Writer = new Legacy.CSharpCodeWriter(), + BasicWriter = new RuntimeBasicWriter(), IdGenerator = () => "test", RenderChildren = n => { } }; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs index 9604e3a959..eb4e289994 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs @@ -773,6 +773,13 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests // Arrange, Act & Assert RunRuntimeTagHelpersTest(TestTagHelperDescriptors.TagHelpersInSectionDescriptors); } + + [Fact] + public void TagHelpersWithTemplate_Runtime() + { + // Arrange, Act & Assert + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + } #endregion #region DesignTime @@ -1559,6 +1566,13 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests // Arrange, Act & Assert RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.EnumTagHelperDescriptors); } + + [Fact] + public void TagHelpersWithTemplate_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + } #endregion protected override RazorCodeDocument CreateCodeDocument() diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml new file mode 100644 index 0000000000..071122c261 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml @@ -0,0 +1,19 @@ +@addTagHelper "*, TestAssembly" + +@functions { + public void RenderTemplate(string title, Func template) + { + Output.WriteLine("

Rendering Template:

"); + var helperResult = template(title); + helperResult.WriteTo(Output, HtmlEncoder); + } +} + +
+ @{ + RenderTemplate( + "Template: ", + @

@item

); + } +
+ diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs new file mode 100644 index 0000000000..dc9d4b5a81 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs @@ -0,0 +1,61 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((System.Action)(() => { +System.Object __typeHelper = "*, TestAssembly"; + } + ))(); + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::DivTagHelper __DivTagHelper = null; + private global::InputTagHelper __InputTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { +#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + + RenderTemplate( + "Template: ", + + +#line default +#line hidden + item => new Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + __o = item; + +#line default +#line hidden + __InputTagHelper = CreateTagHelper(); + __DivTagHelper = CreateTagHelper(); + } + ) +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + ); + + +#line default +#line hidden + __DivTagHelper = CreateTagHelper(); + } + #pragma warning restore 1998 +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + + public void RenderTemplate(string title, Func template) + { + Output.WriteLine("

Rendering Template:

"); + var helperResult = template(title); + helperResult.WriteTo(Output, HtmlEncoder); + } + +#line default +#line hidden + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt new file mode 100644 index 0000000000..8899c51f09 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt @@ -0,0 +1,53 @@ +Document - + Checksum - + NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles + UsingStatement - - System + UsingStatement - - System.Threading.Tasks + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate_DesignTime - - + DirectiveTokenHelper - + CSharpStatement - + RazorIRToken - - CSharp - #pragma warning disable 219 + CSharpStatement - + RazorIRToken - - CSharp - private void __RazorDirectiveTokenHelpers__() { + DirectiveToken - (14:0,14 [17] TagHelpersWithTemplate.cshtml) - "*, TestAssembly" + CSharpStatement - + RazorIRToken - - CSharp - } + CSharpStatement - + RazorIRToken - - CSharp - #pragma warning restore 219 + CSharpStatement - + RazorIRToken - - CSharp - private static System.Object __o = null; + DeclareTagHelperFields - - DivTagHelper - InputTagHelper + RazorMethodDeclaration - - public - async - System.Threading.Tasks.Task - ExecuteAsync + HtmlContent - (31:0,31 [4] TagHelpersWithTemplate.cshtml) - \n\n + HtmlContent - (316:9,1 [4] TagHelpersWithTemplate.cshtml) - \n\n + TagHelper - (320:11,0 [179] TagHelpersWithTemplate.cshtml) + InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag + HtmlContent - (325:11,5 [6] TagHelpersWithTemplate.cshtml) - \n + CSharpStatement - (333:12,6 [66] TagHelpersWithTemplate.cshtml) + RazorIRToken - (333:12,6 [66] TagHelpersWithTemplate.cshtml) - CSharp - \n RenderTemplate(\n "Template: ",\n + Template - (400:15,13 [82] TagHelpersWithTemplate.cshtml) + TagHelper - (400:15,13 [82] TagHelpersWithTemplate.cshtml) + InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag + HtmlContent - (422:15,35 [4] TagHelpersWithTemplate.cshtml) -

+ CSharpExpression - (427:15,40 [4] TagHelpersWithTemplate.cshtml) + RazorIRToken - (427:15,40 [4] TagHelpersWithTemplate.cshtml) - CSharp - item + HtmlContent - (431:15,44 [5] TagHelpersWithTemplate.cshtml) -

+ TagHelper - (436:15,49 [40] TagHelpersWithTemplate.cshtml) + InitializeTagHelperStructure - - input - TagMode.SelfClosing + CreateTagHelper - - InputTagHelper + AddTagHelperHtmlAttribute - - type - HtmlAttributeValueStyle.DoubleQuotes + HtmlContent - (449:15,62 [8] TagHelpersWithTemplate.cshtml) - checkbox + AddTagHelperHtmlAttribute - - checked - HtmlAttributeValueStyle.DoubleQuotes + HtmlContent - (468:15,81 [4] TagHelpersWithTemplate.cshtml) - true + ExecuteTagHelpers - + CreateTagHelper - - DivTagHelper + AddTagHelperHtmlAttribute - - condition - HtmlAttributeValueStyle.DoubleQuotes + HtmlContent - (416:15,29 [4] TagHelpersWithTemplate.cshtml) - true + ExecuteTagHelpers - + CSharpStatement - (482:15,95 [8] TagHelpersWithTemplate.cshtml) + RazorIRToken - (482:15,95 [8] TagHelpersWithTemplate.cshtml) - CSharp - );\n + CreateTagHelper - - DivTagHelper + ExecuteTagHelpers - + HtmlContent - (499:17,6 [4] TagHelpersWithTemplate.cshtml) - \n\n + CSharpStatement - (47:2,12 [268] TagHelpersWithTemplate.cshtml) + RazorIRToken - (47:2,12 [268] TagHelpersWithTemplate.cshtml) - CSharp - \n public void RenderTemplate(string title, Func template)\n {\n Output.WriteLine("

Rendering Template:

");\n var helperResult = template(title);\n helperResult.WriteTo(Output, HtmlEncoder);\n }\n diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt new file mode 100644 index 0000000000..b7132a9d30 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt @@ -0,0 +1,47 @@ +Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) +|"*, TestAssembly"| +Generated Location: (423:10,29 [17] ) +|"*, TestAssembly"| + +Source Location: (333:12,6 [66] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) +| + RenderTemplate( + "Template: ", + | +Generated Location: (912:22,6 [66] ) +| + RenderTemplate( + "Template: ", + | + +Source Location: (427:15,40 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) +|item| +Generated Location: (1255:31,40 [4] ) +|item| + +Source Location: (482:15,95 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) +|); + | +Generated Location: (1671:40,95 [8] ) +|); + | + +Source Location: (47:2,12 [268] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) +| + public void RenderTemplate(string title, Func template) + { + Output.WriteLine("

Rendering Template:

"); + var helperResult = template(title); + helperResult.WriteTo(Output, HtmlEncoder); + } +| +Generated Location: (1942:49,12 [268] ) +| + public void RenderTemplate(string title, Func template) + { + Output.WriteLine("

Rendering Template:

"); + var helperResult = template(title); + helperResult.WriteTo(Output, HtmlEncoder); + } +| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs new file mode 100644 index 0000000000..db3bd05a4b --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs @@ -0,0 +1,116 @@ +#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "f1ffadb1ad9c279ac40218b45a1688ac2f3ea857" +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate_Runtime + { + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", new global::Microsoft.AspNetCore.Html.HtmlString("checkbox"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("checked", new global::Microsoft.AspNetCore.Html.HtmlString("true"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); + private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("condition", new global::Microsoft.AspNetCore.Html.HtmlString("true"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); + #line hidden + #pragma warning disable 0414 + private string __tagHelperStringValueBuffer = null; + #pragma warning restore 0414 + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext = null; + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager + { + get + { + if (__backed__tagHelperScopeManager == null) + { + __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); + } + return __backed__tagHelperScopeManager; + } + } + private global::DivTagHelper __DivTagHelper = null; + private global::InputTagHelper __InputTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + WriteLiteral("\r\n"); + WriteLiteral("\r\n"); + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + WriteLiteral("\r\n"); +#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + + RenderTemplate( + "Template: ", + + +#line default +#line hidden + item => new Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + WriteLiteral("

"); +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + Write(item); + +#line default +#line hidden + WriteLiteral("

"); + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + } + ); + __InputTagHelper = CreateTagHelper(); + __tagHelperExecutionContext.Add(__InputTagHelper); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + if (!__tagHelperExecutionContext.Output.IsContentModified) + { + await __tagHelperExecutionContext.SetOutputContentAsync(); + } + Write(__tagHelperExecutionContext.Output); + __tagHelperExecutionContext = __tagHelperScopeManager.End(); + } + ); + __DivTagHelper = CreateTagHelper(); + __tagHelperExecutionContext.Add(__DivTagHelper); + __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + if (!__tagHelperExecutionContext.Output.IsContentModified) + { + await __tagHelperExecutionContext.SetOutputContentAsync(); + } + WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output); + __tagHelperExecutionContext = __tagHelperScopeManager.End(); + } + ) +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + ); + + +#line default +#line hidden + } + ); + __DivTagHelper = CreateTagHelper(); + __tagHelperExecutionContext.Add(__DivTagHelper); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + if (!__tagHelperExecutionContext.Output.IsContentModified) + { + await __tagHelperExecutionContext.SetOutputContentAsync(); + } + Write(__tagHelperExecutionContext.Output); + __tagHelperExecutionContext = __tagHelperScopeManager.End(); + WriteLiteral("\r\n\r\n"); + } + #pragma warning restore 1998 +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" + + public void RenderTemplate(string title, Func template) + { + Output.WriteLine("

Rendering Template:

"); + var helperResult = template(title); + helperResult.WriteTo(Output, HtmlEncoder); + } + +#line default +#line hidden + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt new file mode 100644 index 0000000000..868588abd0 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt @@ -0,0 +1,43 @@ +Document - + Checksum - + NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles + UsingStatement - - System + UsingStatement - - System.Threading.Tasks + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate_Runtime - - + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 - checked - true - HtmlAttributeValueStyle.DoubleQuotes + DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 - condition - true - HtmlAttributeValueStyle.DoubleQuotes + DeclareTagHelperFields - - DivTagHelper - InputTagHelper + RazorMethodDeclaration - - public - async - System.Threading.Tasks.Task - ExecuteAsync + HtmlContent - (33:1,0 [2] TagHelpersWithTemplate.cshtml) - \n + HtmlContent - (318:10,0 [2] TagHelpersWithTemplate.cshtml) - \n + TagHelper - (320:11,0 [179] TagHelpersWithTemplate.cshtml) + InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag + HtmlContent - (325:11,5 [2] TagHelpersWithTemplate.cshtml) - \n + CSharpStatement - (327:12,0 [4] TagHelpersWithTemplate.cshtml) + RazorIRToken - (327:12,0 [4] TagHelpersWithTemplate.cshtml) - CSharp - + CSharpStatement - (333:12,6 [66] TagHelpersWithTemplate.cshtml) + RazorIRToken - (333:12,6 [66] TagHelpersWithTemplate.cshtml) - CSharp - \n RenderTemplate(\n "Template: ",\n + Template - (400:15,13 [82] TagHelpersWithTemplate.cshtml) + TagHelper - (400:15,13 [82] TagHelpersWithTemplate.cshtml) + InitializeTagHelperStructure - - div - TagMode.StartTagAndEndTag + HtmlContent - (422:15,35 [4] TagHelpersWithTemplate.cshtml) -

+ CSharpExpression - (427:15,40 [4] TagHelpersWithTemplate.cshtml) + RazorIRToken - (427:15,40 [4] TagHelpersWithTemplate.cshtml) - CSharp - item + HtmlContent - (431:15,44 [5] TagHelpersWithTemplate.cshtml) -

+ TagHelper - (436:15,49 [40] TagHelpersWithTemplate.cshtml) + InitializeTagHelperStructure - - input - TagMode.SelfClosing + CreateTagHelper - - InputTagHelper + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_0 + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 + ExecuteTagHelpers - + CreateTagHelper - - DivTagHelper + AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 + ExecuteTagHelpers - + CSharpStatement - (482:15,95 [8] TagHelpersWithTemplate.cshtml) + RazorIRToken - (482:15,95 [8] TagHelpersWithTemplate.cshtml) - CSharp - );\n + CreateTagHelper - - DivTagHelper + ExecuteTagHelpers - + HtmlContent - (499:17,6 [4] TagHelpersWithTemplate.cshtml) - \n\n + CSharpStatement - (47:2,12 [268] TagHelpersWithTemplate.cshtml) + RazorIRToken - (47:2,12 [268] TagHelpersWithTemplate.cshtml) - CSharp - \n public void RenderTemplate(string title, Func template)\n {\n Output.WriteLine("

Rendering Template:

");\n var helperResult = template(title);\n helperResult.WriteTo(Output, HtmlEncoder);\n }\n