Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@page and @left-middle crashes the parser #210

Open
edi9999 opened this issue Oct 10, 2023 · 1 comment
Open

@page and @left-middle crashes the parser #210

edi9999 opened this issue Oct 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@edi9999
Copy link

edi9999 commented Oct 10, 2023

Expected Behaviour

@page {
    @left-middle {
        margin: 0;
    }
}

should parse without an error

Actual Behaviour

It throws the following :

input.css:29:5: @page missing '}'

  77 |
  78 |   function error(msg: string) {
> 79 |     const err = new CssParseError(
     |                 ^
  80 |       options?.source || '',
  81 |       msg,
  82 |       lineno,

  at error (src/parse/index.ts:79:17)
  at atpage (src/parse/index.ts:562:14)
  at atrule (src/parse/index.ts:693:7)
  at rules (src/parse/index.ts:134:59)
  at stylesheet (src/parse/index.ts:98:23)
  at parse (src/parse/index.ts:720:20)
  at parseInput (test/cases.test.ts:39:19)
  at Object.<anonymous> (test/cases.test.ts:31:36)

Reproduce Scenario (including but not limited to)

Apply following git patch :

diff --git a/test/cases/media/input.css b/test/cases/media/input.css
index 8ab3a73..fa567e0 100644
--- a/test/cases/media/input.css
+++ b/test/cases/media/input.css
@@ -24,3 +24,9 @@
     border: 0.5pt solid #666;
   }
 }
+
+@page {
+    @left-middle {
+        margin: 0;
+    }
+}

Steps to Reproduce

Run npm test in the css-tools repository

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

@holblin holblin added the enhancement New feature or request label Oct 18, 2023
@jogibear9988
Copy link

they are not yet supported in any browser.
For me it's also not clear how they will be represented in the CSS Object Model.
Is the order of them relevant? can they appeaer everywhere inside of @page or only at the start or the end? (If they could anywhere we need to store the order)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants