Revert "Sanitize style elements in clipboard markup"
This reverts commit d96236b5. Reason for revert: This may cause "WebKit Linux Leak" failure First failure: https://ci.chromium.org/p/chromium/builders/ci/WebKit%20Linux%20Leak/7276 Original change's description: > Sanitize style elements in clipboard markup > > This patch sanitizes clipboard markup before pasting it into document > by removing all pasted style elements and serializing them onto > elements as inline style. In this way, we stop stylesheets in clipboard > markup from being applied to the original elements in the document. > > This patch follows the same approach as in WebKit [1]: > - First create a dummy document to insert the markup > - Then computes style and layout in the dummy document > - Re-serialize the dummy document as the markup to be inserted. This > reuses the code path that we serialize a selection range into > clipboard, where we need to serialize element computed style into > inline styles so that the element styles are preserved. > - Make sure all style elements are removed before inserting markup > into document > > This patch also adds a complete test to ensure that content pasted from > Excel is still properly styled, which is the main reason we used to > preserve style elements in clipboard markup [2]. > > [1] https://trac.webkit.org/changeset/223440 > [2] http://crbug.com/121163 > > Bug: 1017871 > Change-Id: I3bb5a4ae7530a3fdef5ba251975e004857c06f1e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922919 > Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> > Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> > Reviewed-by: Kent Tamura <tkent@chromium.org> > Cr-Commit-Position: refs/heads/master@{#718281} TBR=yosin@chromium.org,tkent@chromium.org,xiaochengh@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 1017871, 1027386 Change-Id: I1d500647d6227c9be3ae14d9604ba702e9c29834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933452Reviewed-by:Owen Min <zmin@chromium.org> Reviewed-by:
Xiaocheng Hu <xiaochengh@chromium.org> Commit-Queue: Owen Min <zmin@chromium.org> Cr-Commit-Position: refs/heads/master@{#718778}
Showing
Please register or sign in to comment