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

Improve Element Sizing #103

Merged
merged 16 commits into from
Jan 15, 2016
Merged

Improve Element Sizing #103

merged 16 commits into from
Jan 15, 2016

Conversation

mjangda
Copy link
Contributor

@mjangda mjangda commented Jan 15, 2016

Instead of automatically applying layout=responsive to all amp elements, this introduces some changes so we can be a bit smarter about it.

It makes images, videos, and iframes more responsive using the sizes attribute. If an element is less than the max width of the page container, it will not grow beyond its defined width. When the viewport is smaller than the element's defined width, it will shrink appropriately.

See #14
Fixes #71 #101

Includes extension in the regex. Adds tests.
Existing extractor hook in and return if they get a false. Simplifies
the code of the `extract` method and will let others hook and provide
their own extractors.
To avoid issues when `false` returned
Only used by img_sanitizer. Move it into the class.
Use querystring params for photon URLs. Use wpcom_getimagesize as a last
resort fallback.
We want elements to not grow beyond their width and shrink to
fill the screen on viewports smaller than their width.

We do this by adding a `sizes` attribute (when not already set) to
enforce this behavior.

See #101
4.4 is the min supported version for the plugin
mjangda added a commit that referenced this pull request Jan 15, 2016
@mjangda mjangda merged commit 0695b0d into master Jan 15, 2016
@mjangda mjangda deleted the fix/layout-attr branch January 15, 2016 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant