Changeset 86308 in webkit


Ignore:
Timestamp:
May 11, 2011 10:13:23 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-11 Luke Macpherson <macpherson@chromium.org>

Reviewed by Eric Seidel.

Implement CSSPropertyMargin and CSSPropertyPadding in CSSStyleApplyProperty.
https://bugs.webkit.org/show_bug.cgi?id=60609

No new tests - refactoring only.

  • css/CSSStyleApplyProperty.cpp: (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): Initialise CSSPropertyMargin and CSSPropertyPadding handlers.
  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyProperty): Remove unused implementations.
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86306 r86308  
     12011-05-11  Luke Macpherson   <macpherson@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Implement CSSPropertyMargin and CSSPropertyPadding in CSSStyleApplyProperty.
     6        https://bugs.webkit.org/show_bug.cgi?id=60609
     7
     8        No new tests - refactoring only.
     9
     10        * css/CSSStyleApplyProperty.cpp:
     11        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
     12        Initialise CSSPropertyMargin and CSSPropertyPadding handlers.
     13        * css/CSSStyleSelector.cpp:
     14        (WebCore::CSSStyleSelector::applyProperty):
     15        Remove unused implementations.
     16
    1172011-05-11  Robin Dunn  <robin@alldunn.com>
    218
  • trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp

    r86044 r86308  
    506506    setPropertyHandler(CSSPropertyMarginBottom, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin));
    507507    setPropertyHandler(CSSPropertyMarginLeft, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin));
     508    setPropertyHandler(CSSPropertyMargin, new ApplyPropertyExpandingSuppressValue(propertyHandler(CSSPropertyMarginTop), propertyHandler(CSSPropertyMarginRight), propertyHandler(CSSPropertyMarginBottom), propertyHandler(CSSPropertyMarginLeft)));
    508509
    509510    setPropertyHandler(CSSPropertyPaddingTop, new ApplyPropertyLength<>(&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding));
     
    511512    setPropertyHandler(CSSPropertyPaddingBottom, new ApplyPropertyLength<>(&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding));
    512513    setPropertyHandler(CSSPropertyPaddingLeft, new ApplyPropertyLength<>(&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding));
     514    setPropertyHandler(CSSPropertyPadding, new ApplyPropertyExpandingSuppressValue(propertyHandler(CSSPropertyPaddingTop), propertyHandler(CSSPropertyPaddingRight), propertyHandler(CSSPropertyPaddingBottom), propertyHandler(CSSPropertyPaddingLeft)));
    513515
    514516    setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, new ApplyPropertyLength<>(&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX));
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r86135 r86308  
    44424442            m_style->inheritMaskLayers(*m_parentStyle->maskLayers());
    44434443        return;
    4444     case CSSPropertyMargin:
    4445         if (isInherit) {
    4446             m_style->setMarginTop(m_parentStyle->marginTop());
    4447             m_style->setMarginBottom(m_parentStyle->marginBottom());
    4448             m_style->setMarginLeft(m_parentStyle->marginLeft());
    4449             m_style->setMarginRight(m_parentStyle->marginRight());
    4450         }
    4451         else if (isInitial)
    4452             m_style->resetMargin();
    4453         return;
    4454     case CSSPropertyPadding:
    4455         if (isInherit) {
    4456             m_style->setPaddingTop(m_parentStyle->paddingTop());
    4457             m_style->setPaddingBottom(m_parentStyle->paddingBottom());
    4458             m_style->setPaddingLeft(m_parentStyle->paddingLeft());
    4459             m_style->setPaddingRight(m_parentStyle->paddingRight());
    4460         }
    4461         else if (isInitial)
    4462             m_style->resetPadding();
    4463         return;
    44644444    case CSSPropertyFont:
    44654445        if (isInherit) {
     
    55395519    case CSSPropertyMarginBottom:
    55405520    case CSSPropertyMarginLeft:
     5521    case CSSPropertyMargin:
    55415522    case CSSPropertyPaddingTop:
    55425523    case CSSPropertyPaddingRight:
    55435524    case CSSPropertyPaddingBottom:
    55445525    case CSSPropertyPaddingLeft:
     5526    case CSSPropertyPadding:
    55455527    case CSSPropertyTextIndent:
    55465528    case CSSPropertyMaxHeight:
Note: See TracChangeset for help on using the changeset viewer.