REGRESSION (r92823): Background color not preserved when copying and pasting a table row
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2012 22:05:18 +0000 (22:05 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2012 22:05:18 +0000 (22:05 +0000)
commitbc910e602add3615c9bfbcb5d2d5df89821dc8fb
tree659961739eff4c9e928c8ddfcc448076cda24a4e
parentf085c09e5fddc47951cf77e6e93bd72c308eae5c
REGRESSION (r92823): Background color not preserved when copying and pasting a table row
https://bugs.webkit.org/show_bug.cgi?id=75330

Reviewed by Tony Chang.

Source/WebCore:

The bug was caused by the background color of the wrapping style overriding the background color
in a matched rule of a highest element to be serialized. Fixed the bug by removing the conflicting
background color prior to the merge.

Tests: editing/pasteboard/copy-element-with-conflicting-background-color-from-rule-expected.html
       editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html

* editing/EditingStyle.cpp:
(WebCore::editingStyleFromComputedStyle):
(WebCore::EditingStyle::removeStyleAddedByNode):
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):

LayoutTests:

Add a regression test.

* editing/pasteboard/copy-element-with-conflicting-background-color-from-rule-expected.html: Added.
* editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/copy-element-with-conflicting-background-color-from-rule-expected.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/editing/EditingStyle.cpp