Changeset 104068 in webkit
- Timestamp:
- Jan 4, 2012 2:05:18 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r104046 r104068 1 2012-01-03 Ryosuke Niwa <rniwa@webkit.org> 2 3 REGRESSION (r92823): Background color not preserved when copying and pasting a table row 4 https://bugs.webkit.org/show_bug.cgi?id=75330 5 6 Reviewed by Tony Chang. 7 8 Add a regression test. 9 10 * editing/pasteboard/copy-element-with-conflicting-background-color-from-rule-expected.html: Added. 11 * editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html: Added. 12 1 13 2012-01-04 Alpha Lam <hclam@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r104060 r104068 1 2012-01-03 Ryosuke Niwa <rniwa@webkit.org> 2 3 REGRESSION (r92823): Background color not preserved when copying and pasting a table row 4 https://bugs.webkit.org/show_bug.cgi?id=75330 5 6 Reviewed by Tony Chang. 7 8 The bug was caused by the background color of the wrapping style overriding the background color 9 in a matched rule of a highest element to be serialized. Fixed the bug by removing the conflicting 10 background color prior to the merge. 11 12 Tests: editing/pasteboard/copy-element-with-conflicting-background-color-from-rule-expected.html 13 editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html 14 15 * editing/EditingStyle.cpp: 16 (WebCore::editingStyleFromComputedStyle): 17 (WebCore::EditingStyle::removeStyleAddedByNode): 18 (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode): 19 1 20 2012-01-03 Antti Koivisto <antti@apple.com> 2 21 -
trunk/Source/WebCore/dom/Element.cpp
r103883 r104068 707 707 void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr) 708 708 { 709 if (document()->attached() && document()->styleSelector()->hasSelectorForAttribute(attr->name().localName())) 709 if (!needsStyleRecalc()) 710 return; 711 712 if (document()->attached() && document()->styleSelectorIfExists() && document()->styleSelectorIfExists()->hasSelectorForAttribute(attr->name().localName())) 710 713 setNeedsStyleRecalc(); 711 714 } -
trunk/Source/WebCore/editing/EditingStyle.cpp
r99450 r104068 81 81 }; 82 82 83 static PassRefPtr<CSSMutableStyleDeclaration> copyEditingProperties(CSSStyleDeclaration* style, bool includeNonInheritableProperties = false) 84 { 85 if (includeNonInheritableProperties) 83 enum EditingPropertiesType { OnlyInheritableEditingProperties, AllEditingProperties }; 84 85 static PassRefPtr<CSSMutableStyleDeclaration> copyEditingProperties(CSSStyleDeclaration* style, EditingPropertiesType type = OnlyInheritableEditingProperties) 86 { 87 if (type == AllEditingProperties) 86 88 return style->copyPropertiesInSet(editingProperties, WTF_ARRAY_LENGTH(editingProperties)); 87 89 return style->copyPropertiesInSet(editingProperties + 2, WTF_ARRAY_LENGTH(editingProperties) - 2); … … 97 99 } 98 100 99 static PassRefPtr<CSSMutableStyleDeclaration> editingStyleFromComputedStyle(PassRefPtr<CSSComputedStyleDeclaration> style )101 static PassRefPtr<CSSMutableStyleDeclaration> editingStyleFromComputedStyle(PassRefPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties) 100 102 { 101 103 if (!style) 102 104 return CSSMutableStyleDeclaration::create(); 103 return copyEditingProperties(style.get() );105 return copyEditingProperties(style.get(), type); 104 106 } 105 107 … … 544 546 if (!node || !node->parentNode()) 545 547 return; 546 RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode()) );547 RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node) );548 RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode()), AllEditingProperties); 549 RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node), AllEditingProperties); 548 550 parentStyle->diff(nodeStyle.get()); 549 551 nodeStyle->diff(m_mutableStyle.get()); … … 554 556 if (!node || !node->parentNode() || !m_mutableStyle) 555 557 return; 556 RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode())); 557 RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node)); 558 559 RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode()), AllEditingProperties); 560 RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node), AllEditingProperties); 558 561 parentStyle->diff(nodeStyle.get()); 559 562 … … 904 907 return; 905 908 case OnlyEditingInheritableProperties: 909 mergeStyle(copyEditingProperties(element->inlineStyleDecl(), OnlyInheritableEditingProperties).get(), mode); 910 return; 906 911 case EditingPropertiesInEffect: 907 mergeStyle(copyEditingProperties(element->inlineStyleDecl(), propertiesToInclude == EditingPropertiesInEffect).get(), mode);912 mergeStyle(copyEditingProperties(element->inlineStyleDecl(), AllEditingProperties).get(), mode); 908 913 return; 909 914 }
Note: See TracChangeset
for help on using the changeset viewer.