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

Expand step does not correct set is_root flag on blocks #1661

Closed
xzyfer opened this issue Oct 28, 2015 · 3 comments
Closed

Expand step does not correct set is_root flag on blocks #1661

xzyfer opened this issue Oct 28, 2015 · 3 comments

Comments

@xzyfer
Copy link
Contributor

xzyfer commented Oct 28, 2015

This will be an issue when trying to fix #1651.

a {
  @at-root (without: media) {
    b: c
  }
}

Before expand

Block 0x7fecb8c04310 (0@[0:0]-[62:0]) [root] 0
 Ruleset 0x7fecb8d03750 (0@[4:0]-[8:1]) [indent: 0] [root]
 >Selector_List 0x7fecb8d037f0 (0@[4:0]-[4:1]) [@media:0x0] - - -
 > Complex_Selector 0x7fecb8d03a20 (0@[4:0]-[4:1]) [weight:100] [@media:0x0] - - - --  <>
 >  Compound_Selector 0x7fecb8d038b0 (0@[4:0]-[4:0]) [weight:100] [@media:0x0] - - - <>
 >   Type_Selector 0x7fecb8d03970 (0@[4:0]-[4:1]) <<a>> - <>

After expand

Block 0x7fecb8d17520 (0@[0:0]-[62:0]) [root] 0
 Ruleset 0x7fecb8d181c0 (0@[4:0]-[8:1]) [indent: 0]
 >Selector_List 0x7fecb8d17600 (0@[4:0]-[4:1]) [@media:0x0] - - -
 > Complex_Selector 0x7fecb8d03a20 (0@[4:0]-[4:1]) [weight:100] [@media:0x0] - - - --  <>
 >  Compound_Selector 0x7fecb8d038b0 (0@[4:0]-[4:0]) [weight:100] [@media:0x0] - - - <>
 >   Type_Selector 0x7fecb8d03970 (0@[4:0]-[4:1]) <<a>> - <>
@mgreter
Copy link
Contributor

mgreter commented Oct 28, 2015

IMO we should refactor to make Has_Block directly inherit from Block (basically replacing class AST_XY : public Has_Block to class AST_XY : public Block. Reason for this is that we currently cannot push At_Root_Blocks etc. to the import_stack. Therefore we loose some information when later querying the current block context. But I guess this will introduce difficulties for cssize.

@xzyfer
Copy link
Contributor Author

xzyfer commented Oct 28, 2015

IMO we should refactor to make Has_Block directly inherit from Block

The Ruby implementation does what you're suggesting AFAIK.

But I guess this will introduce difficulties for cssize.

I don't think this will be an issue. The cssize is a direct line-for-line port from the Ruby implementation.

@mgreter
Copy link
Contributor

mgreter commented Nov 7, 2015

@xzyfer: waiting for your parser refactor before I'll start tackling this. Probably needs another major refactoring, since my first naive try to do this was shorty stopped by some complications in cssize!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants