Amphtml: amp-bind: Don't write non-primitive attribute values

Created on 10 Oct 2017  路  5Comments  路  Source: ampproject/amphtml

/to @choumx

Steps to reproduce:

  1. Run the dev server
  2. Open the amp-bind amp-list example: http://localhost:8000/examples/bind/list.amp.html
  3. Click 'Show other fruit', which binds an array to the identifier src
  4. Open the inspector and inspect the amp-list element
  5. Its src attribute became `http://localhost:8000/examples/bind/[object%20Object],

The binding applies and renders correctly, but 404 and fetch errors will fill the console.

High Priority Bug

Most helpful comment

Ahh, got it. It happens after you select a country and un-hides the amp-list (which fires the XHR on layout). Doesn't happen on subsequent country selections. Yea I'll fix this.

All 5 comments

Thanks for reporting this. I couldn't repro the 404/fetch errors. Are you seeing XHRs after clicking the "Show other fruit" button?

Either way, we probably shouldn't update element attributes to non-primitives.

You're welcome! It was making the request in the first form on this page for some reason, I didn't investigate very far. Maybe it has something to do with the mixed content error as well?

https://www.squareyards.com/micro/bhutani_alphathum_in_noida/index-amp.php

screen shot 2017-10-10 at 1 26 12 pm

Ahh, got it. It happens after you select a country and un-hides the amp-list (which fires the XHR on layout). Doesn't happen on subsequent country selections. Yea I'll fix this.

Related: #12837 and #12850.

Bumping to P1.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aghassemi picture aghassemi  路  3Comments

Download picture Download  路  3Comments

radiovisual picture radiovisual  路  3Comments

aghassemi picture aghassemi  路  3Comments

sryze picture sryze  路  3Comments