[Webkit-unassigned] [Bug 11561] New: Element is incorrectly rendered when is created, removed and created again using DOM methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 10 03:41:34 PST 2006


http://bugs.webkit.org/show_bug.cgi?id=11561

           Summary: Element is incorrectly rendered when is created, removed
                    and created again using DOM methods
           Product: WebKit
           Version: 420+ (nightly)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: mjuhos at kerio.com
                CC: pdousa at kerio.com


Overview Description: 
Element is incorrectly rendered when is created, removed and created again
using DOM methods

Steps to Reproduce: 
1) Open testcase
2) Click into document by right mouse button
3) Move mouse about 50 px right and press right mouse button again

Actual Results: 
DIV element isn't correctly rendered (text in element isn't visible).

Expected Results: 
DIV element will be correctly rendered.

Build Date & Platform: 
    Build 2006-11-10 on Mac OS 10.5.

Test case:
<html>
  <head>
    <style>
      #menu {
        background-color:blue;
        position:absolute;
        width:200px;
      }
    </style>
    <script>
      var k_e;

      function dsp() {
        var k_contextMenu = document.getElementById("menu");
        if (!k_contextMenu) {
          k_contextMenu = document.createElement('div');
          k_contextMenu.id = 'menu';
          for (var i =1; i < 10; i++) {
            k_contextMenu.innerHTML += '<div>item ' + i + '</div>';
          }
          document.body.appendChild(k_contextMenu);
        }
        k_contextMenu.style.left = k_e.clientX + 'px'
        k_contextMenu.style.top = k_e.clientY + 'px';
      }
      function removeMenu() {
        var k_contextMenu = document.getElementById("menu");
        if (k_contextMenu) {
          var k_p = k_contextMenu.parentNode;
          k_p.removeChild(k_contextMenu);
        }
      }

      function showMenu() {
        removeMenu();
        k_e = event;
        dsp();
      }
    </script>
  </head>
  <body oncontextmenu="showMenu();return false;" onmousedown="removeMenu()">
  </body>
</html>

Workaround:
Replace calling of function dsp() by setTimeout('dsp();',0)


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list