⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 93218 in webkit


Ignore:
Timestamp:
Aug 17, 2011, 10:45:40 AM (15 years ago)
Author:
macpherson@chromium.org
Message:

Only set m_fontDirty if TextSizeAdjust is actually changed.
https://bugs.webkit.org/show_bug.cgi?id=66022

Reviewed by Darin Adler.

No new tests. Refactoring only.

Reduces instances where the font information is dirtied to save recalculation where it is not necessary.

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty):
Call new setTextSizeAdjust function.

  • css/CSSStyleSelector.h:

(WebCore::CSSStyleSelector::setTextSizeAdjust):
Add wrapper for RenderStyle::setTextSizeAdjust() that automatically updates m_fontDirty.

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::setTextSizeAdjust):
Make setTextSizeAdjust return true if the unlderlying value was changed.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r93216 r93218  
     12011-08-17  Luke Macpherson   <macpherson@chromium.org>
     2
     3        Only set m_fontDirty if TextSizeAdjust is actually changed.
     4        https://bugs.webkit.org/show_bug.cgi?id=66022
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests. Refactoring only.
     9
     10        Reduces instances where the font information is dirtied to save recalculation where it is not necessary.
     11
     12        * css/CSSStyleSelector.cpp:
     13        (WebCore::CSSStyleSelector::applyProperty):
     14        Call new setTextSizeAdjust function.
     15        * css/CSSStyleSelector.h:
     16        (WebCore::CSSStyleSelector::setTextSizeAdjust):
     17        Add wrapper for RenderStyle::setTextSizeAdjust() that automatically updates m_fontDirty.
     18        * rendering/style/RenderStyle.h:
     19        (WebCore::RenderStyle::setTextSizeAdjust):
     20        Make setTextSizeAdjust return true if the unlderlying value was changed.
     21
    1222011-08-17  Kenichi Ishibashi  <bashi@chromium.org>
    223
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r93195 r93218  
    47484748    case CSSPropertyWebkitTextSizeAdjust: {
    47494749        HANDLE_INHERIT_AND_INITIAL(textSizeAdjust, TextSizeAdjust)
    4750         if (!primitiveValue || !primitiveValue->getIdent()) return;
    4751         m_style->setTextSizeAdjust(primitiveValue->getIdent() == CSSValueAuto);
    4752         m_fontDirty = true;
     4750        if (!primitiveValue || !primitiveValue->getIdent())
     4751            return;
     4752        setTextSizeAdjust(primitiveValue->getIdent() == CSSValueAuto);
    47534753        return;
    47544754    }
  • trunk/Source/WebCore/css/CSSStyleSelector.h

    r93122 r93218  
    119119        void setZoom(float f) { m_fontDirty |= style()->setZoom(f); }
    120120        void setEffectiveZoom(float f) { m_fontDirty |= style()->setEffectiveZoom(f); }
     121        void setTextSizeAdjust(bool b) { m_fontDirty |= style()->setTextSizeAdjust(b); }
    121122
    122123    private:
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r93195 r93218  
    11501150    void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
    11511151    void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
    1152     void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); }
     1152    bool setTextSizeAdjust(bool);
    11531153    void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
    11541154
     
    14421442}
    14431443
     1444inline bool RenderStyle::setTextSizeAdjust(bool b)
     1445{
     1446    if (compareEqual(rareInheritedData->textSizeAdjust, b))
     1447        return false;
     1448    rareInheritedData.access()->textSizeAdjust = b;
     1449    return true;
     1450}
     1451
    14441452} // namespace WebCore
    14451453
Note: See TracChangeset for help on using the changeset viewer.