Bug 27683 - div { display: none; } makes pasting into text fields impossible
Summary: div { display: none; } makes pasting into text fields impossible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ryosuke Niwa
URL: http://ryankinal.cogia.net/test.php
Keywords: InRadar
Depends on: 54179
Blocks: 66754
  Show dependency treegraph
 
Reported: 2009-07-25 14:14 PDT by ryan.kinal
Modified: 2012-05-25 01:05 PDT (History)
14 users (show)

See Also:


Attachments
Test HTML file with same source as link. Shows inability to paste. (212 bytes, text/html)
2009-07-25 14:14 PDT, ryan.kinal
no flags Details
fixes the bug (8.23 KB, patch)
2011-10-28 18:05 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Updated changelog (8.13 KB, patch)
2011-10-28 18:20 PDT, Ryosuke Niwa
enrica: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ryan.kinal 2009-07-25 14:14:52 PDT
Created attachment 33496 [details]
Test HTML file with same source as link. Shows inability to paste.

If divs are set to display: none in CSS, you are unable to paste text into <input type="text"> elements or <textarea> elements. See example at http://ryankinal.cogia.net/test.php (source attached).
Comment 1 Alexey Proskuryakov 2009-07-25 22:45:39 PDT
Confirmed with r46038.
Comment 2 Alexey Proskuryakov 2009-07-25 22:46:46 PDT
<rdar://problem/7093024>
Comment 3 Ryosuke Niwa 2011-10-28 18:05:39 PDT
http://crbug.com/86680
Comment 4 Ryosuke Niwa 2011-10-28 18:05:48 PDT
Created attachment 112955 [details]
fixes the bug
Comment 5 Ryosuke Niwa 2011-10-28 18:20:49 PDT
Created attachment 112956 [details]
Updated changelog
Comment 6 Ryosuke Niwa 2011-10-31 23:45:12 PDT
Any reviewers?
Comment 7 Enrica Casucci 2011-11-01 17:44:54 PDT
Comment on attachment 112956 [details]
Updated changelog

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

> Source/WebCore/editing/ReplaceSelectionCommand.cpp:170
> +    restoreAndRemoveTestRenderingNodesToFragment(holder.get());

Could you explain why you've added the statements above? I don't understand.

> Source/WebCore/editing/ReplaceSelectionCommand.cpp:187
> +        restoreAndRemoveTestRenderingNodesToFragment(holder.get());

Ditto.
Comment 8 Ryosuke Niwa 2011-11-01 17:48:12 PDT
Comment on attachment 112956 [details]
Updated changelog

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

>> Source/WebCore/editing/ReplaceSelectionCommand.cpp:170
>> +    restoreAndRemoveTestRenderingNodesToFragment(holder.get());
> 
> Could you explain why you've added the statements above? I don't understand.

I had to move the statements in lines 182-187 here because otherwise it would interfere with the way handleBeforeTextInsertedEvent calculates the current length.
The change log comment "In addition, remove the node before dispatching beforeTextInserted event to avoid event listeners, in particular TextFieldInputType::handleBeforeTextInsertedEvent, from seeing the test node." corresponds to this point.

>> Source/WebCore/editing/ReplaceSelectionCommand.cpp:187
>> +        restoreAndRemoveTestRenderingNodesToFragment(holder.get());
> 
> Ditto.

This code had to added because 182-187 had to be moved above editableRoot->dispatchEvent(evt, ec).
Comment 9 Enrica Casucci 2011-11-02 09:21:42 PDT
Comment on attachment 112956 [details]
Updated changelog

Thanks for the explanation. Looks good to me.
Comment 10 Ryosuke Niwa 2011-11-02 09:44:14 PDT
Thanks for the review!
Comment 11 Ryosuke Niwa 2011-11-02 10:12:11 PDT
Committed r99076: <http://trac.webkit.org/changeset/99076>
Comment 12 Alexey Proskuryakov 2011-11-03 10:24:37 PDT
This caused bug 71483.