Skip to content

[css-syntax] problem with consuming qualified rule #3632

Closed
@tabatkins

Description

@tabatkins

(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.

  1. 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 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 are just ignored when they
show up at top-level between rules.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions