Bug 157443 - Copying content with shadow DOM doesn't copy any contents
Summary: Copying content with shadow DOM doesn't copy any contents
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on: 190028 190073 190086 190108
Blocks: 148695
  Show dependency treegraph
 
Reported: 2016-05-06 19:30 PDT by Ryosuke Niwa
Modified: 2018-10-02 23:28 PDT (History)
9 users (show)

See Also:


Attachments
WIP (27.10 KB, patch)
2018-09-29 01:50 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
WIP2 (27.30 KB, patch)
2018-09-29 19:46 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
WIP3 (42.36 KB, patch)
2018-09-30 21:49 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Adds the support (66.05 KB, patch)
2018-10-02 02:14 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixed a typo (66.05 KB, patch)
2018-10-02 12:12 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixed GTK+ build (66.23 KB, patch)
2018-10-02 17:14 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2 (9.61 MB, application/zip)
2018-10-02 20:01 PDT, Build Bot
no flags Details
Patch for landing (71.07 KB, patch)
2018-10-02 21:12 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 2016-05-06 19:30:30 PDT
When a selected range contains a shadow host, we should be serializing the composed tree so that the user can copy & paste contents.

<rdar://problem/24944602>
Comment 1 Ryosuke Niwa 2018-09-29 01:50:27 PDT
Created attachment 351175 [details]
WIP
Comment 2 Ryosuke Niwa 2018-09-29 19:46:55 PDT
Created attachment 351207 [details]
WIP2
Comment 3 Ryosuke Niwa 2018-09-30 21:49:23 PDT
Created attachment 351225 [details]
WIP3
Comment 4 Ryosuke Niwa 2018-09-30 21:50:57 PDT
Pretty much done with adding the support for copying plain text and HTML.
Comment 5 Ryosuke Niwa 2018-10-02 02:14:10 PDT
Created attachment 351360 [details]
Adds the support
Comment 6 Build Bot 2018-10-02 02:17:36 PDT
Attachment 351360 [details] did not pass style-queue:


ERROR: Source/WebCore/editing/markup.cpp:340:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
Total errors found: 1 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Geoffrey Garen 2018-10-02 10:23:35 PDT
In file included from /Volumes/Data/EWS/WebKit/WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource228.cpp:2:
./editing/TextIterator.cpp:349:5: error: use of undeclared identifier 'ASSSERT'
    ASSSERT(comparePositions(start, end) <= 0);
    ^
1 error generated.
Comment 8 Ryosuke Niwa 2018-10-02 12:12:12 PDT
Created attachment 351428 [details]
Fixed a typo
Comment 9 Build Bot 2018-10-02 12:15:28 PDT
Attachment 351428 [details] did not pass style-queue:


ERROR: Source/WebCore/editing/markup.cpp:340:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
Total errors found: 1 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Ryosuke Niwa 2018-10-02 17:14:48 PDT
Created attachment 351459 [details]
Fixed GTK+ build
Comment 11 Build Bot 2018-10-02 17:17:15 PDT
Attachment 351459 [details] did not pass style-queue:


ERROR: Source/WebCore/editing/markup.cpp:340:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
Total errors found: 1 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Wenson Hsieh 2018-10-02 19:32:53 PDT
Comment on attachment 351459 [details]
Fixed GTK+ build

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

> Source/WebCore/editing/markup.cpp:633
> +    for (Node* n = startNode; n != pastEnd; lastNode = n, n = next) {

auto*?

> Source/WebCore/editing/markup.cpp:833
> +    Node* nodeA = commonScope->ancestorNodeInThisScope(a.containerNode());

auto*
Comment 13 Build Bot 2018-10-02 20:01:57 PDT
Comment on attachment 351459 [details]
Fixed GTK+ build

Attachment 351459 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/9434856

New failing tests:
editing/pasteboard/copy-paste-across-shadow-boundaries-3.html
editing/pasteboard/copy-paste-across-shadow-boundaries-4.html
editing/pasteboard/copy-paste-across-shadow-boundaries-2.html
editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html
editing/pasteboard/copy-paste-with-shadow-content.html
Comment 14 Build Bot 2018-10-02 20:01:59 PDT
Created attachment 351471 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 15 Ryosuke Niwa 2018-10-02 20:42:23 PDT
Sigh... -webkit-text-size-adjust: auto strikes again :( Will add iOS specific results.
Comment 16 Ryosuke Niwa 2018-10-02 21:11:47 PDT
Thanks for the review!

(In reply to Wenson Hsieh from comment #12)
> Comment on attachment 351459 [details]
> Fixed GTK+ build
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=351459&action=review
> 
> > Source/WebCore/editing/markup.cpp:633
> > +    for (Node* n = startNode; n != pastEnd; lastNode = n, n = next) {
> 
> auto*?

Fixed.

> > Source/WebCore/editing/markup.cpp:833
> > +    Node* nodeA = commonScope->ancestorNodeInThisScope(a.containerNode());
> 
> auto*

Fixed.
Comment 17 Ryosuke Niwa 2018-10-02 21:12:32 PDT
Created attachment 351476 [details]
Patch for landing
Comment 18 Build Bot 2018-10-02 21:16:13 PDT
Attachment 351476 [details] did not pass style-queue:


ERROR: Source/WebCore/editing/markup.cpp:340:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 19 Ryosuke Niwa 2018-10-02 23:28:09 PDT
Committed r236785: <https://trac.webkit.org/changeset/236785>