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

:host-context(dir=rtl) :-webkit-any broken in v1.11.1 #4984

Closed
freshp86 opened this issue Dec 12, 2017 · 2 comments
Closed

:host-context(dir=rtl) :-webkit-any broken in v1.11.1 #4984

freshp86 opened this issue Dec 12, 2017 · 2 comments

Comments

@freshp86
Copy link

freshp86 commented Dec 12, 2017

This bug is affecting the Chromium codebase, tracked here.

Offending commit is 1cc06fc

Minimal repro example

<html>                                                                                                                                                                                                              
<body>
  <script>
   Polymer = {
     dom: 'shadow',
     lazyRegister: true,
     suppressBindingNotifications: true,
     suppressTemplateNotifications: true,
     useNativeCSSProperties: true,
  };
  </script>
  <link href="./dist/polymer.html" rel="import">

  <dom-module id="x-example">
    <template>
     <style>
      :host-context([dir=rtl]) :-webkit-any(.b1, .b2) {
        background-color: red;
      }   

      :-webkit-any(.b1, .b2) {
        background-color: yellow;
      }   
    </style>
    <div class="b1">I should be yellow</div>
    <div class="b2">I should be yellow</div>
    </template>
  </dom-module>

  <x-example></x-example>
  <script>
    Polymer({is: 'x-example'});
  </script>

</body>
</html>

Inspecting the code reveals that the following block

:host-context([dir=rtl]) :-webkit-any(.b1, .b2) { ... }

is erroneously transformed to

:host-context([dir=rtl]) :-webkit-any(.b1, [dir=rtl]  :-webkit-any(.b1, .b2) { ... }

Note that the latter, besides not making much sense, is missing a closing parenthesis, causing every style below it to be ignored.

cc @azakus, @kevinpschaaf

@TimvdLippe
Copy link
Contributor

TimvdLippe commented Dec 12, 2017

Fixed in #4990

@kevinpschaaf
Copy link
Member

@azakus Do you know whether this fix needs to be ported to e.g. dir-mixin in 2.x?

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

4 participants