When an element has style applied by CSS rules, WebKit duplicates that style in inline style declaration when the element is copied and pasted in the same document. We should remove inline styles that duplicates CSS rules on paste to reduce the markup size.
Created attachment 94890 [details] fixes the bug
This is possibly the most exciting patch I'm submitting this month.
(In reply to comment #2) > This is possibly the most exciting patch I'm submitting this month. This really is exciting!
Comment on attachment 94890 [details] fixes the bug Attachment 94890 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/8736190 New failing tests: editing/pasteboard/5780697-2.html
Created attachment 94940 [details] Archive of layout-test-results from ec2-cr-linux-03 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-03 Port: Chromium Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
It seems like editing/pasteboard/5780697-2.html has a Chromium-specific expected results. Regardless, we just to rebaseline it.
Comment on attachment 94890 [details] fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=94890&action=review Looks good to me. > Source/WebCore/editing/ReplaceSelectionCommand.cpp:479 > +void ReplaceSelectionCommand::negateStyleRulesThatAffectAppearanceAndRemoveRedundantInlineStyleDecl() That is an insanely long method name! :-). I guess it is very descriptive.
Thanks for the review, Enrica! Per IRC discussion I'll rename negateStyleRulesThatAffectAppearanceAndRemoveRedundantInlineStyleDecl to removeRedundantStylesAndKeepStyleSpanInline before landing it. Also, I'll include the rebaseline for platform/chromium-win/editing/pasteboard/5780697-2-expected.txt. I'll still have to rebaseline GTK & Qt as they also have separate expected results for 5780697-2.html
Committed r87400: <http://trac.webkit.org/changeset/87400>