Bug 90158

Summary: -webkit-user-select: none causes 1s-2s hangs on large pages
Product: WebKit Reporter: Rob M <rob.miles>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: adele, enrica, ggaren, gveltri, rniwa, rob.miles, webkit-bug-importer
Priority: P2 Keywords: HasReduction, InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Sample HTML file that replicates the defect
none
Another web page test case
none
Second Test Case Version 2 (repro case always happens) none

Description Rob M 2012-06-28 04:07:20 PDT
Created attachment 149921 [details]
Sample HTML file that replicates the defect

Adding the style -webkit-user-select: none to the body tag of a large page causes a significant performance issue.  Javascript event handlers take around 1-2 seconds to fire.
I have attached a sample page that demonstrates this issue.  On the sample page, click anywhere within the page to see the alert box appear after a delay.  Remove the style attribute on the body tag and refresh the page, notice that clicking now causes the alert box to appear almost instantaneously.
This problem is reproducable in both Safari 5.1.7 and Chrome 19.0.1084.56 m
Comment 1 Giacomino Veltri 2013-02-01 20:54:48 PST
Created attachment 186211 [details]
Another web page test case

This test case tests dragging large numbers of objects around on screen*.  To start, simply click the text/grey area and drag.  If you hold CTRL when clicking on the text/grey area, webkitUserSelect will be set to 'none', otherwise it will be set to 'auto'.

Note that I am currently running in Chrome, and that the result I'm seeing is that the performance while dragging is significantly reduced when webkitUserSelect is set to 'none'.

* The particular project I am working on currently requires large numbers of DOM elements (and I'd like to have the text not get selected :) ).
Comment 2 Ryosuke Niwa 2013-02-02 23:06:42 PST
Could you post the latter test case as a HTML document on Bugzilla? We need a BSD licensed reduction. Also, on Mac, control+click appears to cause WebKit to show context menu so that's not convenient for me. Could you make it so that it always reproduces?
Comment 3 Giacomino Veltri 2013-02-04 11:28:57 PST
Created attachment 186422 [details]
Second Test Case Version 2 (repro case always happens)

Here is a second revision of the second test case.  This test case tests dragging large numbers of objects around on screen*.  To start, simply click the text/grey area and drag; webkitUserSelect is always set to 'none', so the bug should reproduce all the time.
Comment 4 Radar WebKit Bug Importer 2013-02-05 01:33:46 PST
<rdar://problem/13151522>