Summary: | REGRESSION: WebKit doesn't preserve style when copying text from another element | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||||||||||||||||||||||
Component: | HTML Editing | Assignee: | Pravin D <pravind> | ||||||||||||||||||||||||
Status: | RESOLVED CONFIGURATION CHANGED | ||||||||||||||||||||||||||
Severity: | Normal | CC: | ahmad.saleem792, arpitabahuguna, buildbot, dglazkov, donggwan.kim, dw.im, enrica, k.wolanski, mifenton, pravind, rniwa, s.choi, vanivhegde, webkit-bug-importer, webkit.review.bot | ||||||||||||||||||||||||
Priority: | P2 | Keywords: | InRadar, Regression | ||||||||||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||||||||
URL: | http://jsfiddle.net/fns4w/6/ | ||||||||||||||||||||||||||
Attachments: |
|
Description
Ryosuke Niwa
2013-03-14 01:41:07 PDT
Created attachment 194803 [details]
Approach 1
Comment on attachment 194803 [details] Approach 1 Attachment 194803 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/17308243 New failing tests: editing/pasteboard/5761530-1.html editing/pasteboard/paste-and-sanitize.html editing/pasteboard/copy-null-characters.html editing/pasteboard/paste-blockquote-2.html editing/deleting/merge-paragraph-from-h6-with-style.html editing/deleting/merge-paragraph-into-pre.html editing/deleting/merge-paragraph-from-address.html editing/pasteboard/paste-blockquote-3.html editing/deleting/merge-paragraph-into-h1.html editing/pasteboard/paste-text-with-style-4.html editing/deleting/merge-paragraph-from-listing.html editing/deleting/merge-paragraph-from-p-with-style-2.html editing/deleting/merge-paragraph-into-h1-with-dir-2.html editing/deleting/merge-paragraph-into-h1-with-dir.html editing/deleting/merge-paragraph-with-style-from-rule.html editing/deleting/merge-paragraph-from-h6.html editing/deleting/merge-paragraph-into-h1-with-style.html editing/deleting/merge-paragraph-from-p-with-style.html editing/deleting/delete-to-end-of-paragraph.html editing/deleting/merge-paragraph-from-p-with-style-3.html editing/deleting/merge-paragraph-from-h6-with-style-2.html editing/deleting/merge-whitespace-pre.html editing/deleting/deleting-line-break-preserves-underline-color.html Created attachment 194881 [details]
Archive of layout-test-results from gce-cr-linux-08 for chromium-linux-x86_64
The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-08 Port: chromium-linux-x86_64 Platform: Linux-3.3.8-gcg-201212281604-x86_64-with-GCEL-10.04-gcel_10.04
Created attachment 196093 [details]
Reduction
The problem is in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline. We’re removing font-size & color
via removeStyleFromRulesAndContext since they’re duplicated in the style rules.
Since the inline style is now empty, we end up erronrously removing span and those rules stops applying to the text.
This is a regression from Safari 6.0.2. This is probably a regression from http://trac.webkit.org/changeset/96870. Created attachment 197924 [details]
Work in progress changes
Some work in progress changes for the record. This approach is wrong.
For the future myself, to fix this bug, I need to distinguish cases where users are deleting paragraphs and we’re merging paragraphs as a part of other operations. In the latter case, we need to preserve all styles including that of style rules for blocks. *** Bug 115027 has been marked as a duplicate of this bug. *** Created attachment 204984 [details]
Patch
Comment on attachment 204984 [details] Patch Attachment 204984 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/945237 New failing tests: editing/deleting/deleting-line-break-preserves-underline-color.html Created attachment 205008 [details]
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-08 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Comment on attachment 204984 [details] Patch Attachment 204984 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/926251 New failing tests: editing/deleting/deleting-line-break-preserves-underline-color.html Created attachment 205011 [details]
Archive of layout-test-results from APPLE-EWS-2 for win-future
The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: APPLE-EWS-2 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Comment on attachment 204984 [details] Patch Attachment 204984 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/926269 New failing tests: editing/deleting/deleting-line-break-preserves-underline-color.html Created attachment 205021 [details]
Archive of layout-test-results from APPLE-EWS-5 for win-future
The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: APPLE-EWS-5 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Comment on attachment 204984 [details] Patch Attachment 204984 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/880486 New failing tests: editing/deleting/deleting-line-break-preserves-underline-color.html http/tests/security/cross-origin-plugin-private-browsing-toggled.html Created attachment 205069 [details]
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-09 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Created attachment 205586 [details]
Patch
Comment on attachment 205586 [details] Patch Attachment 205586 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/999024 New failing tests: fast/js/global-constructors-attributes-shared-worker.html fast/js/global-constructors-attributes-dedicated-worker.html Created attachment 205628 [details]
Archive of layout-test-results from APPLE-EWS-4 for win-future
The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: APPLE-EWS-4 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Comment on attachment 205586 [details]
Patch
Assuming that patches for review since 2013 are stale, r-
Using link from URL field, I am not able to reproduce this bug in Safari Technology Preview 159 and it is matching with Chrome Canary 110, where the copy result in 50px text in green color while in case of Firefox Nightly 109, I am getting weird "New Line" in between copied text and contenteditable text. Just wanted to share updated results. Thanks! Yeah, this is working now. |