Bug 130955 - Wrong positioning of CSS lists
Summary: Wrong positioning of CSS lists
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Konqueror Developers
Depends on:
Reported: 2006-07-17 03:07 UTC by tilleyrw
Modified: 2006-07-21 16:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:

patch (2.62 KB, patch)
2006-07-17 14:40 UTC, Germain Garand

Note You need to log in before you can comment on or make changes to this bug.
Description tilleyrw 2006-07-17 03:07:15 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Ubuntu Packages

When viewing the page "www.phoenity.com/newtedge/horizontal_nav" CSS lists are correctly displayed in Firefox.  When viewing the same page "www.phoenity.com/newtedge/horizontal_nav" in Konqueror, the css markup displays a thick bar of each main menu with the respective submenus beneath each title.

I prefer to use Konqueror as my browser and am disappointed when Open Source Software projects do not share information about standards compliance.

Hope this helps, Bob
Comment 1 Allan Sandfeld 2006-07-17 10:58:32 UTC
The only issue I see here is that the popup-menus appear at the top of the page instead of near their anchor

Probably the position:absolute that skips the phony position:relative table-cell when considering where to place itself.
Comment 2 Germain Garand 2006-07-17 14:09:35 UTC
mmh, that's right. I think we should support position:relative on table-cell, then.

IE supports it, and 9.3.1 just says it's undefined behaviour, not disallowed, so better fallback to something sensible now that we can.

Opera and Mozilla engines seem to not apply the offset, but still let the cell be a containing block and don't mutate the position property as we do. This is cheesy.
Comment 3 Germain Garand 2006-07-17 14:40:12 UTC
Created attachment 17013 [details]
Comment 4 Germain Garand 2006-07-21 16:48:51 UTC
SVN commit 564852 by ggarand:

honour relative positioning on table cells.

CSS 2.1-9.3.1 says the effect of position:relative on such a display is undefined,
but the offset is applied in MSIE, so lets fallback to being compatible.

BUG: 130955

 M  +13 -6     css/cssstyleselector.cpp  
 M  +1 -1      rendering/render_object.cpp  
 M  +1 -1      rendering/render_table.cpp  

--- branches/KDE/3.5/kdelibs/khtml/css/cssstyleselector.cpp #564851:564852
@@ -662,12 +662,19 @@
-        // After performing the display mutation, check table rows.  We do not honor position:relative on
-        // table rows. This has been established in CSS2.1 (and caused a crash in containingBlock() on
-        // some sites).
-        // Likewise, disallow relative positioning on table sections.
-        if ( style->position() == RELATIVE && (style->display() > INLINE_TABLE && style->display() < TABLE_COLUMN_GROUP) )
-            style->setPosition(STATIC);
+        // After performing the display mutation, check our position.  We do not honor position:relative on
+        // table rows and some other table displays. This is undefined behaviour in CSS2.1 (cf. 9.3.1)
+        if (style->position() == RELATIVE) {
+            switch (style->display()) {
+              case TABLE_ROW_GROUP:
+              case TABLE_HEADER_GROUP:
+              case TABLE_FOOTER_GROUP:
+              case TABLE_ROW:
+                style->setPosition(STATIC);
+              default:
+                break;
+            }
+        }
     // Frames and framesets never honor position:relative or position:absolute.  This is necessary to
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_object.cpp #564851:564852
@@ -587,7 +587,7 @@
 RenderBlock *RenderObject::containingBlock() const
-    if(isTableCell() && !(m_style->position() == ABSOLUTE || m_style->position() == FIXED))
+    if(isTableCell())
         return static_cast<RenderBlock*>( parent()->parent()->parent() );
     if (isCanvas())
         return const_cast<RenderBlock*>( static_cast<const RenderBlock*>(this) );
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_table.cpp #564851:564852
@@ -2283,7 +2283,7 @@
 bool RenderTableCell::requiresLayer() const {
     // table-cell display is never positioned (css 2.1-9.7), so the only time a layer is needed
     // is when overflow != visible (or when there is opacity when we support it)
-    return /* style()->opacity() < 1.0f || */ hasOverflowClip();
+    return /* style()->opacity() < 1.0f || */ hasOverflowClip() || isRelPositioned();
 void RenderTableCell::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f)