Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9dfcb542a351d1fc7fff821dfb025427fdd2b77b
      
https://github.com/WebKit/WebKit/commit/9dfcb542a351d1fc7fff821dfb025427fdd2b77b
  Author: Richard Robinson <richard_robins...@apple.com>
  Date:   2023-06-22 (Thu, 22 Jun 2023)

  Changed paths:
    M Source/WebCore/html/PluginDocument.cpp

  Log Message:
  -----------
  Safari not rendering some PDFs correctly
https://bugs.webkit.org/show_bug.cgi?id=258377
rdar://110632076

Reviewed by Tim Horton.

254526@main made `PluginDocument` use "no-quirks" mode. PDFs were relying on 
the "body element fills the html element"
quirk to ensure their height matches the root HTML element's height, because 
the body element had no CSS `height` value
specified. Because `PluginDocument` is now in no-quirks mode, the body 
element's height can sometimes be less than the
height of the web view, which is incorrect.

254526@main tried to ensure this would not happen by using `setAttribute` on 
the body element to set the relevant CSS
attributes, including the height. However, `setAttribute` is lazy, so for some 
PDFS, none of these attributes were
actually being applied.

To fix, use `setInlineStyleProperty` instead of `setAttribute` to ensure the 
attributes are properly set immediately.

Also added a comment to clarify where the body background color actually comes 
from in the case of PDFs, to avoid future
confusion.

* Source/WebCore/html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to