Title: [241131] trunk/Source/WebKit
Revision
241131
Author
achristen...@apple.com
Date
2019-02-07 11:01:23 -0800 (Thu, 07 Feb 2019)

Log Message

Print backgrounds preference should be honored instead of WKWebViewConfiguration value
https://bugs.webkit.org/show_bug.cgi?id=194364
<rdar://problem/47627599>

Reviewed by Tim Horton.

Without this patch, changing the preference for printing the background has no effect.
This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
are used when printing.  Actually printing verifies this change fixes the bug.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (241130 => 241131)


--- trunk/Source/WebKit/ChangeLog	2019-02-07 18:59:50 UTC (rev 241130)
+++ trunk/Source/WebKit/ChangeLog	2019-02-07 19:01:23 UTC (rev 241131)
@@ -1,3 +1,20 @@
+2019-02-07  Alex Christensen  <achristen...@webkit.org>
+
+        Print backgrounds preference should be honored instead of WKWebViewConfiguration value
+        https://bugs.webkit.org/show_bug.cgi?id=194364
+        <rdar://problem/47627599>
+
+        Reviewed by Tim Horton.
+
+        Without this patch, changing the preference for printing the background has no effect.
+        This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
+        Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
+        or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
+        are used when printing.  Actually printing verifies this change fixes the bug.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+
 2019-02-07  Chris Dumez  <cdu...@apple.com>
 
         Mark DisplayLink as fast allocated

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (241130 => 241131)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-02-07 18:59:50 UTC (rev 241130)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-02-07 19:01:23 UTC (rev 241131)
@@ -588,7 +588,10 @@
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::suppressesIncrementalRenderingKey(), WebKit::WebPreferencesStore::Value(!![_configuration suppressesIncrementalRendering]));
 
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::shouldRespectImageOrientationKey(), WebKit::WebPreferencesStore::Value(!![_configuration _respectsImageOrientation]));
+#if !PLATFORM(MAC)
+    // FIXME: Expose WKPreferences._shouldPrintBackgrounds on iOS, adopt it in all iOS clients, and remove this and WKWebViewConfiguration._printsBackgrounds.
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::shouldPrintBackgroundsKey(), WebKit::WebPreferencesStore::Value(!![_configuration _printsBackgrounds]));
+#endif
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::incrementalRenderingSuppressionTimeoutKey(), WebKit::WebPreferencesStore::Value([_configuration _incrementalRenderingSuppressionTimeout]));
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::_javascript_MarkupEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _allowsJavaScriptMarkup]));
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::shouldConvertPositionStyleOnCopyKey(), WebKit::WebPreferencesStore::Value(!![_configuration _convertsPositionStyleOnCopy]));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to