amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-pixel breaks the page

Open teleservizi opened this issue 11 years ago • 6 comments

Git pulled on 10 sept 2015 By adding an < amp-pixel src="https://....." > the page turns blank. I'm getting the following error in Chrome's console Uncaught Error: Layout not supported for: container ElementProto.firstAttachedCallback_ @ viewport.js:45 ElementProto.attachedCallback @ viewport.js:22 Regards Enrico Canardi

teleservizi avatar Sep 10 '15 16:09 teleservizi

@dvoytenko On Sep 10, 2015 9:12 AM, "teleservizi" [email protected] wrote:

Git pulled on 10 sept 2015 By adding an the page turns blank. I'm getting the following error in Chrome's console Uncaught Error: Layout not supported for: container ElementProto.firstAttachedCallback_ @ viewport.js:45 ElementProto.attachedCallback @ viewport.js:22 Regards Enrico Canardi

— Reply to this email directly or view it on GitHub https://github.com/ampproject/amphtml/issues/56.

cramforce avatar Sep 10 '15 16:09 cramforce

So far we've used amp-pixel always with width=1/height=1. I guess that's not super apparent? Should we just hardcode the dimensions when not specified for amp-pixel?

dvoytenko avatar Sep 11 '15 05:09 dvoytenko

Found the problem, the < amp-pixel > tag has to be closed with </ amp-pixel > otherwise it will wrap every following tag inside the amp-pixel and of course setting width and height solves the jscript error

teleservizi avatar Sep 11 '15 07:09 teleservizi

Please add to the amp-html-components.md file the mandatoriness of the width and height attributes

teleservizi avatar Sep 11 '15 09:09 teleservizi

@dvoytenko Yeah, in this case we definitely should. They are not visible anyway. @teleservizi We do document this in the amp-html-format.md but I agree it should be relaxed here.

cramforce avatar Sep 11 '15 13:09 cramforce

amp-pixel is now automatically configured and doesn't require width/height/layout attributes.

dvoytenko avatar Sep 15 '15 06:09 dvoytenko