🐛 Allow http protocol for noscript > img fallbacks for parity with amp-img#21686
Conversation
|
Currently the AMP Cache doesn't rewrite I don't see any reason why we shouldn't rewrite |
|
Mixed mode warnings would only appear when JS is disabled. I only tested this on Chrome. But per the spec: https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhead
So the contents of the |
|
Is this PR still active? |
|
Still something I'd like to see happen. Otherwise we need this workaround which won't work if a site is indeed not available over HTTPS: ampproject/amp-wp#2126 Granted, the frequency of this happening will lessen going into the future, as more sites move to HTTPS and more JS is available on more bots. |
|
The rewrite is now in the AMP cache, from my read of the code, so this should be fine to commit now. |
|
It looks like this PR was approved; is it still okay to merge it? |
|
@Gregable probably knows best. |
|
Spotted one small suggestion and it probably needs to be sync'ed with changes before merging since travis hasn't run for 5 months. |
…cript-img-with-http-protocol * 'master' of github.com:ampproject/amphtml: (1326 commits) Fix and enable e2e tests for AMPHTML ads FIE rendering mode (ampproject#23995) 🏗 Update WorkerDOM to 0.17.0 (ampproject#24024) Make DocInfo.pageViewId64 async (ampproject#23998) 🐛 Updates amp-sidebar in amp-story (ampproject#23956) Revert "Revert "📖Update documentation for carousel 0.2 (ampproject#23840)" (ampproject#23967)" (ampproject#24016) 🔥 Revert "📈 Initial StorySpec Implementation (ampproject#23030)" (ampproject#24013) Extension skeleton code for payment widgets (ampproject#23045) 🏗🐛 Don't call `travisBuildNumber()` in the global scope (ampproject#24021) Remove suppressTypes from amp-mustache. (ampproject#23993) 🐛 Move `terser` from `dependencies` to `devDependencies` (ampproject#24018) Revert "Revert "Set the new loaders experiment to 1% of traffic. (ampproject#23780)" (ampproject#23963)" (ampproject#24014) SwG release 0.1.22.63 (ampproject#23997) Resolve navTiming variable earlier if possible (ampproject#23580) 🏗 Don't run all the runtime tests for validator-only changes (ampproject#24010) Collect document ready signal (ampproject#23981) Validator rollup (ampproject#24000) Remove flaky story branching test. (ampproject#23994) Include amp-base-carousel in amp-carousel's build. (ampproject#23984) Partial validator rollup (ampproject#23996) amp-bind: Rate-limit history operations (ampproject#23938) ...
This reverts commit bba1bb3.
Done! Also merged latest changes from |
* 'master' of github.com:ampproject/amphtml: (32 commits) ✨ Make tweet id a bindable attribute (ampproject#23953) 🏗 Update Local AMP extension to allow custom base URLs (ampproject#24029) 🏗 Improve serving from non-localhost host (ampproject#24066) Preventing half pixels. (ampproject#24050) Update callout-vendors.js (ampproject#23218) 🏗 Fixes to `check-package-manager.js` (ampproject#24060) Rename AMP_MODE to __AMP_MODE. (ampproject#24052) Story media performance metrics. (ampproject#23962) Updating Story amp-sidebar width documentation. (ampproject#23894) Fixes race condition in amp-video-iframe (ampproject#24033) Rename ampExtendedElements to __AMP_EXTENDED_ELEMENTS (ampproject#24056) 🏗🚮 Enable property inlining (ampproject#24053) ✨amp-ads: Added optional params for Directadvert network (ampproject#23724) <amp-experiment> style mutation fix and improvment (ampproject#23669) 🐛 Allow http protocol for noscript > img fallbacks for parity with amp-img (ampproject#21686) 🏗 Refactor transform-log-asserts (ampproject#24028) Automatically preconnect to source origins on page loads. (ampproject#24045) Support visibility API in the ampdoc (ampproject#23799) Amphtml visual tests should use relative path against root (ampproject#24042) FIX: check all fields' dirtiness on AMP form init (ampproject#23978) ...
This addresses an issue discovered in the AMP plugin. See ampproject/amp-wp#2051. To repeat that PR's description:
We discovered an issue when a site is served via HTTP instead of HTTPS. An
amp-imgallows for its image to use thehttpprotocol, so this is valid AMP:With ampproject/amp-wp#1861 there was introduced
noscript > imgfallbacks for serving when a user with JS disabled accesses a (canonical) AMP page. This results in markup like:It turns out that this actually is invalid AMP:
The
srcandsrcsetattributes are flagged as errors because—perhaps unintentionally—thenoscript > imgelement does not allow thehttpprotocol.Perhaps the
noscript > imgomitted thehttpprotocol since it was also omitted foriframe,video, andaudio. Butamp-iframe,amp-video, andamp-audioall only allowhttpsto begin with. Theamp-imgis unique in that it also allowshttp. So this PR ensures that itsnoscript > imgfallback element also allowshttp.