Pasting a table from Confluence strip of table cell content
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Mar 2019 18:39:51 +0000 (18:39 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Mar 2019 18:39:51 +0000 (18:39 +0000)
commite68d044278c42f029441bf9471bbf3d0582637a6
tree81383c231b74d0c14a96040a15c5f4cbbdb5b3df
parent5e234fdfc103ce01678e9feb862e401ff23750db
Pasting a table from Confluence strip of table cell content
https://bugs.webkit.org/show_bug.cgi?id=196390

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was ultimately caused by FrameView of the document we use to sanitize the pasteboard content
having 0px by 0px dimension. This caused div with `overflow-x: auto` surrounding a table to have
the height of 0px. Because StyledMarkupAccumulator::renderedTextRespectingRange uses TextIterator
to serialize a text node and this div was an ancestor of the text node, TextIterator::handleTextNode
ended up exiting early.

Fixed the bug by giving FrameView, which is used to sanitize the content, a dimension of 800px by 600px.

Using TextIteratorIgnoresStyleVisibility is not a great alternative since removing invisible content
during paste is an important privacy feature.

Test: editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin.html

* editing/markup.cpp:
(WebCore::createPageForSanitizingWebContent):

LayoutTests:

Added a regression test.

* editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin-expected.txt: Added.
* editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/markup.cpp