Title: [205236] branches/safari-602-branch

Diff

Modified: branches/safari-602-branch/LayoutTests/ChangeLog (205235 => 205236)


--- branches/safari-602-branch/LayoutTests/ChangeLog	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/LayoutTests/ChangeLog	2016-08-31 07:20:38 UTC (rev 205236)
@@ -1,5 +1,20 @@
 2016-08-30  Babak Shafiei  <[email protected]>
 
+        Merge r204983. rdar://problem/27952772
+
+    2016-08-25  Said Abou-Hallawa  <[email protected]>
+
+            REGRESSION (r203378): [iOS] The PDF image is rendered stretched if a sub image of it is cached first
+            https://bugs.webkit.org/show_bug.cgi?id=160617
+
+            Reviewed by Tim Horton.
+
+            * fast/images/cached-clipped-pdf-expected.html: Added.
+            * fast/images/cached-clipped-pdf.html: Added.
+            * fast/images/displaced-non-cached-pdf.html:
+
+2016-08-30  Babak Shafiei  <[email protected]>
+
         Merge r203952. rdar://problem/27991571
 
     2016-07-30  Mark Lam  <[email protected]>

Added: branches/safari-602-branch/LayoutTests/fast/images/cached-clipped-pdf-expected.html (0 => 205236)


