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

Using an @observable string as background image URL with style tag works in Dart but no in JavaScript #15776

Closed
DartBot opened this issue Dec 22, 2013 · 3 comments
Labels
closed-duplicate Closed in favor of an existing report

Comments

@DartBot
Copy link

DartBot commented Dec 22, 2013

This issue was originally filed by fniemann...@gmail.com


What steps will reproduce the problem?

  1. Publish URL for an image as an @­observable field of type string in a custom element
  2. Use the @­observable field in the custom element's HTML as the URL for a background image, e.g.
    background: url('{{backgroundImageUrl}}') no-repeat center center fixed;

What is the expected output?
Background image is displayed in both cases, Dart and JavaScript.

What do you see instead?
Background image is only displayed when using Dart in the DartEditor supplied Chromium.
But it doesn't work when using the "pub build" created JavaScript in a regular Chrome browser.

What version of the product are you using?
Dart Editor version 1.0.0_r30798 (STABLE)
Dart SDK version 1.0.0.10_r30798

On what operating system?
OS X 10.9

Please provide any additional information below.
An annoying but feasible workaround is the following:
<div style="background-image:url('{{backgroundImageUrl}}')">

Attached is a sample app that shows the bug.


Attachment:
css_bg_image_bug.zip (1.53 MB)

@DartBot
Copy link
Author

DartBot commented Dec 22, 2013

This comment was originally written by fni...@gmail.com


Here is a new version of the sample app to showcase the bug. In the original attachment I used @­published instead of @­observable. Same bug though.


Attachment:
css_bg_image_bug.zip (1.53 MB)

@lrhn
Copy link
Member

lrhn commented Jan 3, 2014

Added Area-Polymer, Triaged labels.

@sigmundch
Copy link
Member

Thanks again for the detail repro code.

This is unfortunately a bug that comes from polymer.js. Bindings are basically not supported inside style blocks. For more details, see Polymer/polymer#270


Added Duplicate label.
Marked as being merged into #13325.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

4 participants