[csswg-drafts] [css-syntax] problem with consuming qualified rule (#3632)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax] problem with consuming qualified rule ==
(migrated from mailing list)

**Johannes Koch said:**

> 5.4.3. Consume a qualified rule
> 
> Create a new qualified rule with its prelude initially set to an empty 
> list, ...
> 
> When coming from 5.3.3.
> 
> 3. If the current input token is an `<EOF-token>`, return a syntax error.
>     ...
>     Otherwise, consume a qualified rule and let rule be the return
>     value. If nothing was returned, return a syntax error.
> 
> I think, in step 3. the current input token has to be reconsumed before 
> consuming a qualified rule.
> 
> Then my remark in my mail 'problem with consume list of rules':
>  > The same applies to 5.4.1
>  > anything else
>  >
>  > also reconsuming the current input token before consuming a qualified 
>  > rule.
> 
> does not apply, leavin only the problem with the at-keyword rule and the 
> puzzling CDO/CDC stuff.

---------------

**Tab Atkins said:**

> >> The same applies to 5.4.1
> >> anything else
> >>
> >> also reconsuming the current input token before consuming a qualified >
> >> rule.
> >
> > does not apply, leavin only the problem with the at-keyword rule
> 
> Fixed as part of my larger review, spurred by your earlier bug.
> 
> > and the
> > puzzling CDO/CDC stuff.
> 
> Legacy stuff.  Way back in the day, when CSS was first being
> implemented, legacy browsers didn't understand it and would just
> output a `<style>` as an unknown element filled with a bunch of text.
> JS already solved this in the `<script>` element by defining that <!--
> and --> were additional ways to write line-comments, identical to
> using //, so you could wrap your JS in them and legacy agents wouldn't
> display the contents (since they thought it was commented out).
> 
> CSS did the same thing, so <!-- and --> are just ignored when they
> show up at top-level between rules.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3632 using your GitHub account

Received on Thursday, 7 February 2019 23:42:56 UTC