Bug 67446

Summary: Double-click hangs browser when there are many SVG elements
Product: WebKit Reporter: aarongoertzen
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: jchaffraix, thorton, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
testcase none

aarongoertzen
Reported 2011-09-01 15:20:27 PDT
The following HTML file reproduces the problem in Chrome and Safari. On page load a script inserts 15K SVG rectangles into the DOM. Then when you double-click on the completely unrelated div element the browser hangs for up to ten seconds before becoming responsive again. The duration of the hang seems to be proportional to the number of SVG rect elements in the DOM. When you insert many non-SVG elements there is no problem. ----- HTML ----- <!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"> <head> </head> <body style="height: 100%; width: 100%;"> <div> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100" id="svg"><defs></defs></svg> </div> <div ondblclick="alert('That took a while');">Double-click here</button> <script> for (var i = 0; i < 15000; i++) { n = document.createElement('rect'); n.setAttribute('x', 0); n.setAttribute('y', 0); n.setAttribute('width', 100); n.setAttribute('height', 100); n.setAttribute('fill', 'blue'); document.getElementById('svg').appendChild(n); } </script> </body> </html>
Attachments
testcase (850 bytes, text/html)
2011-09-01 16:16 PDT, Tim Horton
no flags
Tim Horton
Comment 1 2011-09-01 16:16:35 PDT
Created attachment 106058 [details] testcase
Note You need to log in before you can comment on or make changes to this bug.