Problems with HEAD and latest version of HierMenus [testcase]

David Joham djoham at yahoo.com
Tue Apr 15 03:35:21 BST 2003


This is turning out to be really interesting...

I have created a testcase for you Dirk that I *think* emulates the problem I'm seeing in these
menus.

The really weird part of this recreation is that it does *not* recreate when I build the page
using strict XHTML. For example, using this code:


<html>
  <head>
    <title>Konqueror Hiermenu Recreation</title>
  </head>
  <body>
  <div>
     <input type="button" onclick="go()" value="Click Me First to "Create" a menu" />
      
     <input type="button" onclick="go2()" value="Click Me Second to "Resize" the menus"
/>
  </div>
<script type="text/javascript">
function go() {

	var div1 = document.createElement("div");
   div1.id = "div1";
   div1.style.position = "absolute";
   div1.style.top = "200px";
   div1.style.left = "200px";
	div1.style.border = "solid black 1px";
   div1.style.height = "50px";
   div1.style.width = "100px";
   document.body.appendChild(div1);

   var div2 = document.createElement("div");
   div2.id = "div2";
   div2.style.height = "50px";
	div2.innerHTML = "menu";
   div2.style.backgroundColor = "yellow";
   div2.style.width = "100px";
   div1.appendChild(div2);

}

function go2() {
   //now do the resize

	var div1 = document.getElementById("div1");
   var div2 = document.getElementById("div2");

   div2.style.paddingLeft = "20px";
   div2.style.paddingRight = "20px";
//	alert("If I'm enabled, the following read works.\n Otherwise, it doesn't");
   div1.style.width = div2.offsetWidth;

}


</script>

  </body>
</html>


will demonstrate the problem. If you click the button on the left and then the one on the right,
you'll see that the yellow "menu item" is wider than the "menu" (the div with the black border)
unless you uncomment out the alert. With the alert, I get what I expect.

However, if you replace the <html> in the sourcecode above with

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

the problem goes away(!) I presume this is a "quirks mode" thing?

Even odder, if I tell the hiermenu testpage that it's XHTML using the code above, it doesn't fix
the problem. Possibly because the test page is anything but compliant XHTML?

Does this help you get to the bottom of the problem?


Thanks for your help.

David



--- David Joham <djoham at yahoo.com> wrote:
> Hi Dirk
> 
> > I don't know, but the bug should be elsewhere. is there a somewhat smaller 
> > testcase somewhere?
> 
> Not yet, but I'm trying. I haven't been able to get a smaller test case that recreates the
> problem
> yet. Everything I try seems to work fine. I'll keep trying though.
> 
> > Its probably worth backporting the fix from HEAD to 3.1 branch so that it 
> > works there too. I'm not too fond of adding hacks around konqueror bugs to 
> > these javascript menus.. they tend to cause problems as soon as Konqueror is 
> > fixed. 
> 
> Agreed, assumming we can find a fix :) The problem is minor and doesn't impact usability a whole
> lot. Worst case is that the last part of the menu gets cut off. I also don't think that this
> form
> of the menus is used very often.
> 
> I'll hack on this some more tonight and see if I can get that recreation going. Considering the
> pain of getting the menus to work in the first place, this is a walk in the park :)
> 
> David
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com

__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com




More information about the kfm-devel mailing list