Bug 43546 - wrong stacking context with mixed fixed and absolute positioning
Summary: wrong stacking context with mixed fixed and absolute positioning
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 47871 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-05 09:18 UTC by mah
Modified: 2004-02-09 01:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
testcase (696 bytes, text/html)
2002-09-27 03:50 UTC, djoham
Details
real world example of xhtml-strict page demonstrating the problem (13.33 KB, text/html)
2002-09-27 03:58 UTC, djoham
Details
stripped down testcase (1.17 KB, text/html)
2003-07-25 03:45 UTC, djoham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mah 2002-06-05 09:06:41 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           khtml
Version:           KDE 3.0.5 CVS/CVSup/Snapshot
Severity:          normal
Installed from:    Compiled sources
Compiler:          gcc 2.96
OS:                Linux
OS/Compiler notes: Not Specified

The containing block is different for fixedly and absolutely positioned elements and leads to different specialObjects list being used for these elements. This results in placing the fixedly positioned elements always above all absolutely positioned objects in stacking order.

Here is a simple test case that is rendered correctly e.g. with mozilla and opera but in konqueror the div number 2 is raised erronously above 3 and 4.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Stacking order test</title>
<style type="text/css">
div.fix {
   position : fixed;
   width : 10em;
   height : 10em;
   }
div.abs {
   position : absolute;
   width : 10em;
   height : 10em;
   }
</style>
</head>
<body>
<div class="abs"
 style="top : 1em; left : 1em; background-color: #f00;">1</div>
<div class="fix" style="top : 3em; left : 3em; background-color: #0f0;">2</div>
<div class="abs" style="top : 5em; left : 5em; background-color: #00f;">3</div>
<div class="abs" style="top : 7em; left : 7em; background-color: #ff0;">4</div>
</body>
</html>


(Submitted via bugs.kde.org)
Comment 1 Ingo Klöcker 2002-09-24 15:12:34 UTC
Here's a real world test case that is displayed correctly in Opera and  
Mozilla:  
http://www.mathA.rwth-aachen.de/index_bg.html  
 
In section 9.9 of the CSS2 specs 
(http://www.w3.org/TR/REC-CSS2/visuren.html#q30) is described that the stack 
level depends on the stacking context of the parent's box and not on the 
stacking context of the containing block (which is what Konqueror seems to 
assume). This means that 'absolute' and 'fixed' positioned elements have to be 
treated the same way with respect to the stack level. 
 
Comment 2 Ingo Klöcker 2002-09-24 15:14:41 UTC
*** Bug 47871 has been marked as a duplicate of this bug. ***
Comment 3 djoham 2002-09-27 03:49:34 UTC
  
Hello,  
  
I'm running into a similar problem with css position: relative on some web  
pages I'm building for our LaserJets (I work for Hewlett-Packard). Konqueror 
does not respect the z-index in situations where divs are positioned with css 
position: relative. I'll attach a test case as well at the real-world XHTML 
that I'm generating to demonstrate the issue.  
Comment 4 djoham 2002-09-27 03:50:54 UTC
Created attachment 90 [details]
testcase

this test case is a very small recreation of the problem. Mozilla IE and Opera
render correctly.
Comment 5 djoham 2002-09-27 03:58:25 UTC
Created attachment 91 [details]
real world example of xhtml-strict page demonstrating the problem

Here's a snippit of code that I'm developing for our next generation laserjets.
It demonstrates a real-world example of the problem.
Comment 6 Paul de Vrieze 2002-10-22 13:08:45 UTC
I've got the same problem. I'm eager to see it solved.
Comment 7 djoham 2003-07-25 03:45:58 UTC
Created attachment 2060 [details]
stripped down testcase

Here is a much stripped down version of the real world test case. It's as small
as I can make it (it's pretty small) and still have it relevant to the XHTML I
use. Also note that while Konq's behavior has changed in CVS HEAD, the first
test case is still mis-rendering
Comment 8 djoham 2003-07-25 03:49:52 UTC
Lastly, just so that there is no confusion, the correct rendering would be no black line 
under the word "information" in the stripped down testcase.  
Comment 9 Sashmit Bhaduri 2003-09-28 09:06:51 UTC
still buggy in kde 3.2a2. 
Comment 10 Paul de Vrieze 2004-02-08 22:20:20 UTC
This seems to be fixed with 3.2
Comment 11 Ingo Klöcker 2004-02-09 01:12:17 UTC
I can confirm that my test case (cf. comment #1) and all the others are now rendered correctly.