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

Selector element with "+" crash #37

Closed
carlosrovira opened this issue Mar 30, 2018 · 6 comments
Closed

Selector element with "+" crash #37

carlosrovira opened this issue Mar 30, 2018 · 6 comments
Assignees
Milestone

Comments

@carlosrovira
Copy link
Contributor

carlosrovira commented Mar 30, 2018

If I have this a element + .classname rule like this

dialog + .backdrop {
  background-color: red;
}

The final App crashes in the following way:

/Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/royale/JewelExample/JewelTheme-0.9.3-SNAPSHOT-js.swc:defaults.css(1): col: 1 Error: CSSTree.g: node from line 0:0 required (...)+ loop did not match anything at input 'dialog'

/Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/royale/JewelExample/JewelTheme-0.9.3-SNAPSHOT-js.swc:defaults.css(1): col: 1 Error: CSSTree.g: node from line 0:0 required (...)+ loop did not match anything at input 'dialog +'

/Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/royale/JewelExample/JewelTheme-0.9.3-SNAPSHOT-js.swc:defaults.css(57): col: 8 Error: JewelTheme-0.9.3-SNAPSHOT-js.swc:defaults.css line 56:7 no viable alternative at input '+'

@aharui aharui closed this as completed in b4eef09 Mar 30, 2018
@carlosrovira
Copy link
Contributor Author

Hi Alex,

I see this working if I put on final app example project but, if I put on library css I get this:

/Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/royale/JewelExample/Jewel-0.9.3-SNAPSHOT-js.swc:defaults.css(96): col: 2 Error: Type selector without namespace prefix requires a default namespace to be defined. input

/Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/royale/JewelExample/Jewel-0.9.3-SNAPSHOT-js.swc:defaults.css(96): col: 2 Error: Type selector without namespace prefix requires a default namespace to be defined. input

/Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/royale/JewelExample/Jewel-0.9.3-SNAPSHOT-js.swc:defaults.css(96): col: 2 Error: Type selector without namespace prefix requires a default namespace to be defined. input

(I think something similar could be happening with #33)

@aharui
Copy link
Contributor

aharui commented Apr 1, 2018

HTML Elements like "input" need to be in the "http://www.w3.org/1999/xhtml" namespace

@carlosrovira
Copy link
Contributor Author

carlosrovira commented Apr 1, 2018

I have this two in the css:

@namespace j "library://ns.apache.org/royale/jewel";
@namespace "http://www.w3.org/1999/xhtml";

@carlosrovira
Copy link
Contributor Author

Maybe I need to add some prefix?

@namespace x "http://www.w3.org/1999/xhtml";

x|input + .some {
...
}

@aharui
Copy link
Contributor

aharui commented Apr 1, 2018

The code that emits this error should be CSSSemanticAnalyzer in the resolveSelectors method where it creates a CSSUnknownDefaultNamespaceProblem. Add some debugging output around that code and see why. It looks like it thinks that the CSS file doesn't have a @namespace without a prefix that specifies the default namespace.

Maybe dump the SWC and see what defaults.css is actually in the SWC.

@Harbs
Copy link
Contributor

Harbs commented Apr 2, 2018

Does placing the default namespace first make a difference?

@carlosrovira carlosrovira self-assigned this Apr 9, 2018
@carlosrovira carlosrovira added this to the v0.9.3 milestone Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants