Changeset 85585 in webkit
- Timestamp:
- May 2, 2011 10:07:52 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85582 r85585 1 2011-05-02 Ian Henderson <ianh@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 CSS !important not respected by JavaScript 6 https://bugs.webkit.org/show_bug.cgi?id=60007 7 8 * fast/css/important-js-override-expected.txt: Added. 9 * fast/css/important-js-override.html: Added. 10 1 11 2011-05-02 Alpha Lam <hclam@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r85577 r85585 1 2011-05-02 Ian Henderson <ianh@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 CSS !important not respected by JavaScript 6 https://bugs.webkit.org/show_bug.cgi?id=60007 7 8 The addParsedProperty and addParsedProperties methods were subtly 9 different. The former did not check for !important before setting the 10 given property. 11 12 Change addParsedProperties to call addParsedProperty and move the 13 relevant code. The one other caller of this method, in 14 editing/markup.cpp, probably wanted this behavior anyway. 15 16 Test: fast/css/important-js-override.html 17 18 * css/CSSMutableStyleDeclaration.cpp: 19 (WebCore::CSSMutableStyleDeclaration::addParsedProperties): 20 (WebCore::CSSMutableStyleDeclaration::addParsedProperty): 21 1 22 2011-05-02 Ben Wells <benwells@chromium.org> 2 23 -
trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp
r83122 r85585 643 643 { 644 644 ASSERT(!m_iteratorCount); 645 645 646 646 m_properties.reserveCapacity(numProperties); 647 648 for (int i = 0; i < numProperties; ++i) { 649 // Only add properties that have no !important counterpart present 650 if (!getPropertyPriority(properties[i]->id()) || properties[i]->isImportant()) { 651 removeProperty(properties[i]->id(), false); 652 ASSERT(properties[i]); 653 m_properties.append(*properties[i]); 654 } 655 } 647 for (int i = 0; i < numProperties; ++i) 648 addParsedProperty(*properties[i]); 649 656 650 // FIXME: This probably should have a call to setNeedsStyleRecalc() if something changed. We may also wish to add 657 651 // a notifyChanged argument to this function to follow the model of other functions in this class. … … 662 656 ASSERT(!m_iteratorCount); 663 657 664 setPropertyInternal(property); 658 // Only add properties that have no !important counterpart present 659 if (!getPropertyPriority(property.id()) || property.isImportant()) { 660 removeProperty(property.id(), false); 661 m_properties.append(property); 662 } 665 663 } 666 664
Note: See TracChangeset
for help on using the changeset viewer.