Bug 60000 - WebKit allows selection that crosses the shadow boundary of a readonly input element
Summary: WebKit allows selection that crosses the shadow boundary of a readonly input ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 59435
  Show dependency treegraph
 
Reported: 2011-05-02 18:31 PDT by Ryosuke Niwa
Modified: 2011-05-03 15:15 PDT (History)
9 users (show)

See Also:


Attachments
demo (90 bytes, text/html)
2011-05-02 18:31 PDT, Ryosuke Niwa
no flags Details
DRT test (3.54 KB, text/html)
2011-05-02 22:14 PDT, Ryosuke Niwa
no flags Details
fixes the bug (218.61 KB, patch)
2011-05-02 22:43 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
fixed select-across-readonly-input-5.html (218.90 KB, patch)
2011-05-02 22:48 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-05-02 18:31:18 PDT
In the attached document, you can create a selection starting inside an input element and ending outside of the input element by a mouse drag.
Comment 1 Ryosuke Niwa 2011-05-02 18:31:39 PDT
Created attachment 92029 [details]
demo
Comment 2 Alexey Proskuryakov 2011-05-02 21:27:51 PDT
This is not a regression from Safari 5. I actually wonder if it's a bug or intended behavior.
Comment 3 Ryosuke Niwa 2011-05-02 21:34:23 PDT
(In reply to comment #2)
> This is not a regression from Safari 5. I actually wonder if it's a bug or intended behavior.

I don't think this can be an intended behavior.  SelectionController has a selection that crosses the shadow boundary.
Comment 4 Ryosuke Niwa 2011-05-02 21:36:20 PDT
For what's worth, window.getSelection().toString() returns "" and baseNode and extentExtent of DOMSelection report incorrect nodes.
Comment 5 Alexey Proskuryakov 2011-05-02 21:54:33 PDT
See also: bug 7275 (not very closely related).
Comment 6 Ryosuke Niwa 2011-05-02 22:14:59 PDT
Created attachment 92046 [details]
DRT test

Here's a half-baked DRT test.  I'm going to abandon this test and write a bunch of pixel tests because it can only indirectly check the behavior and it's not suitable as a regression test.
Comment 7 Ryosuke Niwa 2011-05-02 22:43:46 PDT
Created attachment 92049 [details]
fixes the bug
Comment 8 Ryosuke Niwa 2011-05-02 22:48:16 PDT
Created attachment 92050 [details]
fixed select-across-readonly-input-5.html
Comment 9 WebKit Commit Bot 2011-05-03 15:12:31 PDT
The commit-queue encountered the following flaky tests while processing attachment 92050 [details]:

http/tests/xmlhttprequest/cross-origin-authorization.html bug 52398 (author: ap@webkit.org)
The commit-queue is continuing to process your patch.
Comment 10 WebKit Commit Bot 2011-05-03 15:14:58 PDT
Comment on attachment 92050 [details]
fixed select-across-readonly-input-5.html

Clearing flags on attachment: 92050

Committed r85669: <http://trac.webkit.org/changeset/85669>
Comment 11 WebKit Commit Bot 2011-05-03 15:15:05 PDT
All reviewed patches have been landed.  Closing bug.