WebKit Bugzilla
Attachment 350166 Details for
Bug 189774
: Adopt safe-area-inset on ImageDocument
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189774-20180919201314.patch (text/plain), 3.27 KB, created by
Benjamin Poulain
on 2018-09-19 20:13:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Benjamin Poulain
Created:
2018-09-19 20:13:15 PDT
Size:
3.27 KB
patch
obsolete
>Subversion Revision: 236224 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 09cb9fbb66ffd45c6aee8a18d7df5eaa5b0f8cb2..5f6807100c6ee0bb137aab9e6e5f60764c728a22 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-19 Benjamin Poulain <benjamin@webkit.org> >+ >+ Adopt safe-area-insets on ImageDocument >+ https://bugs.webkit.org/show_bug.cgi?id=189774 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ rdar://problem/44624432 >+ >+ By having the safe-area insets on the image, we ensure that they only >+ grow the document if there is not enough space. This also ensures the image >+ does not have parts under UI elements. >+ >+ * html/ImageDocument.cpp: >+ (WebCore::ImageDocument::createDocumentStructure): >+ (WebCore::ImageDocument::imageUpdated): >+ > 2018-09-19 John Wilander <wilander@apple.com> > > Resource Load Statistics: Add optional cap on partitioned cache max age >diff --git a/Source/WebCore/html/ImageDocument.cpp b/Source/WebCore/html/ImageDocument.cpp >index 0518ff867dc005d4f331a69d5d6fc093f7f1d526..97db6ee307e83b5a0ac84e708388b051d0b4bf2f 100644 >--- a/Source/WebCore/html/ImageDocument.cpp >+++ b/Source/WebCore/html/ImageDocument.cpp >@@ -233,9 +233,9 @@ void ImageDocument::createDocumentStructure() > > auto imageElement = ImageDocumentElement::create(*this); > if (m_shouldShrinkImage) >- imageElement->setAttribute(styleAttr, "-webkit-user-select:none; display:block; margin:auto;"); >+ imageElement->setAttribute(styleAttr, "-webkit-user-select:none; display:block; margin:auto; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)"); > else >- imageElement->setAttribute(styleAttr, "-webkit-user-select:none;"); >+ imageElement->setAttribute(styleAttr, "-webkit-user-select:none; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)"); > imageElement->setLoadManually(true); > imageElement->setSrc(url().string()); > imageElement->cachedImage()->setResponse(loader()->response()); >@@ -244,7 +244,7 @@ void ImageDocument::createDocumentStructure() > if (m_shouldShrinkImage) { > #if PLATFORM(IOS) > // Set the viewport to be in device pixels (rather than the default of 980). >- processViewport("width=device-width"_s, ViewportArguments::ImageDocument); >+ processViewport("width=device-width,viewport-fit=cover"_s, ViewportArguments::ImageDocument); > #else > auto listener = ImageEventListener::create(*this); > if (RefPtr<DOMWindow> window = this->domWindow()) >@@ -273,7 +273,8 @@ void ImageDocument::imageUpdated() > #if PLATFORM(IOS) > FloatSize screenSize = page()->chrome().screenSize(); > if (imageSize.width() > screenSize.width()) >- processViewport(String::format("width=%u", static_cast<unsigned>(imageSize.width().toInt())), ViewportArguments::ImageDocument); >+ processViewport(String::format("width=%u,viewport-fit=cover", static_cast<unsigned>(imageSize.width().toInt())), ViewportArguments::ImageDocument); >+ > if (page()) > page()->chrome().client().imageOrMediaDocumentSizeChanged(IntSize(imageSize.width(), imageSize.height())); > #else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189774
:
350166
|
350261