Summary: | Konqueror not applying CSS to MENU elements correctly | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Ambrose Li <ambrose.li> |
Component: | general | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | losinski |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Example of the problem
Test case with menu tags |
Description
Ambrose Li
2007-05-30 18:21:09 UTC
Could you please attach your example as a fire? Bugzilla seems to have messed it up Created attachment 20731 [details]
Example of the problem
My example is attached. It should work correctly on Konqueror as-is, but if we replace all UL tags with MENU tags, then it would stop working. Created attachment 20739 [details]
Test case with menu tags
mmh, MENU and DIR are complete legacy elements and should be treated exactly as UL. It's not the case presently. There are at least couple factors in that... Here are some diffs in their handling at least: 1) dtd.cpp treats them a bit differently --- that actually matches the official DTD(!) but I suspect that's in error... but doing the below doesn't seem to make a diff (I really need that DOM tree viewer built!) --- html/dtd.cpp (revision 669932) +++ html/dtd.cpp (working copy) @@ -674,13 +674,11 @@ return check_array(childID, tag_list_6) || check_array(childID, tag_list_1); case ID_OL: case ID_UL: + case ID_DIR: + case ID_MENU: // OL: LI + + // For DIR and MENU, the DTD says - %block, but it contradicts spec language.. return check_array(childID, tag_list_1); - case ID_DIR: - case ID_MENU: - // (DIR|MENU): LI + - _3 - if(childID == ID_LI) return true; - return false; case ID_FORM: // FORM: _1 * - FORM return check_array(childID, tag_list_1); .. Oh, woops, there is also additional stuff in add/removeForbidden. WIll try with it 2) the default style sheet doesn't quite handle them the same... OK, so if I change the forbidden tags stuff as well, it mostly works -- but there is a huge space between the menu and menubar.. I presume it's due to the default CSS? > I presume it's due to the default CSS?
I'd think so, yes... we have a complex set of rules for nested ul that suppress the top/bottom margins. Those don't take menu and dir into account, so it might be just that.
Your changes look fine otherwise but I see a couple occurences of direct ID_UL usage in rendering/render_{list,object}.cpp where ID_MENU/ID_DIR could be added for sake of completness.
if you persist in not applying that patch, I will :) Feel free, my patches-to-apply buffer is overflowing ... SVN commit 691136 by ggarand: fix MENU/DIR tags handling and default css styling. patch by Maksim Orlovich and me. BUG: 146165 M +25 -10 css/html4.css M +3 -63 html/dtd.cpp M +2 -1 rendering/render_list.cpp --- trunk/KDE/kdelibs/khtml/css/html4.css #691135:691136 @@ -258,16 +258,30 @@ -khtml-flow-mode: -khtml-around-floats; } - -ul ul, ol ul { - list-style-type: circle; +ul ul ul, ul ol ul, ul menu ul, ul dir ul, +ol ul ul, ol ol ul, ol menu ul, ol dir ul, +menu ul ul, menu ol ul, menu menu ul, menu dir ul, +dir ul ul, dir ol ul, dir menu ul, dir dir ul, +ul ul menu, ul ol menu, ul menu menu, ul dir menu, +ol ul menu, ol ol menu, ol menu menu, ol dir menu, +menu ul menu, menu ol menu, menu menu menu, menu dir menu, +dir ul menu, dir ol menu, dir menu menu, dir dir menu, +ul ul dir, ul ol dir, ul menu dir, ul dir dir, +ol ul dir, ol ol dir, ol menu dir, ol dir dir, +menu ul dir, menu ol dir, menu menu dir, menu dir dir, +dir ul dir, dir ol dir, dir menu dir, dir dir dir +{ + list-style-type: square; } -ol ol ul, ol ul ul, ul ol ul, ul ul ul { - list-style-type: square; +ul ul, ul ol, ul menu, ul dir, +ol ul, ol ol, ol menu, ol dir, +menu ul, menu ol, menu menu, menu dir, +dir ul, dir ol, dir menu, dir dir +{ + list-style-type: circle; } - dd { display: block; } @@ -289,10 +303,11 @@ display: compact; } -ol ul, -ul ol, -ul ul, -ol ol { +ol ul, ol menu, ol dir, ol ol, +ul ul, ul menu, ul dir, ul ol, +menu ul, menu menu, menu dir, menu ol, +dir ul, dir menu, dir dir, dir ol +{ margin-top: auto; margin-bottom: auto; } --- trunk/KDE/kdelibs/khtml/html/dtd.cpp #691135:691136 @@ -552,14 +552,12 @@ (!strict && check_flow(childID, true)); case ID_OL: case ID_UL: + case ID_DIR: + case ID_MENU: // OL: LI + + // For DIR and MENU, the DTD says - %block, but it contradicts spec language.. return (childID == ID_LI || childID == ID_TEXT) || (!strict && check_flow(childID, true)); - case ID_DIR: - case ID_MENU: - // (DIR|MENU): LI + - _3 - if(childID == ID_LI) return true; - return false; case ID_FORM: // FORM: %flow * - FORM return check_flow(childID, strict); @@ -674,35 +672,6 @@ //forbiddenTags[ID_SUP]++; forbiddenTags[ID_BASEFONT]++; break; - case ID_DIR: - case ID_MENU: - forbiddenTags[ID_P]++; - forbiddenTags[ID_H1]++; - forbiddenTags[ID_H2]++; - forbiddenTags[ID_H3]++; - forbiddenTags[ID_H4]++; - forbiddenTags[ID_H5]++; - forbiddenTags[ID_H6]++; - forbiddenTags[ID_UL]++; - forbiddenTags[ID_OL]++; - forbiddenTags[ID_DIR]++; - forbiddenTags[ID_MENU]++; - forbiddenTags[ID_PRE]++; - forbiddenTags[ID_PLAINTEXT]++; - forbiddenTags[ID_XMP]++; - forbiddenTags[ID_DL]++; - forbiddenTags[ID_DIV]++; - forbiddenTags[ID_CENTER]++; - forbiddenTags[ID_NOSCRIPT]++; - forbiddenTags[ID_NOFRAMES]++; - forbiddenTags[ID_BLOCKQUOTE]++; - forbiddenTags[ID_FORM]++; - forbiddenTags[ID_ISINDEX]++; - forbiddenTags[ID_HR]++; - forbiddenTags[ID_TABLE]++; - forbiddenTags[ID_FIELDSET]++; - forbiddenTags[ID_ADDRESS]++; - break; case ID_LABEL: forbiddenTags[ID_LABEL]++; break; @@ -746,35 +715,6 @@ //forbiddenTags[ID_SUP]--; forbiddenTags[ID_BASEFONT]--; break; - case ID_DIR: - case ID_MENU: - forbiddenTags[ID_P]--; - forbiddenTags[ID_H1]--; - forbiddenTags[ID_H2]--; - forbiddenTags[ID_H3]--; - forbiddenTags[ID_H4]--; - forbiddenTags[ID_H5]--; - forbiddenTags[ID_H6]--; - forbiddenTags[ID_UL]--; - forbiddenTags[ID_OL]--; - forbiddenTags[ID_DIR]--; - forbiddenTags[ID_MENU]--; - forbiddenTags[ID_PRE]--; - forbiddenTags[ID_PLAINTEXT]--; - forbiddenTags[ID_XMP]--; - forbiddenTags[ID_DL]--; - forbiddenTags[ID_DIV]--; - forbiddenTags[ID_CENTER]--; - forbiddenTags[ID_NOSCRIPT]--; - forbiddenTags[ID_NOFRAMES]--; - forbiddenTags[ID_BLOCKQUOTE]--; - forbiddenTags[ID_FORM]--; - forbiddenTags[ID_ISINDEX]--; - forbiddenTags[ID_HR]--; - forbiddenTags[ID_TABLE]--; - forbiddenTags[ID_FIELDSET]--; - forbiddenTags[ID_ADDRESS]--; - break; case ID_LABEL: forbiddenTags[ID_LABEL]--; break; --- trunk/KDE/kdelibs/khtml/rendering/render_list.cpp #691135:691136 @@ -115,7 +115,8 @@ break; if (currChild->style()->htmlHacks() && currChild->element() && - (currChild->element()->id() == ID_UL || currChild->element()->id() == ID_OL)) + (currChild->element()->id() == ID_UL || currChild->element()->id() == ID_OL || + currChild->element()->id() == ID_DIR || currChild->element()->id() == ID_MENU)) break; RenderObject* lineBox = getParentOfFirstLineBox(currChild, marker); *** Bug 155279 has been marked as a duplicate of this bug. *** |