⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 241131 in webkit


Ignore:
Timestamp:
Feb 7, 2019, 11:01:23 AM (8 years ago)
Author:
achristensen@apple.com
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:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r241129 r241131  
     12019-02-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Print backgrounds preference should be honored instead of WKWebViewConfiguration value
     4        https://bugs.webkit.org/show_bug.cgi?id=194364
     5        <rdar://problem/47627599>
     6
     7        Reviewed by Tim Horton.
     8
     9        Without this patch, changing the preference for printing the background has no effect.
     10        This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
     11        Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
     12        or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
     13        are used when printing.  Actually printing verifies this change fixes the bug.
     14
     15        * UIProcess/API/Cocoa/WKWebView.mm:
     16        (-[WKWebView _initializeWithConfiguration:]):
     17
    1182019-02-07  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r240949 r241131  
    589589
    590590    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::shouldRespectImageOrientationKey(), WebKit::WebPreferencesStore::Value(!![_configuration _respectsImageOrientation]));
     591#if !PLATFORM(MAC)
     592    // FIXME: Expose WKPreferences._shouldPrintBackgrounds on iOS, adopt it in all iOS clients, and remove this and WKWebViewConfiguration._printsBackgrounds.
    591593    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::shouldPrintBackgroundsKey(), WebKit::WebPreferencesStore::Value(!![_configuration _printsBackgrounds]));
     594#endif
    592595    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::incrementalRenderingSuppressionTimeoutKey(), WebKit::WebPreferencesStore::Value([_configuration _incrementalRenderingSuppressionTimeout]));
    593596    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::javaScriptMarkupEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _allowsJavaScriptMarkup]));
Note: See TracChangeset for help on using the changeset viewer.