--- branches/safari-602-branch/LayoutTests/fast/images/cached-clipped-pdf-expected.html	                        (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/images/cached-clipped-pdf-expected.html	2016-08-31 07:20:38 UTC (rev 205236)
@@ -0,0 +1,11 @@
+<style>
+    img {
+        width: 200px;
+        height: 200px;
+    }
+</style>
+<img src=""
+<script>
+    if (window.testRunner && window.internals)
+        window.internals.settings.setPDFImageCachingPolicy("enabled");
+</script>

Added: branches/safari-602-branch/LayoutTests/fast/images/cached-clipped-pdf.html (0 => 205236)


--- branches/safari-602-branch/LayoutTests/fast/images/cached-clipped-pdf.html	                        (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/images/cached-clipped-pdf.html	2016-08-31 07:20:38 UTC (rev 205236)
@@ -0,0 +1,11 @@
+<style>
+    img {
+        width: 200px;
+        height: 200px;
+    }
+</style>
+<img src=""
+<script>
+    if (window.testRunner && window.internals)
+        window.internals.settings.setPDFImageCachingPolicy("clipBoundsOnly");
+</script>

Modified: branches/safari-602-branch/LayoutTests/fast/images/displaced-non-cached-pdf.html (205235 => 205236)


--- branches/safari-602-branch/LayoutTests/fast/images/displaced-non-cached-pdf.html	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/LayoutTests/fast/images/displaced-non-cached-pdf.html	2016-08-31 07:20:38 UTC (rev 205236)
@@ -3,7 +3,7 @@
 <body>
     <script>
         if (window.testRunner && window.internals)
-            window.internals.settings.setCachedPDFImageEnabled(false);
+            window.internals.settings.setPDFImageCachingPolicy("disabled");
     </script>
     <img src=""
     <img src=""

Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/ChangeLog	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog	2016-08-31 07:20:38 UTC (rev 205236)
@@ -1,5 +1,59 @@
 2016-08-30  Babak Shafiei  <[email protected]>
 
+        Merge r204983. rdar://problem/27952772
+
+    2016-08-25  Said Abou-Hallawa  <[email protected]>
+
+            REGRESSION (r203378): [iOS] The PDF image is rendered stretched if a sub image of it is cached first
+            https://bugs.webkit.org/show_bug.cgi?id=160617
+
+            Reviewed by Tim Horton.
+
+            When caching only a sub-image of the PDF ensure the source rectangle starts
+            at the top-left of the cached sub-image rectangle. When drawing the cached
+            sub-image to the destination context ensure the destination rectangle is the
+            sub-image rectangle so no stretching or shrinking happens.
+
+            Test: fast/images/cached-clipped-pdf.html
+
+            * page/Settings.cpp:
+            (WebCore::Settings::Settings):
+            (WebCore::Settings::setCachedPDFImageEnabled): Deleted.
+            * page/Settings.h:
+            (WebCore::Settings::isCachedPDFImageEnabled): Deleted.
+            * page/Settings.in:
+            Change the boolean setting CachedPDFImageEnabled to be enum property and
+            rename it PDFImageCachingPolicy. Allow the "PDFImageCachingBelowMemoryLimit"
+            option to be available on a;; platforms. The "PDFImageCachingClipBoundsOnly"
+            option is added for testing purpose. If forces recaching the PDF with each
+            draw and it sets the cached image rectangle to the clipping rectangle.
+
+            * platform/graphics/cg/PDFDocumentImage.cpp:
+            (WebCore::PDFDocumentImage::setPdfImageCachingPolicy): Take an enum instead of boolean.
+            (WebCore::cachedImageRect):
+            (WebCore::PDFDocumentImage::decodedSizeChanged): Enable PDFImageCachingBelowMemoryLimit
+            on all platforms.
+            (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Fix the source rectangle
+            when caching a sub-image of the PDF.
+            (WebCore::PDFDocumentImage::draw): Fix the destination rectangle when drawing
+            a sub-image to the destination context.
+            (WebCore::PDFDocumentImage::setCachedPDFImageEnabled): Deleted.
+            * platform/graphics/cg/PDFDocumentImage.h:
+
+            * rendering/RenderImage.cpp:
+            (WebCore::RenderImage::paintIntoRect):
+
+            * testing/InternalSettings.cpp:
+            (WebCore::InternalSettings::Backup::Backup):
+            (WebCore::InternalSettings::Backup::restoreTo):
+            (WebCore::InternalSettings::setPDFImageCachingPolicy):
+            (WebCore::InternalSettings::setCachedPDFImageEnabled): Deleted.
+            * testing/InternalSettings.h:
+            * testing/InternalSettings.idl:
+            Change the internal setting CachedPDFImageEnabled to PDFImageCachingPolicy.
+
+2016-08-30  Babak Shafiei  <[email protected]>
+
         Merge r203542. rdar://problem/27991570
 
     2016-07-21  John Wilander  <[email protected]>

Modified: branches/safari-602-branch/Source/WebCore/page/Settings.cpp (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/page/Settings.cpp	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/page/Settings.cpp	2016-08-31 07:20:38 UTC (rev 205236)
@@ -193,7 +193,6 @@
     , m_loadsImagesAutomatically(false)
     , m_areImagesEnabled(true)
     , m_preferMIMETypeForImages(false)
-    , m_isCachedPDFImageEnabled(true)
     , m_arePluginsEnabled(false)
     , m_isScriptEnabled(false)
     , m_needsAdobeFrameReloadingQuirk(false)
@@ -426,11 +425,6 @@
     m_preferMIMETypeForImages = preferMIMETypeForImages;
 }
 
-void Settings::setCachedPDFImageEnabled(bool isCachedPDFImageEnabled)
-{
-    m_isCachedPDFImageEnabled = isCachedPDFImageEnabled;
-}
-
 void Settings::setForcePendingWebGLPolicy(bool forced)
 {
     m_forcePendingWebGLPolicy = forced;

Modified: branches/safari-602-branch/Source/WebCore/page/Settings.h (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/page/Settings.h	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/page/Settings.h	2016-08-31 07:20:38 UTC (rev 205236)
@@ -77,6 +77,18 @@
     System
 };
 
+enum PDFImageCachingPolicy {
+    PDFImageCachingEnabled,
+    PDFImageCachingBelowMemoryLimit,
+    PDFImageCachingDisabled,
+    PDFImageCachingClipBoundsOnly,
+#if PLATFORM(IOS)
+    PDFImageCachingDefault = PDFImageCachingBelowMemoryLimit
+#else
+    PDFImageCachingDefault = PDFImageCachingEnabled
+#endif
+};
+
 typedef unsigned DebugOverlayRegions;
 
 class Settings : public RefCounted<Settings> {
@@ -146,9 +158,6 @@
     WEBCORE_EXPORT void setPreferMIMETypeForImages(bool);
     bool preferMIMETypeForImages() const { return m_preferMIMETypeForImages; }
 
-    WEBCORE_EXPORT void setCachedPDFImageEnabled(bool);
-    bool isCachedPDFImageEnabled() const { return m_isCachedPDFImageEnabled; }
-
     WEBCORE_EXPORT void setPluginsEnabled(bool);
     bool arePluginsEnabled() const { return m_arePluginsEnabled; }
 
@@ -331,7 +340,6 @@
     bool m_loadsImagesAutomatically : 1;
     bool m_areImagesEnabled : 1;
     bool m_preferMIMETypeForImages : 1;
-    bool m_isCachedPDFImageEnabled : 1;
     bool m_arePluginsEnabled : 1;
     bool m_isScriptEnabled : 1;
     bool m_needsAdobeFrameReloadingQuirk : 1;

Modified: branches/safari-602-branch/Source/WebCore/page/Settings.in (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/page/Settings.in	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/page/Settings.in	2016-08-31 07:20:38 UTC (rev 205236)
@@ -6,6 +6,7 @@
 localStorageDatabasePath type=String
 editableLinkBehavior type=EditableLinkBehavior, initial=EditableLinkDefaultBehavior
 textDirectionSubmenuInclusionBehavior type=TextDirectionSubmenuInclusionBehavior, initial=TextDirectionSubmenuAutomaticallyIncluded
+pdfImageCachingPolicy type=PDFImageCachingPolicy, initial = PDFImageCachingDefault
 passwordEchoDurationInSeconds type=double, initial=1
 
 # Sets the magnification value for validation message timer.  If the

Modified: branches/safari-602-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2016-08-31 07:20:38 UTC (rev 205236)
@@ -100,13 +100,13 @@
     return m_document; // Return true if size is available.
 }
 
-void PDFDocumentImage::setCachedPDFImageEnabled(bool enabled)
+void PDFDocumentImage::setPdfImageCachingPolicy(PDFImageCachingPolicy pdfImageCachingPolicy)
 {
-    if (m_isCachedPDFImageEnabled == enabled)
+    if (m_pdfImageCachingPolicy == pdfImageCachingPolicy)
         return;
 
-    if (!(m_isCachedPDFImageEnabled = enabled))
-        destroyDecodedData();
+    m_pdfImageCachingPolicy = pdfImageCachingPolicy;
+    destroyDecodedData();
 }
 
 bool PDFDocumentImage::cacheParametersMatch(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect) const
@@ -157,7 +157,6 @@
     context.translate(0, -srcRect.height());
 }
 
-#if PLATFORM(IOS)
 // To avoid the jetsam on iOS, we are going to limit the size of all the PDF cachedImages to be 64MB.
 static const size_t s_maxCachedImageSide = 4 * 1024;
 static const size_t s_maxCachedImageArea = s_maxCachedImageSide * s_maxCachedImageSide;
@@ -167,19 +166,15 @@
 
 static FloatRect cachedImageRect(GraphicsContext& context, const FloatRect& dstRect)
 {
+    FloatRect dirtyRect = context.clipBounds();
+
+    // Calculate the maximum rectangle we can cache around the center of the clipping bounds.
     FloatSize maxSize = s_maxCachedImageSide / context.scaleFactor();
+    FloatPoint minLocation = FloatPoint(dirtyRect.center() - maxSize / 2);
 
-    // Expand from the center of the dirty rectangle.
-    FloatRect rect = context.clipBounds();
-    rect.setX(std::max(rect.center().x() - maxSize.width() / 2, dstRect.x()));
-    rect.setY(std::max(rect.center().y() - maxSize.height() / 2, dstRect.y()));
-
-    // Cover as much as we could from the dstRect.
-    rect.setWidth(std::min(maxSize.width(), dstRect.width()));
-    rect.setHeight(std::min(maxSize.height(), dstRect.height()));
-    return rect;
+    // Ensure the clipping bounds are all included but within the bounds of the dstRect
+    return intersection(unionRect(dirtyRect, FloatRect(minLocation, maxSize)), dstRect);
 }
-#endif
 
 void PDFDocumentImage::decodedSizeChanged(size_t newCachedBytes)
 {
@@ -189,12 +184,10 @@
     if (imageObserver())
         imageObserver()->decodedSizeChanged(this, -safeCast<int>(m_cachedBytes) + newCachedBytes);
 
-#if PLATFORM(IOS)
     ASSERT(s_allDecodedDataSize >= m_cachedBytes);
     // Update with the difference in two steps to avoid unsigned underflow subtraction.
     s_allDecodedDataSize -= m_cachedBytes;
     s_allDecodedDataSize += newCachedBytes;
-#endif
 
     m_cachedBytes = newCachedBytes;
 }
@@ -215,28 +208,38 @@
     bool repaintIfNecessary = interpolationQuality != InterpolationNone && interpolationQuality != InterpolationLow;
 #endif
 
-    if (!m_isCachedPDFImageEnabled || (m_cachedImageBuffer && (!repaintIfNecessary || cacheParametersMatch(context, dstRect, srcRect))))
+    // Clipped option is for testing only. Force recaching the PDF with each draw.
+    if (m_pdfImageCachingPolicy != PDFImageCachingClipBoundsOnly) {
+        if (m_cachedImageBuffer && (!repaintIfNecessary || cacheParametersMatch(context, dstRect, srcRect)))
+            return;
+    }
+
+    switch (m_pdfImageCachingPolicy) {
+    case PDFImageCachingDisabled:
         return;
+    case PDFImageCachingBelowMemoryLimit:
+        // Keep the memory used by the cached image below some threshold, otherwise WebKit process
+        // will jetsam if it exceeds its memory limit. Only a rectangle from the PDF may be cached.
+        m_cachedImageRect = cachedImageRect(context, dstRect);
+        break;
+    case PDFImageCachingClipBoundsOnly:
+        m_cachedImageRect = context.clipBounds();
+        break;
+    case PDFImageCachingEnabled:
+        m_cachedImageRect = dstRect;
+        break;
+    }
 
-#if PLATFORM(IOS)
-    // Keep the memory used by the cached image below some threshold, otherwise WebKit process
-    // will jetsam if it exceeds its memory limit. Only a rectangle from the PDF may be cached.
-    m_cachedImageRect = cachedImageRect(context, dstRect);
-#else
-    m_cachedImageRect = dstRect;
-#endif
-
     FloatSize cachedImageSize = FloatRect(enclosingIntRect(m_cachedImageRect)).size();
 
-#if PLATFORM(IOS)
-    IntSize scaledSize = ImageBuffer::compatibleBufferSize(cachedImageSize, context);
-
     // Cache the PDF image only if the size of the new image won't exceed the cache threshold.
-    if (s_allDecodedDataSize + safeCast<size_t>(scaledSize.width()) * scaledSize.height() * 4 - m_cachedBytes > s_maxDecodedDataSize) {
-        destroyDecodedData();
-        return;
+    if (m_pdfImageCachingPolicy == PDFImageCachingBelowMemoryLimit) {
+        IntSize scaledSize = ImageBuffer::compatibleBufferSize(cachedImageSize, context);
+        if (s_allDecodedDataSize + safeCast<size_t>(scaledSize.width()) * scaledSize.height() * 4 - m_cachedBytes > s_maxDecodedDataSize) {
+            destroyDecodedData();
+            return;
+        }
     }
-#endif
 
     m_cachedImageBuffer = ImageBuffer::createCompatibleBuffer(cachedImageSize, context);
     if (!m_cachedImageBuffer) {
@@ -245,8 +248,10 @@
     }
 
     auto& bufferContext = m_cachedImageBuffer->context();
-    // The PDF cachedImage should be drawn at (0, 0) always.
-    transformContextForPainting(bufferContext, FloatRect({ }, dstRect.size()), srcRect);
+    // We need to transform the coordinate system such that top-left of m_cachedImageRect will be mapped to the
+    // top-left of dstRect. Although only m_cachedImageRect.size() of the image copied, the sizes of srcRect
+    // and dstRect should be passed to this function because they are used to calculate the image scaling.
+    transformContextForPainting(bufferContext, dstRect, FloatRect(m_cachedImageRect.location(), srcRect.size()));
     drawPDFPage(bufferContext);
 
     m_cachedTransform = context.getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
@@ -268,8 +273,13 @@
         GraphicsContextStateSaver stateSaver(context);
         context.setCompositeOperation(op);
 
-        if (m_cachedImageBuffer)
-            context.drawImageBuffer(*m_cachedImageBuffer, dstRect);
+        if (m_cachedImageBuffer) {
+            // Draw the ImageBuffer 'm_cachedImageBuffer' to the rectangle 'm_cachedImageRect'
+            // on the destination context. Since the pixels of the rectangle 'm_cachedImageRect'
+            // of the source PDF was copied to 'm_cachedImageBuffer', the sizes of the source
+            // and the destination rectangles will be equal and no scaling will be needed here.
+            context.drawImageBuffer(*m_cachedImageBuffer, m_cachedImageRect);
+        }
         else {
             transformContextForPainting(context, dstRect, srcRect);
             drawPDFPage(context);

Modified: branches/safari-602-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h	2016-08-31 07:20:38 UTC (rev 205236)
@@ -30,6 +30,7 @@
 #include "FloatRect.h"
 #include "GraphicsTypes.h"
 #include "Image.h"
+#include "Settings.h"
 
 #if USE(CG)
 
@@ -52,7 +53,7 @@
         return adoptRef(new PDFDocumentImage(observer));
     }
 
-    void setCachedPDFImageEnabled(bool);
+    void setPdfImageCachingPolicy(PDFImageCachingPolicy);
 
 private:
     PDFDocumentImage(ImageObserver*);
@@ -87,7 +88,7 @@
     void updateCachedImageIfNeeded(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect);
     bool cacheParametersMatch(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect) const;
 
-    bool m_isCachedPDFImageEnabled { true };
+    PDFImageCachingPolicy m_pdfImageCachingPolicy { PDFImageCachingDefault };
 
 #if USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
     RetainPtr<PDFDocument> m_document;

Modified: branches/safari-602-branch/Source/WebCore/rendering/RenderImage.cpp (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/rendering/RenderImage.cpp	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/rendering/RenderImage.cpp	2016-08-31 07:20:38 UTC (rev 205236)
@@ -552,7 +552,7 @@
 
 #if USE(CG)
     if (is<PDFDocumentImage>(image))
-        downcast<PDFDocumentImage>(*image).setCachedPDFImageEnabled(frame().settings().isCachedPDFImageEnabled());
+        downcast<PDFDocumentImage>(*image).setPdfImageCachingPolicy(frame().settings().pdfImageCachingPolicy());
 #endif
 
     ImageOrientationDescription orientationDescription(shouldRespectImageOrientation(), style().imageOrientation());

Modified: branches/safari-602-branch/Source/WebCore/testing/InternalSettings.cpp (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/testing/InternalSettings.cpp	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/testing/InternalSettings.cpp	2016-08-31 07:20:38 UTC (rev 205236)
@@ -80,7 +80,6 @@
     , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
     , m_imagesEnabled(settings.areImagesEnabled())
     , m_preferMIMETypeForImages(settings.preferMIMETypeForImages())
-    , m_cachedPDFImageEnabled(settings.isCachedPDFImageEnabled())
     , m_minimumTimerInterval(settings.minimumDOMTimerInterval())
 #if ENABLE(VIDEO_TRACK)
     , m_shouldDisplaySubtitles(settings.shouldDisplaySubtitles())
@@ -113,6 +112,7 @@
 #endif
     , m_userInterfaceDirectionPolicy(settings.userInterfaceDirectionPolicy())
     , m_systemLayoutDirection(settings.systemLayoutDirection())
+    , m_pdfImageCachingPolicy(settings.pdfImageCachingPolicy())
 {
 }
 
@@ -160,7 +160,6 @@
     RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
     settings.setImagesEnabled(m_imagesEnabled);
     settings.setPreferMIMETypeForImages(m_preferMIMETypeForImages);
-    settings.setCachedPDFImageEnabled(m_cachedPDFImageEnabled);
     settings.setMinimumDOMTimerInterval(m_minimumTimerInterval);
 #if ENABLE(VIDEO_TRACK)
     settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
@@ -190,6 +189,7 @@
 #endif
     settings.setUserInterfaceDirectionPolicy(m_userInterfaceDirectionPolicy);
     settings.setSystemLayoutDirection(m_systemLayoutDirection);
+    settings.setPdfImageCachingPolicy(m_pdfImageCachingPolicy);
     Settings::setAllowsAnySSLCertificate(false);
 }
 
@@ -485,10 +485,19 @@
     settings()->setImagesEnabled(enabled);
 }
 
-void InternalSettings::setCachedPDFImageEnabled(bool enabled, ExceptionCode& ec)
+void InternalSettings::setPDFImageCachingPolicy(const String& policy, ExceptionCode& ec)
 {
     InternalSettingsGuardForSettings();
-    settings()->setCachedPDFImageEnabled(enabled);
+    if (equalLettersIgnoringASCIICase(policy, "disabled"))
+        settings()->setPdfImageCachingPolicy(PDFImageCachingDisabled);
+    else if (equalLettersIgnoringASCIICase(policy, "belowmemorylimit"))
+        settings()->setPdfImageCachingPolicy(PDFImageCachingBelowMemoryLimit);
+    else if (equalLettersIgnoringASCIICase(policy, "clipboundsonly"))
+        settings()->setPdfImageCachingPolicy(PDFImageCachingClipBoundsOnly);
+    else if (equalLettersIgnoringASCIICase(policy, "enabled"))
+        settings()->setPdfImageCachingPolicy(PDFImageCachingEnabled);
+    else
+        ec = SYNTAX_ERR;
 }
 
 void InternalSettings::setMinimumTimerInterval(double intervalInSeconds, ExceptionCode& ec)

Modified: branches/safari-602-branch/Source/WebCore/testing/InternalSettings.h (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/testing/InternalSettings.h	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/testing/InternalSettings.h	2016-08-31 07:20:38 UTC (rev 205236)
@@ -80,7 +80,6 @@
         bool m_langAttributeAwareFormControlUIEnabled;
         bool m_imagesEnabled;
         bool m_preferMIMETypeForImages;
-        bool m_cachedPDFImageEnabled;
         std::chrono::milliseconds m_minimumTimerInterval;
 #if ENABLE(VIDEO_TRACK)
         bool m_shouldDisplaySubtitles;
@@ -113,6 +112,7 @@
 #endif
         UserInterfaceDirectionPolicy m_userInterfaceDirectionPolicy;
         TextDirection m_systemLayoutDirection;
+        PDFImageCachingPolicy m_pdfImageCachingPolicy;
     };
 
     static Ref<InternalSettings> create(Page* page)
@@ -142,7 +142,7 @@
     void setAllowsAirPlayForMediaPlayback(bool);
     void setEditingBehavior(const String&, ExceptionCode&);
     void setPreferMIMETypeForImages(bool, ExceptionCode&);
-    void setCachedPDFImageEnabled(bool, ExceptionCode&);
+    void setPDFImageCachingPolicy(const String&, ExceptionCode&);
     void setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode&);
     bool shouldDisplayTrackKind(const String& kind, ExceptionCode&);
     void setStorageBlockingPolicy(const String&, ExceptionCode&);

Modified: branches/safari-602-branch/Source/WebCore/testing/InternalSettings.idl (205235 => 205236)


--- branches/safari-602-branch/Source/WebCore/testing/InternalSettings.idl	2016-08-31 07:20:29 UTC (rev 205235)
+++ branches/safari-602-branch/Source/WebCore/testing/InternalSettings.idl	2016-08-31 07:20:38 UTC (rev 205236)
@@ -68,7 +68,7 @@
     // Other switches
     [RaisesException] void setStorageBlockingPolicy(DOMString policy);
     [RaisesException] void setImagesEnabled(boolean enabled);
-    [RaisesException] void setCachedPDFImageEnabled(boolean enabled);
+    [RaisesException] void setPDFImageCachingPolicy(DOMString policy);
     [RaisesException] void setUseLegacyBackgroundSizeShorthandBehavior(boolean enabled);
     [RaisesException] void setAutoscrollForDragAndDropEnabled(boolean enabled);
     [RaisesException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to