Bug 187285 - background-image not used when background-repeat used in body element [testcase][regression]
Summary: background-image not used when background-repeat used in body element [testca...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.2.1
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-16 09:24 UTC by Konrad Rzepecki
Modified: 2009-03-26 06:59 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase (184 bytes, text/html)
2009-03-16 09:25 UTC, Konrad Rzepecki
Details
Shows the content spanning as opposed to the full-body spanning (230 bytes, text/html)
2009-03-17 19:47 UTC, Marcus Harrison
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konrad Rzepecki 2009-03-16 09:24:17 UTC
Version:            (using KDE 4.2.1)
Compiler:          GCC 4.2.X or 4.3.X 
OS:                Linux
Installed from:    Slackware Packages

Konqueror 4.2.X refuses to render background image on body element when repeat-x is set. 3.5.X renders it correctly (as other browsers).

Minimal testcase is below. It should show gradient background it but doesn't. 

<html>
<head>
    <style type="text/css">
body {
    background-image: url('http://dentonet.pl/img/mainbg.png');
    background-repeat: repeat-x;
}
    </style>
</head>
<body>
</body>
</html>


Removing background-repeat property causes to show background. The sigle line version "background:url('http://dentonet.pl/img/mainbg.png') repeat-x;" is also affected.
Comment 1 Konrad Rzepecki 2009-03-16 09:25:29 UTC
Created attachment 32161 [details]
Testcase
Comment 2 Dario Andres 2009-03-16 12:39:24 UTC
I can confirm here using:

Qt: 4.5.0 + qt-copy-patches-936035
KDE: 4.2.66 (KDE 4.2.66 (KDE 4.3 >= 20090310))
kdelibs svn rev. 939600 / kdebase svn rev. 939602
on ArchLinux i686 - Kernel 2.6.28.7
Comment 3 Marcus Harrison 2009-03-17 19:44:32 UTC
Strangely, when the background-repeat option is used, the background only spans to the height of the content. However, when it isn't used, it spans the whole page. The question is whether this is standards compliant or not.
Comment 4 Marcus Harrison 2009-03-17 19:47:34 UTC
Created attachment 32209 [details]
Shows the content spanning as opposed to the full-body spanning
Comment 5 Germain Garand 2009-03-18 01:56:37 UTC
hmm looks like I goofed in r855521.
Will have to look at that, thank you for the testcase.
Comment 6 Konrad Rzepecki 2009-03-18 07:03:49 UTC
Marcus this is not true. Look at http://dentonet.pl/ there is a loot of content beneath the background is not show.
Comment 7 Marcus Harrison 2009-03-18 12:04:48 UTC
(In reply to comment #6)
> Marcus this is not true. Look at http://dentonet.pl/ there is a loot of content
> beneath the background is not show.

It's difficult to test that reliably: looking at the source of the website, a lot of the elements are positioned absolutely - which would ignore the body settings, which is actually compliant to standards. As you can see, the bar at the top isn't positioned absolutely, meaning the body's background does span to its contents.
Comment 8 Konrad Rzepecki 2009-03-18 14:49:58 UTC
> It's difficult to test that reliably: looking at the source of the website, a
> lot of the elements are positioned absolutely

Absoluty are positioned left part of the page (two narrow boxes) and some content of boxes in central part.

The content of the central part is in "relative" div witch contain floated div witch again contain relatives. So "absolute" doesn't match here...


Even if it apply, the background-color shouldn't be draw either. And backgrounds whithout "repeat" property should be also cut.

Whatever will be decided, to cut or not to cut, khtml should do this in consistent way. However I prefer not to cut, as in other browsers.
Comment 9 Maksim Orlovich 2009-03-18 16:25:52 UTC
Bug 172409 may be related.
Comment 10 Marcus Harrison 2009-03-21 16:58:56 UTC
(In reply to comment #8)
> > It's difficult to test that reliably: looking at the source of the website, a
> > lot of the elements are positioned absolutely
> 
> Absoluty are positioned left part of the page (two narrow boxes) and some
> content of boxes in central part.
> 
> The content of the central part is in "relative" div witch contain floated div
> witch again contain relatives. So "absolute" doesn't match here...
> 
> 
> Even if it apply, the background-color shouldn't be draw either. And
> backgrounds whithout "repeat" property should be also cut.
> 
> Whatever will be decided, to cut or not to cut, khtml should do this in
> consistent way. However I prefer not to cut, as in other browsers.

Agreed: as a website designer, I'd like all browsers to behave in a consistent manner - which is kinda the point in standards-compliance.
Comment 11 Germain Garand 2009-03-26 02:07:31 UTC
SVN commit 944739 by ggarand:

fix regression in sizing of the background image for the root element.

this regressed in r855521, as I didn't quite understood all the subtleties
of the background size for the root case.

BUG: 187285


 M  +30 -10    render_box.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=944739
Comment 12 Germain Garand 2009-03-26 02:25:26 UTC
SVN commit 944745 by ggarand:

automatically merged revision 944739:
fix regression in sizing of the background image for the root element.

this regressed in r855521, as I didn't quite understood all the subtleties
of the background size for the root case.

BUG: 187285

 M  +30 -10    render_box.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=944745
Comment 13 Konrad Rzepecki 2009-03-26 06:59:37 UTC
Thanks for quick fix!