Changeset 61340 in webkit


Ignore:
Timestamp:
Jun 17, 2010 12:32:04 PM (14 years ago)
Author:
rwlbuis@webkit.org
Message:

2010-06-17 Rob Buis <rwlbuis@gmail.com>

Reviewed by Dave Hyatt.

CSS3 "Property is declared twice in rule" test fails
https://bugs.webkit.org/show_bug.cgi?id=36282

Filter out duplicate properties in style declaration.

Test: fast/css/duplicate-property-in-rule.html

  • css/CSSMutableStyleDeclaration.cpp: Filter out duplicate properties (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
  • css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Discard negative padding values
  • css/CSSStyleSelector.cpp: Remove negative padding check (WebCore::CSSStyleSelector::applyProperty):
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r61339 r61340  
     12010-06-17  Rob Buis  <rwlbuis@gmail.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Test for
     6        CSS3 "Property is declared twice in rule" test fails
     7        https://bugs.webkit.org/show_bug.cgi?id=36282
     8
     9        * fast/css/duplicate-property-in-rule-expected.txt: Added.
     10        * fast/css/duplicate-property-in-rule.html: Added.
     11
    1122010-06-17  Kenneth Russell  <kbr@google.com>
    213
  • trunk/WebCore/ChangeLog

    r61339 r61340  
     12010-06-17  Rob Buis  <rwlbuis@gmail.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        CSS3 "Property is declared twice in rule" test fails
     6        https://bugs.webkit.org/show_bug.cgi?id=36282
     7
     8        Filter out duplicate properties in style declaration.
     9
     10        Test: fast/css/duplicate-property-in-rule.html
     11
     12        * css/CSSMutableStyleDeclaration.cpp: Filter out duplicate properties
     13        (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
     14        * css/CSSParser.cpp:
     15        (WebCore::CSSParser::parseValue): Discard negative padding values
     16        * css/CSSStyleSelector.cpp: Remove negative padding check
     17        (WebCore::CSSStyleSelector::applyProperty):
     18
    1192010-06-17  Kenneth Russell  <kbr@google.com>
    220
  • trunk/WebCore/css/CSSMutableStyleDeclaration.cpp

    r59351 r61340  
    8383{
    8484    m_properties.reserveInitialCapacity(numProperties);
     85    HashSet<int> candidates;
    8586    for (int i = 0; i < numProperties; ++i) {
    8687        ASSERT(properties[i]);
    87         m_properties.append(*properties[i]);
    8888        if (properties[i]->value()->isVariableDependentValue())
    8989            m_variableDependentValueCount++;
    90     }
    91     // FIXME: This allows duplicate properties.
     90        else if (candidates.contains(properties[i]->id()))
     91            removeProperty(properties[i]->id(), false);
     92        m_properties.append(*properties[i]);
     93        if (!getPropertyPriority(properties[i]->id()) && !properties[i]->isImportant())
     94            candidates.add(properties[i]->id());
     95    }
    9296}
    9397
  • trunk/WebCore/css/CSSParser.cpp

    r61091 r61340  
    984984    case CSSPropertyPaddingLeft:         ////
    985985    case CSSPropertyWebkitPaddingStart:
    986         validPrimitive = (!id && validUnit(value, FLength | FPercent, m_strict));
     986        validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict));
    987987        break;
    988988
  • trunk/WebCore/css/CSSStyleSelector.cpp

    r61324 r61340  
    38593859            else
    38603860                return;
    3861             if (id == CSSPropertyPaddingLeft || id == CSSPropertyPaddingRight ||
    3862                 id == CSSPropertyPaddingTop || id == CSSPropertyPaddingBottom)
    3863                 // Padding can't be negative
    3864                 apply = !((l.isFixed() || l.isPercent()) && l.calcValue(100) < 0);
    3865             else
    3866                 apply = true;
     3861            apply = true;
    38673862        }
    38683863        if (!apply) return;
Note: See TracChangeset for help on using the changeset viewer.