Bug 106287 - [Chromium] Cannot copy text when selecting readonly (or disabled) input elements
Summary: [Chromium] Cannot copy text when selecting readonly (or disabled) input elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shinya Kawanaka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 18:27 PST by Shinya Kawanaka
Modified: 2013-01-29 18:10 PST (History)
9 users (show)

See Also:


Attachments
Patch (10.00 KB, patch)
2013-01-07 18:35 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Build Test (14.59 KB, patch)
2013-01-08 20:18 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Build Test (14.38 KB, patch)
2013-01-08 21:49 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (15.64 KB, patch)
2013-01-08 22:59 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (13.10 KB, patch)
2013-01-28 18:33 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (11.26 KB, patch)
2013-01-28 19:01 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch for landing (15.75 KB, patch)
2013-01-28 21:11 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 2013-01-07 18:27:00 PST
This is related to Bug 85244.
When selecting text on disabled input element, we cannot paste the selected string by mid-click on X Window.

Since the input element is disabled, the inner element of the input element is not editable.
So in WebViewImpl::caretOrSelectionRange, rootEditableElementOrDocumentElement() returns document element.
However the range is in different tree scope.

We should return ShadowRoot instead of document here.
Comment 1 Shinya Kawanaka 2013-01-07 18:35:15 PST
Created attachment 181620 [details]
Patch
Comment 2 Build Bot 2013-01-07 18:56:48 PST
Comment on attachment 181620 [details]
Patch

Attachment 181620 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15736950
Comment 3 Build Bot 2013-01-07 19:52:25 PST
Comment on attachment 181620 [details]
Patch

Attachment 181620 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15738967
Comment 4 Peter Beverloo (cr-android ews) 2013-01-07 20:00:31 PST
Comment on attachment 181620 [details]
Patch

Attachment 181620 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/15734946
Comment 5 Shinya Kawanaka 2013-01-08 20:18:05 PST
Created attachment 181829 [details]
Build Test
Comment 6 Peter Beverloo (cr-android ews) 2013-01-08 21:41:48 PST
Comment on attachment 181829 [details]
Build Test

Attachment 181829 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/15757376
Comment 7 Shinya Kawanaka 2013-01-08 21:49:53 PST
Created attachment 181842 [details]
Build Test
Comment 8 Shinya Kawanaka 2013-01-08 22:59:02 PST
Created attachment 181852 [details]
Patch
Comment 9 Hajime Morrita 2013-01-24 19:42:17 PST
Comment on attachment 181852 [details]
Patch

Can we make the tests LayoutTest?
Comment 10 Dominic Cooney 2013-01-28 06:08:50 PST
Comment on attachment 181852 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=181852&action=review

I am not a reviewer, but I have two comments and a question inline.

> Source/WebCore/ChangeLog:3
> +        [Chromium] Cannot copy text when selecting readonly (or disable) input elements.

disable => disabled

> Source/WebCore/ChangeLog:13
> +        We should use ShadowRoot instead of document so that we can stay in the same tree scope.

Nice explanation of the issue.

> Source/WebCore/editing/FrameSelection.h:138
>      Element* rootEditableElementOrDocumentElement() const;

What is your opinion about this method? It has many callers. Are they all likely to need updating? (Not in this patch, of course.)
Comment 11 Shinya Kawanaka 2013-01-28 17:50:04 PST
Comment on attachment 181852 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=181852&action=review

>> Source/WebCore/editing/FrameSelection.h:138
>>      Element* rootEditableElementOrDocumentElement() const;
> 
> What is your opinion about this method? It has many callers. Are they all likely to need updating? (Not in this patch, of course.)

Basically they should be updated.
Comment 12 Shinya Kawanaka 2013-01-28 18:33:39 PST
Created attachment 185129 [details]
Patch
Comment 13 Hajime Morrita 2013-01-28 18:44:20 PST
Comment on attachment 185129 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=185129&action=review

> Source/WebKit/chromium/tests/WebViewTest.cpp:694
> +    EXPECT_EQ(length, 29UL);

Let's do some strlen()-like thing for explaining the magic number.
Comment 14 Shinya Kawanaka 2013-01-28 19:01:15 PST
Created attachment 185131 [details]
Patch
Comment 15 Build Bot 2013-01-28 19:42:52 PST
Comment on attachment 185131 [details]
Patch

Attachment 185131 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/16163910
Comment 16 Shinya Kawanaka 2013-01-28 21:11:12 PST
Created attachment 185146 [details]
Patch for landing
Comment 17 Shinya Kawanaka 2013-01-28 21:12:14 PST
Waiting for bots green
Comment 18 WebKit Review Bot 2013-01-29 18:10:00 PST
Comment on attachment 185146 [details]
Patch for landing

Clearing flags on attachment: 185146

Committed r141196: <http://trac.webkit.org/changeset/141196>
Comment 19 WebKit Review Bot 2013-01-29 18:10:05 PST
All reviewed patches have been landed.  Closing bug.