[wp-trac] [WordPress Trac] #58773: Improve oEmbed lazy loading

WordPress Trac noreply at wordpress.org
Mon May 13 22:37:54 UTC 2024


#58773: Improve oEmbed lazy loading
-------------------------------------+-------------------------------------
 Reporter:  adamsilverstein          |       Owner:  adamsilverstein
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  6.6
Component:  Embeds                   |     Version:  4.5
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch has-unit-      |     Focuses:  accessibility,
  tests                              |  performance, sustainability
-------------------------------------+-------------------------------------
Changes (by westonruter):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58143" 58143]:
 {{{
 #!CommitTicketReference repository="" revision="58143"
 Embeds: Enable lazy-loading of post embeds and fix keyboard a11y for
 hidden iframes.

 Chrome unreliably loads a lazy-loaded iframe when it is hidden using
 `clip: rect(1px, 1px, 1px, 1px)`. Instead of using `clip`, a lazy-loaded
 iframe can also be hidden with `visibility:hidden` which results in it
 loading not only in Chrome but all other browsers. With this change
 applied, the hard-coded check to prevent lazy-loading post embeds is now
 removed. An added benefit to using `visibility:hidden` is that the entire
 iframe in this case is not interactable, meaning that users navigating the
 document with the keyboard will not unexpectedly encounter tab stops
 inside of the hidden iframe, as can happen now with `clip` when the JS
 fails to reveal the loaded iframe. Note also that the `clip` property is
 deprecated.

 Lastly, when such a post embed iframe is rendered in an RSS feed, the
 `style` attribute is now removed using the HTML Tag Processor as opposed
 to using string replacement.

 Fixes #58773.
 Props westonruter, joemcgill, swissspidy, joedolson, adamsilverstein.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58773#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list