Changeset 102544 in webkit


Ignore:
Timestamp:
Dec 11, 2011 4:24:29 PM (12 years ago)
Author:
macpherson@chromium.org
Message:

Implement CSS resize property in CSSStyleApplyProperty.
https://bugs.webkit.org/show_bug.cgi?id=74162

Reviewed by Julien Chaffraix.

No new tests / refactoring only.

  • css/CSSStyleApplyProperty.cpp:

(WebCore::ApplyPropertyResize::applyValue):
(WebCore::ApplyPropertyResize::createHandler):
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102543 r102544  
     12011-12-11  Luke Macpherson   <macpherson@chromium.org>
     2
     3        Implement CSS resize property in CSSStyleApplyProperty.
     4        https://bugs.webkit.org/show_bug.cgi?id=74162
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        No new tests / refactoring only.
     9
     10        * css/CSSStyleApplyProperty.cpp:
     11        (WebCore::ApplyPropertyResize::applyValue):
     12        (WebCore::ApplyPropertyResize::createHandler):
     13        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
     14        * css/CSSStyleSelector.cpp:
     15        (WebCore::CSSStyleSelector::applyProperty):
     16
    1172011-12-11  Andreas Kling  <kling@webkit.org>
    218
  • trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp

    r102528 r102544  
    3838#include "RenderObject.h"
    3939#include "RenderStyle.h"
     40#include "Settings.h"
    4041#include <wtf/StdLibExtras.h>
    4142#include <wtf/UnusedParam.h>
     
    11701171};
    11711172
     1173class ApplyPropertyResize {
     1174public:
     1175    static void applyValue(CSSStyleSelector* selector, CSSValue* value)
     1176    {
     1177        if (!value->isPrimitiveValue())
     1178            return;
     1179
     1180        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     1181
     1182        EResize r = RESIZE_NONE;
     1183        switch (primitiveValue->getIdent()) {
     1184        case 0:
     1185            return;
     1186        case CSSValueAuto:
     1187            if (Settings* settings = selector->document()->settings())
     1188                r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
     1189            break;
     1190        default:
     1191            r = *primitiveValue;
     1192        }
     1193        selector->style()->setResize(r);
     1194    }
     1195
     1196    static PropertyHandler createHandler()
     1197    {
     1198        PropertyHandler handler = ApplyPropertyDefaultBase<EResize, &RenderStyle::resize, EResize, &RenderStyle::setResize, EResize, &RenderStyle::initialResize>::createHandler();
     1199        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
     1200    }
     1201};
     1202
    11721203class ApplyPropertyVerticalAlign {
    11731204public:
     
    15211552    setPropertyHandler(CSSPropertyPadding, ApplyPropertyExpanding<SuppressValue, CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft>::createHandler());
    15221553
     1554    setPropertyHandler(CSSPropertyResize, ApplyPropertyResize::createHandler());
     1555
    15231556    setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
    15241557
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r102479 r102544  
    27252725        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(matchNearestMailBlockquoteColor, MatchNearestMailBlockquoteColor)
    27262726        return;
    2727 
    2728     case CSSPropertyResize:
    2729     {
    2730         HANDLE_INHERIT_AND_INITIAL(resize, Resize)
    2731 
    2732         if (!primitiveValue->getIdent())
    2733             return;
    2734 
    2735         EResize r = RESIZE_NONE;
    2736         if (primitiveValue->getIdent() == CSSValueAuto) {
    2737             if (Settings* settings = m_checker.document()->settings())
    2738                 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
    2739         } else
    2740             r = *primitiveValue;
    2741 
    2742         m_style->setResize(r);
    2743         return;
    2744     }
    27452727    case CSSPropertyFontSize:
    27462728    {
     
    39333915    case CSSPropertyPaddingLeft:
    39343916    case CSSPropertyPadding:
     3917    case CSSPropertyResize:
    39353918    case CSSPropertySize:
    39363919    case CSSPropertyTextAlign:
Note: See TracChangeset for help on using the changeset viewer.