From 1719a318ad2004e33dc77f952e6f2263815cb6c7 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 8 Jan 2018 21:56:30 -0500 Subject: [PATCH 1/5] failing test for #1082 --- .../runtime/samples/script-style-non-top-level/_config.js | 8 ++++++++ test/runtime/samples/script-style-non-top-level/main.html | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 test/runtime/samples/script-style-non-top-level/_config.js create mode 100644 test/runtime/samples/script-style-non-top-level/main.html diff --git a/test/runtime/samples/script-style-non-top-level/_config.js b/test/runtime/samples/script-style-non-top-level/_config.js new file mode 100644 index 0000000000..1aade72239 --- /dev/null +++ b/test/runtime/samples/script-style-non-top-level/_config.js @@ -0,0 +1,8 @@ +export default { + html: ` +
+ + +
+ ` +}; \ No newline at end of file diff --git a/test/runtime/samples/script-style-non-top-level/main.html b/test/runtime/samples/script-style-non-top-level/main.html new file mode 100644 index 0000000000..94cf72e4bd --- /dev/null +++ b/test/runtime/samples/script-style-non-top-level/main.html @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file From 5d0f44ef4153737f6d8e81bb9996e9c0a747ffa6 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 8 Feb 2018 14:14:21 -0500 Subject: [PATCH 2/5] rework handling of non-root ', true); + element.end = parser.index; + } else if (name === 'style') { + // special case + element.children = readSequence( + parser, + () => + parser.template.slice(parser.index, parser.index + 8) === '' + ); + parser.read(/<\/style>/); element.end = parser.index; } else { parser.stack.push(element); From cf3705dc11f4cddf6104236b9dd0c9d02d06f4e9 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 8 Feb 2018 14:18:39 -0500 Subject: [PATCH 3/5] add test --- .../non-root-style-interpolation/_config.js | 28 +++++++++++++++++++ .../non-root-style-interpolation/main.html | 20 +++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 test/runtime/samples/non-root-style-interpolation/_config.js create mode 100644 test/runtime/samples/non-root-style-interpolation/main.html diff --git a/test/runtime/samples/non-root-style-interpolation/_config.js b/test/runtime/samples/non-root-style-interpolation/_config.js new file mode 100644 index 0000000000..a5d963e897 --- /dev/null +++ b/test/runtime/samples/non-root-style-interpolation/_config.js @@ -0,0 +1,28 @@ +export default { + data: { + color: 'red', + }, + + html: ` +
+ + foo +
+ +
+
+ + foo +
+
+ `, +}; diff --git a/test/runtime/samples/non-root-style-interpolation/main.html b/test/runtime/samples/non-root-style-interpolation/main.html new file mode 100644 index 0000000000..107c5e89ae --- /dev/null +++ b/test/runtime/samples/non-root-style-interpolation/main.html @@ -0,0 +1,20 @@ +
+ + foo +
+ +
+
+ + foo +
+
From fc2ecce4ef7d31bd570fe4be1285fd55dd85af46 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 8 Feb 2018 14:29:38 -0500 Subject: [PATCH 4/5] make test more robust --- .../non-root-style-interpolation/_config.js | 21 +++++++++++++++++++ .../non-root-style-interpolation/main.html | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/test/runtime/samples/non-root-style-interpolation/_config.js b/test/runtime/samples/non-root-style-interpolation/_config.js index a5d963e897..3585e61f0b 100644 --- a/test/runtime/samples/non-root-style-interpolation/_config.js +++ b/test/runtime/samples/non-root-style-interpolation/_config.js @@ -14,6 +14,27 @@ export default { foo +
+
+ + foo +
+
+ +
+ + foo +
+
+ foo +
+
+ +
+ + foo +
+