[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:56:33 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8dc1c0e21acbf382d343c0681af40a5b3c9a1013
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 18 15:26:08 2003 +0000

    WebCore:
    
    	- WebCore part of fix for 3157018 -- Would like option to
    	not print backgrounds
    
            Reviewed by Darin
    
            * kwq/KWQKHTMLSettings.h:
    	add _shouldPrintBackgrounds field and accessors
    
            * kwq/WebCoreSettings.h:
    	add shouldPrintBackgrounds field and accessors
            * kwq/WebCoreSettings.mm:
            (-[WebCoreSettings setShouldPrintBackgrounds:]):
    	new method, passes value to KHTMLSettings
            (-[WebCoreSettings shouldPrintBackgrounds]):
    	new method
    
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge styleSheetForPrinting]):
    	new method, returns a style sheet that has backgrounds
    	turned off if preference is set that way.
            (-[WebCoreBridge reapplyStylesForDeviceType:]):
    	if printing, set the printStyleSheet to the one we
    	created based on the preferences. (KHTML has always
    	had support for a special printStyleSheet, but it was
    	only being used in !APPLE_CHANGES code.)
    
            * khtml/rendering/render_style.h:
    	add shouldCorrectTextColor boolean field and accessors
    
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::recalcStyle):
    	tell style to correct text colors if backgrounds aren't being printed
    
            * khtml/rendering/render_text.cpp:
            (TextRun::paintSelection):
    	added comment
            (simpleDifferenceBetweenColors):
    	new function, computes a quick measure of difference
    	between colors
            (correctedTextColor):
    	if text and background colors are too similar, returns
    	lightened or darkened text color
            (RenderText::paintObject):
    	if style says to correct text colors, call correctedTextColor
    
    WebKit:
    
    	- WebKit part of fix for 3157018 -- Would like option to
    	not print backgrounds
    
            Reviewed by Darin
    
            * WebView.subproj/WebPreferences.h:
    	new accessor methods for new shouldPrintBackgrounds preference
            * WebView.subproj/WebPreferences.m:
            (+[WebPreferences initialize]):
    	set initial value for WebKitShouldPrintBackgroundsPreferenceKey
    	to NO
            (-[WebPreferences shouldPrintBackgrounds]):
    	new method, read NSUserDefaults value
            (-[WebPreferences setShouldPrintBackgrounds:]):
    	new method, write NSUserDefault value
    
            * WebView.subproj/WebViewPrivate.m:
            (-[WebView _updateWebCoreSettingsFromPreferences:]):
    	tell WebCore about value of shouldPrintBackgrounds
    
            * English.lproj/StringsNotToBeLocalized.txt:
    	Updated for these and other recent changes
    
    WebBrowser:
    
    	- WebBrowser part of fix for 3157018 -- Would like option to
    	not print backgrounds
    
            Reviewed by Darin
    
    	* English.lproj/PrintingAccessoryView.nib:
    	new nib file, contains view holding single "Print
    	Backgrounds" checkbox
    
            * PrintingAccessoryViewController.h: Added.
            * PrintingAccessoryViewController.m: Added.
            (-[PrintingAccessoryViewController init]):
    	load the nib file with self as owner
            (+[PrintingAccessoryViewController sharedController]):
    	returns shared instance used by BrowserDocument
            (-[PrintingAccessoryViewController togglePrintBackgrounds:]):
    	toggle the WebKit preference (which in turn updates the
    	WebCore setting)
            (-[PrintingAccessoryViewController accessoryView]):
    	returns the view from the nib that will be displayed in the
    	print panel, after updating the checkbox state
    
            * BrowserDocument.m:
            (-[BrowserDocument printWebFrameView:showingPrintPanel:]):
    	Set up print panel's accessory view
    
            * Preferences.subproj/AppearancePreferences.m:
    	removed unused method I stumbled across
    
            * WebBrowser.pbproj/project.pbxproj:
    	updated for new files
    
            * English.lproj/StringsNotToBeLocalized.txt:
    	Updated for these changes
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5004 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 9c81703..0dbdddf 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,50 @@
+2003-09-17  John Sullivan  <sullivan at apple.com>
+
+	- WebCore part of fix for 3157018 -- Would like option to
+	not print backgrounds	
+
+        Reviewed by Darin
+
+        * kwq/KWQKHTMLSettings.h:
+	add _shouldPrintBackgrounds field and accessors
+
+        * kwq/WebCoreSettings.h:
+	add shouldPrintBackgrounds field and accessors
+        * kwq/WebCoreSettings.mm:
+        (-[WebCoreSettings setShouldPrintBackgrounds:]):
+	new method, passes value to KHTMLSettings
+        (-[WebCoreSettings shouldPrintBackgrounds]):
+	new method
+
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge styleSheetForPrinting]):
+	new method, returns a style sheet that has backgrounds
+	turned off if preference is set that way.
+        (-[WebCoreBridge reapplyStylesForDeviceType:]):
+	if printing, set the printStyleSheet to the one we
+	created based on the preferences. (KHTML has always
+	had support for a special printStyleSheet, but it was
+	only being used in !APPLE_CHANGES code.)
+
+        * khtml/rendering/render_style.h:
+	add shouldCorrectTextColor boolean field and accessors 
+
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::recalcStyle):
+	tell style to correct text colors if backgrounds aren't being printed
+
+        * khtml/rendering/render_text.cpp:
+        (TextRun::paintSelection):
+	added comment
+        (simpleDifferenceBetweenColors):
+	new function, computes a quick measure of difference
+	between colors
+        (correctedTextColor):
+	if text and background colors are too similar, returns
+	lightened or darkened text color
+        (RenderText::paintObject):
+	if style says to correct text colors, call correctedTextColor
+
 2003-09-17  Darin Adler  <darin at apple.com>
 
         Reviewed by Ken.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9c81703..0dbdddf 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,50 @@
+2003-09-17  John Sullivan  <sullivan at apple.com>
+
+	- WebCore part of fix for 3157018 -- Would like option to
+	not print backgrounds	
+
+        Reviewed by Darin
+
+        * kwq/KWQKHTMLSettings.h:
+	add _shouldPrintBackgrounds field and accessors
+
+        * kwq/WebCoreSettings.h:
+	add shouldPrintBackgrounds field and accessors
+        * kwq/WebCoreSettings.mm:
+        (-[WebCoreSettings setShouldPrintBackgrounds:]):
+	new method, passes value to KHTMLSettings
+        (-[WebCoreSettings shouldPrintBackgrounds]):
+	new method
+
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge styleSheetForPrinting]):
+	new method, returns a style sheet that has backgrounds
+	turned off if preference is set that way.
+        (-[WebCoreBridge reapplyStylesForDeviceType:]):
+	if printing, set the printStyleSheet to the one we
+	created based on the preferences. (KHTML has always
+	had support for a special printStyleSheet, but it was
+	only being used in !APPLE_CHANGES code.)
+
+        * khtml/rendering/render_style.h:
+	add shouldCorrectTextColor boolean field and accessors 
+
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::recalcStyle):
+	tell style to correct text colors if backgrounds aren't being printed
+
+        * khtml/rendering/render_text.cpp:
+        (TextRun::paintSelection):
+	added comment
+        (simpleDifferenceBetweenColors):
+	new function, computes a quick measure of difference
+	between colors
+        (correctedTextColor):
+	if text and background colors are too similar, returns
+	lightened or darkened text color
+        (RenderText::paintObject):
+	if style says to correct text colors, call correctedTextColor
+
 2003-09-17  Darin Adler  <darin at apple.com>
 
         Reviewed by Ken.
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index fcafa6d..fb5aa7d 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -641,6 +641,7 @@ protected:
               // non CSS2 inherited
               bool _visuallyOrdered : 1;
               bool _htmlHacks :1;
+              bool _should_correct_text_color : 1;
     } inherited_flags;
 
 // don't inherit
@@ -725,6 +726,7 @@ protected:
 	inherited_flags._visuallyOrdered = false;
 	inherited_flags._htmlHacks=false;
         inherited_flags._box_direction = BNORMAL;
+        inherited_flags._should_correct_text_color = false;
 
 	noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = INLINE;
 	noninherited_flags._bg_repeat = REPEAT;
@@ -1041,6 +1043,9 @@ public:
     void setFontVariant( EFontVariant f ) { inherited_flags._font_variant = f; }
     void setCursorImage( CachedImage *v ) { SET_VAR(inherited,cursor_image,v) }
 
+    bool shouldCorrectTextColor() const { return inherited_flags._should_correct_text_color; }
+    void setShouldCorrectTextColor(bool b=true) { inherited_flags._should_correct_text_color = b; }
+
     bool htmlHacks() const { return inherited_flags._htmlHacks; }
     void setHtmlHacks(bool b=true) { inherited_flags._htmlHacks = b; }
 
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 3a01979..5928633 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -81,6 +81,8 @@ void TextRun::paintSelection(const Font *f, RenderText *text, QPainter *p, Rende
     // Macintosh-style text highlighting is to draw with a particular background color, not invert.
     QColor textColor = style->color();
     QColor c = p->selectedTextBackgroundColor();
+    
+    // if text color and selection background color are identical, invert background color.
     if (textColor == c)
         c = QColor(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
 
@@ -532,6 +534,36 @@ int RenderText::rightmostPosition() const
     return 0;
 }
 
+static int
+simpleDifferenceBetweenColors(QColor c1, QColor c2)
+{
+    // a distance could be computed by squaring the differences between components, but
+    // this is faster and so far seems good enough for our purposes.
+    return abs(c1.red() - c2.red()) + abs(c1.green() - c2.green()) + abs(c1.blue() - c2.blue());
+}
+
+static QColor 
+correctedTextColor(QColor textColor, QColor backgroundColor) 
+{
+    // Adjust the text color if it is too close to the background color,
+    // by darkening or lightening it to move it further away.
+    
+    int d = simpleDifferenceBetweenColors(textColor, backgroundColor);
+    // semi-arbitrarily chose 255 value here after a few tests; 
+    if (d > 255) {
+        return textColor;
+    }
+    
+    int distanceFromWhite = simpleDifferenceBetweenColors(textColor, Qt::white);
+    int distanceFromBlack = simpleDifferenceBetweenColors(textColor, Qt::black);
+
+    if (distanceFromWhite < distanceFromBlack) {
+        return textColor.dark();
+    }
+    
+    return textColor.light();
+}
+
 void RenderText::paintObject(QPainter *p, int /*x*/, int y, int /*w*/, int h,
                              int tx, int ty, PaintAction paintAction)
 {
@@ -632,9 +664,14 @@ void RenderText::paintObject(QPainter *p, int /*x*/, int y, int /*w*/, int h,
 #if APPLE_CHANGES
             if (drawText) {
 #endif
+            
+            QColor textColor = _style->color();
+            if (_style->shouldCorrectTextColor()) {
+                textColor = correctedTextColor(textColor, _style->backgroundColor());
+            }
 
-            if(_style->color() != p->pen().color())
-                p->setPen(_style->color());
+            if(textColor != p->pen().color())
+                p->setPen(textColor);
 
 #if APPLE_CHANGES
             // Set a text shadow if we have one.
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index bfb9df6..876302f 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -925,10 +925,16 @@ void DocumentImpl::recalcStyle( StyleChange change )
 	fontDef.italic = f.italic();
 	fontDef.weight = f.weight();
 #if APPLE_CHANGES
-        fontDef.usePrinterFont = m_paintDevice->devType() == QInternal::Printer;
+        bool printing = m_paintDevice->devType() == QInternal::Printer;
+        fontDef.usePrinterFont = printing;
 #endif
         if (m_view) {
             const KHTMLSettings *settings = m_view->part()->settings();
+#if APPLE_CHANGES
+            if (printing && !settings->shouldPrintBackgrounds()) {
+                _style->setShouldCorrectTextColor(true);
+            }
+#endif
             QString stdfont = settings->stdFontName();
             if ( !stdfont.isEmpty() ) {
                 fontDef.family.setFamily(stdfont);
diff --git a/WebCore/kwq/KWQKHTMLSettings.h b/WebCore/kwq/KWQKHTMLSettings.h
index 8cd5cbe..4a87bb5 100644
--- a/WebCore/kwq/KWQKHTMLSettings.h
+++ b/WebCore/kwq/KWQKHTMLSettings.h
@@ -75,6 +75,7 @@ public:
     const QString &encoding() const { return _encoding; }
 
     const QString &userStyleSheet() const { return _userStyleSheetLocation; }
+    bool shouldPrintBackgrounds() const { return _shouldPrintBackgrounds; }
 
     void setStdFontName(const QString &s) { _stdFontName = s; }
     void setFixedFontName(const QString &s) { _fixedFontName = s; }
@@ -96,6 +97,7 @@ public:
     void setEncoding(const QString &s) { _encoding = s; }
 
     void setUserStyleSheet(const QString &s) { _userStyleSheetLocation = s; }
+    void setShouldPrintBackgrounds(bool f) { _shouldPrintBackgrounds = f; }
     
 private:
     QString _stdFontName;
@@ -115,6 +117,7 @@ private:
     uint _pluginsEnabled:1;
     uint _JavaScriptEnabled:1;
     uint _JavaScriptCanOpenWindowsAutomatically:1;
+    uint _shouldPrintBackgrounds:1;
     
 };
 
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index a15ce87..7e55513 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -345,6 +345,14 @@ static bool initializedObjectCacheSize = FALSE;
     return _part->isFrameSet();
 }
 
+- (NSString *)styleSheetForPrinting
+{
+    if (!_part->settings()->shouldPrintBackgrounds()) {
+        return @"* { background-image: none !important; background-color: white !important;}";
+    }
+    return nil;
+}
+
 - (void)reapplyStylesForDeviceType:(WebCoreDeviceType)deviceType
 {
     _part->setMediaType(deviceType == WebCoreDeviceScreen ? "screen" : "print");
@@ -353,6 +361,9 @@ static bool initializedObjectCacheSize = FALSE;
         static QPaintDevice screen;
         static QPrinter printer;
     	doc->setPaintDevice(deviceType == WebCoreDeviceScreen ? &screen : &printer);
+        if (deviceType != WebCoreDeviceScreen) {
+            doc->setPrintStyleSheet(QString::fromNSString([self styleSheetForPrinting]));
+        }
     }
     return _part->reparseConfiguration();
 }
diff --git a/WebCore/kwq/WebCoreSettings.h b/WebCore/kwq/WebCoreSettings.h
index c9d9236..0737ddc 100644
--- a/WebCore/kwq/WebCoreSettings.h
+++ b/WebCore/kwq/WebCoreSettings.h
@@ -47,6 +47,7 @@ class KHTMLSettings;
     BOOL JavaScriptEnabled;
     BOOL JavaScriptCanOpenWindowsAutomatically;
     BOOL willLoadImagesAutomatically;
+    BOOL shouldPrintBackgrounds;
     NSString *userStyleSheetLocation;
     NSString *defaultTextEncoding;
     
@@ -98,6 +99,9 @@ class KHTMLSettings;
 - (void)setUserStyleSheetLocation:(NSString *)location;
 - (NSString *)userStyleSheetLocation;
 
+- (void)setShouldPrintBackgrounds:(BOOL)enabled;
+- (BOOL)shouldPrintBackgrounds;
+
 - (void)setDefaultTextEncoding:(NSString *)encoding;
 - (NSString *)defaultTextEncoding;
 
diff --git a/WebCore/kwq/WebCoreSettings.mm b/WebCore/kwq/WebCoreSettings.mm
index a3ac756..adb23de 100644
--- a/WebCore/kwq/WebCoreSettings.mm
+++ b/WebCore/kwq/WebCoreSettings.mm
@@ -274,6 +274,17 @@
     return userStyleSheetLocation;
 }
 
+- (void)setShouldPrintBackgrounds:(BOOL)enabled
+{
+    shouldPrintBackgrounds = enabled;
+    settings->setShouldPrintBackgrounds(enabled);
+}
+
+- (BOOL)shouldPrintBackgrounds
+{
+    return shouldPrintBackgrounds;
+}
+
 - (void)setDefaultTextEncoding:(NSString *)s
 {
     if ([defaultTextEncoding isEqualToString:s]) {
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8d1a8df..91bc983 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,28 @@
+2003-09-17  John Sullivan  <sullivan at apple.com>
+
+	- WebKit part of fix for 3157018 -- Would like option to
+	not print backgrounds	
+
+        Reviewed by Darin
+
+        * WebView.subproj/WebPreferences.h:
+	new accessor methods for new shouldPrintBackgrounds preference
+        * WebView.subproj/WebPreferences.m:
+        (+[WebPreferences initialize]):
+	set initial value for WebKitShouldPrintBackgroundsPreferenceKey
+	to NO
+        (-[WebPreferences shouldPrintBackgrounds]):
+	new method, read NSUserDefaults value
+        (-[WebPreferences setShouldPrintBackgrounds:]):
+	new method, write NSUserDefault value
+
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _updateWebCoreSettingsFromPreferences:]):
+	tell WebCore about value of shouldPrintBackgrounds
+
+        * English.lproj/StringsNotToBeLocalized.txt:
+	Updated for these and other recent changes
+
 2003-09-17  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej.
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index b1f02b4..e957759 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -79,12 +79,12 @@
 "FrameName"
 "GroupName"
 "Helvetica"
+"ISO-8859-1"
 "JoiningCausing"
 "JoiningDual"
 "JoiningOther"
 "JoiningRight"
 "Joy!peff"
-"Library/Icons"
 "Library/Internet Plug-Ins"
 "List count: %d items\n"
 "List total size: %d bytes\n"
@@ -181,6 +181,7 @@
 "WebKitResourceTimedLayoutEnabled"
 "WebKitSansSerifFont"
 "WebKitSerifFont"
+"WebKitShouldPrintBackgroundsPreferenceKey"
 "WebKitStandardFont"
 "WebKitUserStyleSheetEnabledPreferenceKey"
 "WebKitUserStyleSheetLocationPreferenceKey"
@@ -273,6 +274,7 @@
 "visitCount"
 "x"
 "x-apple-web-kit/"
+"~/Library/Icons"
 History.subproj/WebHistoryItem.m:" in \"%@\""
 History.subproj/WebHistoryItem.m:"children"
 History.subproj/WebHistoryItem.m:"title"
@@ -299,7 +301,6 @@ WebView.subproj/WebDataSourcePrivate.m:"Refresh"
 WebView.subproj/WebFrame.m:"utf-16"
 WebView.subproj/WebPreferences.m:"Identifier"
 WebView.subproj/WebPreferences.m:"Values"
-WebView.subproj/WebPreferences.m:"latin1"
 WebView.subproj/WebRenderNode.m
 WebView.subproj/WebView.m:"Preferences"
 WebView.subproj/WebViewPrivate.m:"canGoBack"
diff --git a/WebKit/WebView.subproj/WebPreferences.h b/WebKit/WebView.subproj/WebPreferences.h
index e3aece2..b2143c4 100644
--- a/WebKit/WebView.subproj/WebPreferences.h
+++ b/WebKit/WebView.subproj/WebPreferences.h
@@ -266,4 +266,16 @@ extern NSString *WebPreferencesChangedNotification;
 */
 - (BOOL)autosaves;
 
+/*!
+    @method setShouldPrintBackgrounds:
+    @param flag
+*/
+- (void)setShouldPrintBackgrounds:(BOOL)flag;
+
+/*!
+    @method shouldPrintBackgrounds
+    @result The value of the shouldPrintBackgrounds preferences flag
+*/
+- (BOOL)shouldPrintBackgrounds;
+
 @end
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index 75d4e2a..247ab1b 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -28,6 +28,7 @@
 #define WebKitDefaultTextEncodingNamePreferenceKey @"WebKitDefaultTextEncodingName"
 #define WebKitUserStyleSheetEnabledPreferenceKey @"WebKitUserStyleSheetEnabledPreferenceKey"
 #define WebKitUserStyleSheetLocationPreferenceKey @"WebKitUserStyleSheetLocationPreferenceKey"
+#define WebKitShouldPrintBackgroundsPreferenceKey @"WebKitShouldPrintBackgroundsPreferenceKey"
 #define WebKitJavaEnabledPreferenceKey @"WebKitJavaEnabled"
 #define WebKitJavaScriptEnabledPreferenceKey @"WebKitJavaScriptEnabled"
 #define WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey @"WebKitJavaScriptCanOpenWindowsAutomatically"
@@ -204,6 +205,7 @@ NS_ENDHANDLER
         [NSNumber numberWithBool:YES],  WebKitResourceTimedLayoutEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitUserStyleSheetEnabledPreferenceKey,
         @"",                            WebKitUserStyleSheetLocationPreferenceKey,
+        [NSNumber numberWithBool:NO],   WebKitShouldPrintBackgroundsPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitJavaEnabledPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitJavaScriptEnabledPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
@@ -432,6 +434,16 @@ NS_ENDHANDLER
     [self _setStringValue:locationString forKey: WebKitUserStyleSheetLocationPreferenceKey];
 }
 
+- (BOOL)shouldPrintBackgrounds
+{
+    return [self _boolValueForKey: WebKitShouldPrintBackgroundsPreferenceKey];
+}
+
+- (void)setShouldPrintBackgrounds:(BOOL)flag
+{
+    [self _setBoolValue: flag forKey: WebKitShouldPrintBackgroundsPreferenceKey];
+}
+
 - (BOOL)isJavaEnabled
 {
     return [self _boolValueForKey: WebKitJavaEnabledPreferenceKey];
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index d6d946c..0cf3a79 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -450,6 +450,7 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
     } else {
         [_private->settings setUserStyleSheetLocation:@""];
     }
+    [_private->settings setShouldPrintBackgrounds:[preferences shouldPrintBackgrounds]];
 }
 
 - (void)_releaseUserAgentStrings

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list