[webkit-changes] [WebKit/WebKit] 2c5a97: Regression(255052 at main) Some streaming sites fail ...

Chris Dumez noreply at github.com
Tue Apr 25 09:58:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2c5a97645ec0a3eb6a9bf8d1c64888c47cca5c6c
      https://github.com/WebKit/WebKit/commit/2c5a97645ec0a3eb6a9bf8d1c64888c47cca5c6c
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-04-25 (Tue, 25 Apr 2023)

  Changed paths:
    A LayoutTests/fast/dom/object-load-pdf-data-url-expected.txt
    A LayoutTests/fast/dom/object-load-pdf-data-url.html
    M Source/WebCore/html/HTMLImageLoader.cpp
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

  Log Message:
  -----------
  Regression(255052 at main) Some streaming sites fail with an Embedded Video Sandbox Browser Error
https://bugs.webkit.org/show_bug.cgi?id=255900
<rdar://107795151>

Reviewed by Tim Horton and Darin Adler.

Some streaming sites fail with an Embedded Video Sandbox Browser Error since
255052 at main. 255052 at main seems correct per the specification but exposing the
"Chrome PDF Viewer" caused those sites to use a different code path for
validating iframe sandboxing.

They now try to load a data URL with a pdf MIME type inside an <object> element
and this was firing an error event on iOS, which was causing the site's logic
to display the sandbox error.

There is logic inside WebFrameLoaderClient::objectContentType() that is iOS
specific and causes us  to try to load PDF as an image when inside an <object>.
This is because we don't support loadings such PDFs as plugins on iOS.

However, WebKit, in general, doesn't fire load/error events on <object> elements
that are loaded as plugins. It only does so when loading the <object> as an image.
I propose that we stop firing the load/error events for <object> loads of PDFs on
iOS, to make it look like they were loaded as plugins and avoid firing events that
could confuse sites such as the ones in the radar.

* LayoutTests/fast/dom/object-load-pdf-data-url-expected.txt: Added.
* LayoutTests/fast/dom/object-load-pdf-data-url.html: Added.
* Source/WebCore/html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::dispatchLoadEvent():

Canonical link: https://commits.webkit.org/263377@main




More information about the webkit-changes mailing list