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

unicode escape sequences in css not handled correctly #2650

Closed
HaykoKoryun opened this issue Oct 30, 2015 · 3 comments
Closed

unicode escape sequences in css not handled correctly #2650

HaykoKoryun opened this issue Oct 30, 2015 · 3 comments
Assignees
Labels

Comments

@HaykoKoryun
Copy link
Contributor

consider the following Polymer element:

<dom-module id="model-viewer">
  <style>
    /* represents ':host 3d-model' */
    :host .\33 d-model
    {
      border: solid 1px #000;
      width: 100px;
      height: 100px;
    }
  </style>
  <template>
    <canvas id="3d-model"></canvas>
  </template>
  <script>
    var Viewer = Polymer
    ({
      is: 'model-viewer',
      factoryImpl: function(name)
      {
      },
      ready: function(){},
      attached: function(){},
      detached: function(){}
    });
  </script>
</dom-module>

When Polymer parses the element declaration, specifically the style, it incorrectly treats the space in this sequence \33 d-model as a real space, when in fact it terminates the unicode escape sequence \33. As a result it transforms the selector to: model-viewer .\33.model-viewer d-model.model-viewer instead of model-viewer .\33 d-model.model-viewer as expected.

@arthurevans
Copy link

Verified, this works correctly in native shadow DOM but fails in shady as described.

As a workaround, you can left-pad the hexadecimal number to 6 digits, so the following selector works in both shadow DOM and shady:

#\000033d-model

Assigning to @sorvell for triage.

@ebidel ebidel added the css label Oct 30, 2015
@nazar-pc
Copy link
Contributor

nazar-pc commented Nov 1, 2015

I suspect we'll need just correct some regular expression.
I'll take a look at this.

@nazar-pc
Copy link
Contributor

nazar-pc commented Nov 1, 2015

@HaykoKoryun, fix for this issue is available in PR #2664

nazar-pc added a commit to nazar-pc/polymer that referenced this issue Nov 1, 2015
nazar-pc added a commit to nazar-pc/polymer that referenced this issue Nov 1, 2015
nazar-pc added a commit to nazar-pc/polymer that referenced this issue Nov 2, 2015
dfreedm added a commit that referenced this issue Nov 4, 2015
…es-in-css-selectors

Added support for short unicode escape sequences, fixes #2650
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants