Author: rmottola
Date: Fri Jul 25 11:32:45 2014
New Revision: 38008

URL: http://svn.gna.org/viewcvs/gnustep?rev=38008&view=rev
Log:
import patch by Nikolaus, do not show nil image when no background

Modified:
    libs/simplewebkit/trunk/Sources/WebHTMLDocumentView.m

Modified: libs/simplewebkit/trunk/Sources/WebHTMLDocumentView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/simplewebkit/trunk/Sources/WebHTMLDocumentView.m?rev=38008&r1=38007&r2=38008&view=diff
==============================================================================
--- libs/simplewebkit/trunk/Sources/WebHTMLDocumentView.m       (original)
+++ libs/simplewebkit/trunk/Sources/WebHTMLDocumentView.m       Fri Jul 25 
11:32:45 2014
@@ -465,22 +465,6 @@
        NS_ENDHANDLER
        style=[webView computedStyleForElement:self pseudoElement:@""];
 
-#if 0
-       
-       val=[style getPropertyCSSValue:@"background-attachment"];
-       if(val)
-               {
-               }
-       val=[style getPropertyCSSValue:@"background-position"];
-       if(val)
-               {
-               }                       
-       val=[style getPropertyCSSValue:@"background-repeat"];
-       if(val)
-               {
-               }
-#endif
-
        // FIXME: this should not be duplicated in the _splice method
 
        val=[style getPropertyCSSValue:@"background-color"];
@@ -517,21 +501,29 @@
                        }
                }
        val=[style getPropertyCSSValue:@"background-image"];
+       if(val && ![[val _toString] isEqualToString:@"none"])
+               {
+               NSImage *img=nil;
+               // FIXME: load the image
+               [(_WebHTMLDocumentView *) view setBackgroundImage:img];
+               }
+#if 0
+       val=[style getPropertyCSSValue:@"background-attachment"];
        if(val)
                {
-               NSImage *img;
-               img=nil;
-               NSImageView *iv;
-               // FIXME: load the image
-               // FIXME: handle background-repeat: we could create tiles 
sharing the NSImage...
-               // scan all subviews
-               // remove/reuse existing NSImageViews
-               iv=[[NSImageView alloc] initWithFrame:[view frame]];
-               // attach a NSImageView subview to the textview
-               // FIXME: this adds a new subview each time we call _layout!
-               [view addSubview:iv];
-               [iv release];
-               }
+               [(_WebHTMLDocumentView *) view setBackgroundAttachment:[val 
_toString]];
+               }
+       val=[style getPropertyCSSValue:@"background-position"];
+       if(val)
+               {
+               [(_WebHTMLDocumentView *) view setBackgroundPosition:[val 
_toString]];
+               }
+       val=[style getPropertyCSSValue:@"background-repeat"];
+       if(val)
+               {
+               [(_WebHTMLDocumentView *) view setBackgroundRepeat:[val 
_toString]];
+               }
+#endif
        val=[style getPropertyCSSValue:@"x-visited-color"];
        if(val)
                {


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to