From 78bfb5cb1cc72164e73cf7919501fa22ba05445d Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Mon, 26 Nov 2012 12:36:46 +0200 Subject: Keep block order when unnesting (#10309) Change-Id: I5a7e6b74a55176799e85c943a128d9aab0db0876 --- theme-compiler/tests/resources/css/nesting.css | 8 ++++++++ theme-compiler/tests/resources/scss/nesting.scss | 12 ++++++++++++ .../tests/src/com/vaadin/sass/testcases/scss/Nesting.java | 4 +++- 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'theme-compiler/tests') diff --git a/theme-compiler/tests/resources/css/nesting.css b/theme-compiler/tests/resources/css/nesting.css index b3861a0131..e1cdf3a579 100644 --- a/theme-compiler/tests/resources/css/nesting.css +++ b/theme-compiler/tests/resources/css/nesting.css @@ -44,4 +44,12 @@ .main .second.third .fourth { color: black; +} + +.root .first-block .nested { + order: first; +} + +.root .last-block { + order: last; } \ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/nesting.scss b/theme-compiler/tests/resources/scss/nesting.scss index 0336c9e86d..1fefe0dde0 100644 --- a/theme-compiler/tests/resources/scss/nesting.scss +++ b/theme-compiler/tests/resources/scss/nesting.scss @@ -37,4 +37,16 @@ color: black; } } +} + +.root { + .first-block { + .nested { + order: first; + } + } + + .last-block { + order: last; + } } \ No newline at end of file diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Nesting.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Nesting.java index 109182f608..bdc6e63391 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Nesting.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Nesting.java @@ -42,7 +42,7 @@ public class Nesting extends AbstractTestBase { parser.setDocumentHandler(handler); parser.parseStyleSheet(getClass().getResource(scss).getPath()); ScssStylesheet root = handler.getStyleSheet(); - Assert.assertEquals(5, root.getChildren().size()); + Assert.assertEquals(6, root.getChildren().size()); BlockNode blockNode0 = (BlockNode) root.getChildren().get(0); Assert.assertEquals(2, blockNode0.getChildren().size()); @@ -78,6 +78,8 @@ public class Nesting extends AbstractTestBase { BlockNode nestednestedBlockInBlock4 = (BlockNode) nestedBlockInBlock3 .getChildren().get(1); Assert.assertEquals(1, nestednestedBlockInBlock4.getChildren().size()); + + // the parsing of the last block is not checked in detail } @Test -- cgit v1.2.3