Commit d1e17f04 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1a9ff0f0
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.
2011-05-11 Robin Dunn <robin@alldunn.com>
 
Reviewed by Kevin Ollivier.
......@@ -505,11 +505,13 @@ CSSStyleApplyProperty::CSSStyleApplyProperty()
setPropertyHandler(CSSPropertyMarginRight, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin));
setPropertyHandler(CSSPropertyMarginBottom, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin));
setPropertyHandler(CSSPropertyMarginLeft, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin));
setPropertyHandler(CSSPropertyMargin, new ApplyPropertyExpandingSuppressValue(propertyHandler(CSSPropertyMarginTop), propertyHandler(CSSPropertyMarginRight), propertyHandler(CSSPropertyMarginBottom), propertyHandler(CSSPropertyMarginLeft)));
setPropertyHandler(CSSPropertyPaddingTop, new ApplyPropertyLength<>(&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding));
setPropertyHandler(CSSPropertyPaddingRight, new ApplyPropertyLength<>(&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding));
setPropertyHandler(CSSPropertyPaddingBottom, new ApplyPropertyLength<>(&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding));
setPropertyHandler(CSSPropertyPaddingLeft, new ApplyPropertyLength<>(&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding));
setPropertyHandler(CSSPropertyPadding, new ApplyPropertyExpandingSuppressValue(propertyHandler(CSSPropertyPaddingTop), propertyHandler(CSSPropertyPaddingRight), propertyHandler(CSSPropertyPaddingBottom), propertyHandler(CSSPropertyPaddingLeft)));
setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, new ApplyPropertyLength<>(&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX));
setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, new ApplyPropertyLength<>(&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY));
......
......@@ -4441,26 +4441,6 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
else if (isInherit)
m_style->inheritMaskLayers(*m_parentStyle->maskLayers());
return;
case CSSPropertyMargin:
if (isInherit) {
m_style->setMarginTop(m_parentStyle->marginTop());
m_style->setMarginBottom(m_parentStyle->marginBottom());
m_style->setMarginLeft(m_parentStyle->marginLeft());
m_style->setMarginRight(m_parentStyle->marginRight());
}
else if (isInitial)
m_style->resetMargin();
return;
case CSSPropertyPadding:
if (isInherit) {
m_style->setPaddingTop(m_parentStyle->paddingTop());
m_style->setPaddingBottom(m_parentStyle->paddingBottom());
m_style->setPaddingLeft(m_parentStyle->paddingLeft());
m_style->setPaddingRight(m_parentStyle->paddingRight());
}
else if (isInitial)
m_style->resetPadding();
return;
case CSSPropertyFont:
if (isInherit) {
FontDescription fontDescription = m_parentStyle->fontDescription();
......@@ -5538,10 +5518,12 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
case CSSPropertyMarginRight:
case CSSPropertyMarginBottom:
case CSSPropertyMarginLeft:
case CSSPropertyMargin:
case CSSPropertyPaddingTop:
case CSSPropertyPaddingRight:
case CSSPropertyPaddingBottom:
case CSSPropertyPaddingLeft:
case CSSPropertyPadding:
case CSSPropertyTextIndent:
case CSSPropertyMaxHeight:
case CSSPropertyHeight:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment