Bug#380153: konqueror: Konqueror not applying CSS to MENU elements correctly
Package: konqueror
Version: 4:3.5.3-2
Severity: normal
Given identical HTML and identical CSS, except for the difference that one uses
the MENU tag and the other uses the UL tag, Konqueror will render the one that
uses MENU in a very inconsistent way.
The following HTML snippet illustrates the problem:
----------- cut here -------------- 8< -----------------------------
<style type="text/css">
html, body {
color: black;
background-color: white;
}
/* All links */
#topnav a {
text-decoration: none;
color: inherit;
padding-left: 0.5em;
padding-right: 0.5em;
}
#topnav a:hover {
color: white;
background-color: black;
}
#topnav ul {
list-style: none;
}
/* Main horizontal menu */
#topnav ul li {
float: left;
}
/* Submenus */
#topnav li > ul {
display: none;
}
#topnav li:hover > ul {
display: block;
}
#topnav li ul {
position: absolute;
float: none;
padding-left: 0;
border: 2px solid black;
}
#topnav li ul li {
display: block;
position: relative;
float: none;
}
#topnav li ul li a {
display: block;
}
</style>
<div id=topnav>
<ul>
<li><a href="#">File</a>
<ul>
<li><a href="#">New</a>
<li><a href="#">Open</a>
<li><a href="#">Close</a>
<li><a href="#">Save</a>
<li><a href="#">Quit</a>
</ul>
<li><a href="#">Edit</a>
<ul>
<li><a href="#">Undo</a>
<li><a href="#">Cut</a>
<li><a href="#">Copy</a>
<li><a href="#">Paste</a>
</ul>
<li><a href="#">View</a>
<li><a href="#">Help</a>
</ul>
</div>
----------- cut here -------------- 8< -----------------------------
This will generate a screen that looks like a normal GUI with File,
Edit, View and Help menus. If the user hovers the cursor over File
or Edit, a submenu is displayed; i.e., the screen looks like this:
File Edit View Help
and, when hovered over File,
File Edit View Help
New
Open
Close
Save
Quit
and, when hovered over Edit,
File Edit View Help
Undo
Cut
Copy
Paste
This is also the way Mozilla displays the HTML.
If the "ul" tags are replaced with "menu" tags, the screen will
look completely garbled like this:
File New Open Close Save Quit * Edit
* View
* Help
The visible differences between this and how Konqueror renders the
"ul" version are:
- The first submenu are interspersed between File and Edit
- Unexpected bullets and alignment for the last 3 items
The inconsistencies seem to be caused by Konqueror being confused
by nested MENU elements, as can be seen from the following symptoms:
- The text contained inside the LI elements inside the nested MENU
are displayed as if they were part of the outermost MENU
- The close tag of the nested MENU caused Konqueror to think that
the outermost MENU has closed
- Subsequent LI elements seem to have caused Konqueror to insert
an implicit UL, thus causing the styling for MENU (specifically
the list-style and float properties) to be not applied
- The Edit MENU is nested within the implicit UL (if UL is indeed
the implicitly-inserted tag), and Konqueror is thus not confused
by the nesting, and displays the submenu as expected
The behaviour of MENU should be identical to UL. So nested MENU's
are definitely allowed.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.4.28-ow1
Locale: LANG=zh_TW.Big5, LC_CTYPE=zh_TW.Big5 (charmap=BIG5)
Versions of packages konqueror depends on:
ii kcontrol 4:3.5.3-2 control center for KDE
ii kdebase-kio-plugins 4:3.5.3-2 core I/O slaves for KDE
ii kdelibs4c2a 4:3.5.3-1 core libraries and binaries for al
ii kdesktop 4:3.5.3-2 miscellaneous binaries and files f
ii kfind 4:3.5.3-2 file-find utility for KDE
ii libacl1 2.2.39-1 Access control list shared library
ii libart-2.0-2 2.3.17-1 Library of functions for 2D graphi
ii libattr1 2.4.32-1 Extended attribute shared library
ii libaudio2 1.8-1 The Network Audio System (NAS). (s
ii libc6 2.3.6-15 GNU C Library: Shared libraries
ii libfam0 2.7.0-10 Client library to control the FAM
ii libfontconfig1 2.3.2-7 generic font configuration library
ii libfreetype6 2.2.1-2 FreeType 2 font engine, shared lib
ii libgcc1 1:4.1.1-5 GCC support library
ii libice6 1:1.0.0-3 X11 Inter-Client Exchange library
ii libidn11 0.6.5-1 GNU libidn library, implementation
ii libjpeg62 6b-13 The Independent JPEG Group's JPEG
ii libkonq4 4:3.5.3-2 core libraries for Konqueror
ii libpng12-0 1.2.8rel-5.1 PNG library - runtime
ii libqt3-mt 3:3.3.6-2 Qt GUI Library (Threaded runtime v
ii libsm6 1:1.0.0-4 X11 Session Management library
ii libstdc++6 4.1.1-5 The GNU Standard C++ Library v3
ii libx11-6 2:1.0.0-7 X11 client-side library
ii libxcursor1 1.1.5.2-5 X cursor management library
ii libxext6 1:1.0.0-4 X11 miscellaneous extension librar
ii libxft2 2.1.8.2-8 FreeType-based font drawing librar
ii libxi6 1:1.0.0-5 X11 Input extension library
ii libxinerama1 1:1.0.1-4 X11 Xinerama extension library
ii libxrandr2 2:1.1.0.2-4 X11 RandR extension library
ii libxrender1 1:0.9.0.2-4 X Rendering Extension client libra
ii libxt6 1:1.0.0-5 X11 toolkit intrinsics library
ii zlib1g 1:1.2.3-13 compression library - runtime
konqueror recommends no packages.
-- no debconf information
Reply to: