Changeset 18676 in webkit


Ignore:
Timestamp:
Jan 8, 2007 11:55:56 AM (17 years ago)
Author:
weinig
Message:

Reviewed by Darin.

No test possible (no change to functionality).

  • css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::removeComputedInheritablePropertiesFrom): Added. Removes the inheritable properties that CSSComputedStyleDeclaration knows how to compute from the given mutable declaration.
  • css/CSSComputedStyleDeclaration.h:
  • css/CSSMutableStyleDeclaration.cpp: Removed one copy of the inheritableProperties array.
  • css/CSSMutableStyleDeclaration.h:
  • editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::removeRedundantStyles): Changed to call CSSComputedStyleDeclaration::removeComputedInheritablePropertiesFrom.
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r18675 r18676  
     12007-01-08  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=12162
     6          The inheritableProperties array is duplicated
     7
     8        No test possible (no change to functionality).
     9
     10        * css/CSSComputedStyleDeclaration.cpp:
     11        (WebCore::CSSComputedStyleDeclaration::removeComputedInheritablePropertiesFrom): Added.
     12        Removes the inheritable properties that CSSComputedStyleDeclaration knows how to compute
     13        from the given mutable declaration.
     14        * css/CSSComputedStyleDeclaration.h:
     15        * css/CSSMutableStyleDeclaration.cpp: Removed one copy of the inheritableProperties array.
     16        * css/CSSMutableStyleDeclaration.h:
     17        * editing/ReplaceSelectionCommand.cpp:
     18        (WebCore::ReplaceSelectionCommand::removeRedundantStyles): Changed to call
     19        CSSComputedStyleDeclaration::removeComputedInheritablePropertiesFrom.
     20
    1212007-01-08  Alexey Proskuryakov  <ap@webkit.org>
    222
     
    3959        Added this method to DOM and IDL, too. Made namedItem() non-virtual.
    4060
     61>>>>>>> .r18675
    41622007-01-08  Beth Dakin  <bdakin@apple.com>
    4263
  • trunk/WebCore/css/CSSComputedStyleDeclaration.cpp

    r18666 r18676  
    15411541// It is the intersection of the list of inherited CSS properties and the
    15421542// properties for which we have a computed implementation in this file.
    1543 // FIXME: This array is duplicated in CSSMutableStyleDeclaration.cpp!  Both must be patched if
    1544 // you add something here!
    15451543const int inheritableProperties[] = {
    15461544    CSS_PROP_BORDER_COLLAPSE,
     
    15711569const unsigned numInheritableProperties = sizeof(inheritableProperties) / sizeof(inheritableProperties[0]);
    15721570
     1571void CSSComputedStyleDeclaration::removeComputedInheritablePropertiesFrom(CSSMutableStyleDeclaration* declaration)
     1572{
     1573    declaration->removePropertiesInSet(inheritableProperties, numInheritableProperties);
     1574}
     1575
    15731576PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::copyInheritableProperties() const
    15741577{
  • trunk/WebCore/css/CSSComputedStyleDeclaration.h

    r14407 r18676  
    5959    PassRefPtr<CSSMutableStyleDeclaration> copyInheritableProperties() const;
    6060
     61    static void removeComputedInheritablePropertiesFrom(CSSMutableStyleDeclaration*);
     62
    6163private:
    6264    virtual void setCssText(const String&, ExceptionCode&);
  • trunk/WebCore/css/CSSMutableStyleDeclaration.cpp

    r18660 r18676  
    417417}
    418418
    419 // This is the list of properties we want to copy in the copyInheritableProperties() function.
    420 // It is the intersection of the list of inherited CSS properties and the
    421 // properties for which we have a computed implementation in this file.
    422 // FIXME: This array is duplicated in CSSComputedStyleDeclaration.cpp!  Both must be patched if
    423 // you add something here!
    424 const int inheritableProperties[] = {
    425     CSS_PROP_BORDER_COLLAPSE,
    426     CSS_PROP__WEBKIT_BORDER_HORIZONTAL_SPACING,
    427     CSS_PROP__WEBKIT_BORDER_VERTICAL_SPACING,
    428     CSS_PROP_COLOR,
    429     CSS_PROP_FONT_FAMILY,
    430     CSS_PROP_FONT_SIZE,
    431     CSS_PROP_FONT_STYLE,
    432     CSS_PROP_FONT_VARIANT,
    433     CSS_PROP_FONT_WEIGHT,
    434     CSS_PROP_LETTER_SPACING,
    435     CSS_PROP_LINE_HEIGHT,
    436     CSS_PROP_TEXT_ALIGN,
    437     CSS_PROP__WEBKIT_TEXT_DECORATIONS_IN_EFFECT,
    438     CSS_PROP__WEBKIT_TEXT_FILL_COLOR,
    439     CSS_PROP_TEXT_INDENT,
    440     CSS_PROP__WEBKIT_TEXT_SIZE_ADJUST,
    441     CSS_PROP__WEBKIT_TEXT_STROKE_COLOR,
    442     CSS_PROP__WEBKIT_TEXT_STROKE_WIDTH,
    443     CSS_PROP_TEXT_TRANSFORM,
    444     CSS_PROP_ORPHANS,
    445     CSS_PROP_WHITE_SPACE,
    446     CSS_PROP_WIDOWS,
    447     CSS_PROP_WORD_SPACING,
    448 };
    449 
    450 const unsigned numInheritableProperties = sizeof(inheritableProperties) / sizeof(inheritableProperties[0]);
    451 
    452419// This is the list of properties we want to copy in the copyBlockProperties() function.
    453420// It is the list of CSS properties that apply specially to block-level elements.
     
    484451}
    485452
    486 void CSSMutableStyleDeclaration::removeInheritableProperties()
    487 {
    488     removePropertiesInSet(inheritableProperties, numInheritableProperties);
    489 }
    490 
    491453void CSSMutableStyleDeclaration::removePropertiesInSet(const int *set, unsigned length)
    492454{
  • trunk/WebCore/css/CSSMutableStyleDeclaration.h

    r14408 r18676  
    9393    PassRefPtr<CSSMutableStyleDeclaration> copyBlockProperties() const;
    9494    void removeBlockProperties();
    95     void removeInheritableProperties();
    9695    void removePropertiesInSet(const int* set, unsigned length);
    9796
  • trunk/WebCore/editing/ReplaceSelectionCommand.cpp

    r18255 r18676  
    437437        CSSMutableStyleDeclaration* inlineStyleDecl = element->inlineStyleDecl();
    438438        if (inlineStyleDecl) {
    439             inlineStyleDecl->removeInheritableProperties();
     439            CSSComputedStyleDeclaration::removeComputedInheritablePropertiesFrom(inlineStyleDecl);
    440440            inlineStyleDecl->merge(style, true);
    441441            setNodeAttribute(element, styleAttr, inlineStyleDecl->cssText());
Note: See TracChangeset for help on using the changeset viewer.