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

Changeset 176524 in webkit


Ignore:
Timestamp:
Nov 24, 2014, 2:12:53 PM (12 years ago)
Author:
weinig@apple.com
Message:

Move the '-webkit-box-reflext' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=139008

Reviewed by Anders Carlsson.

  • css/CSSPropertyNames.in:
  • css/StyleBuilderConverter.h:

(WebCore::StyleBuilderConverter::convertReflection):

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::applyProperty):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176521 r176524  
     12014-11-22  Sam Weinig  <sam@webkit.org>
     2
     3        Move the '-webkit-box-reflext' CSS property to the new StyleBuilder
     4        https://bugs.webkit.org/show_bug.cgi?id=139008
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * css/CSSPropertyNames.in:
     9        * css/StyleBuilderConverter.h:
     10        (WebCore::StyleBuilderConverter::convertReflection):
     11        * css/StyleResolver.cpp:
     12        (WebCore::StyleResolver::applyProperty):
     13
    1142014-11-24  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r176491 r176524  
    323323-webkit-box-orient
    324324-webkit-box-pack
    325 -webkit-box-reflect [LegacyStyleBuilder]
     325-webkit-box-reflect [Converter=Reflection]
    326326// -webkit-box-shadow differs from box-shadow in its treatement of blur radii > 8px.
    327327// Let -webkit-box-shadow blur radius be w_r and box-shadow blur radius be b_r. For
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r176455 r176524  
    3131#include "CSSCalculationValue.h"
    3232#include "CSSPrimitiveValue.h"
     33#include "CSSReflectValue.h"
    3334#include "Length.h"
    3435#include "Pair.h"
     
    6970    static PassRefPtr<QuotesData> convertQuotes(StyleResolver&, CSSValue&);
    7071    static TextUnderlinePosition convertTextUnderlinePosition(StyleResolver&, CSSValue&);
     72    static PassRefPtr<StyleReflection> convertReflection(StyleResolver&, CSSValue&);
    7173
    7274private:
     
    470472}
    471473
     474inline PassRefPtr<StyleReflection> StyleBuilderConverter::convertReflection(StyleResolver& styleResolver, CSSValue& value)
     475{
     476    if (is<CSSPrimitiveValue>(value)) {
     477        ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone);
     478        return nullptr;
     479    }
     480
     481    CSSReflectValue& reflectValue = downcast<CSSReflectValue>(value);
     482
     483    RefPtr<StyleReflection> reflection = StyleReflection::create();
     484    reflection->setDirection(*reflectValue.direction());
     485
     486    if (reflectValue.offset())
     487        reflection->setOffset(reflectValue.offset()->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(styleResolver.state().cssToLengthConversionData()));
     488
     489    NinePieceImage mask;
     490    mask.setMaskDefaults();
     491    styleResolver.styleMap()->mapNinePieceImage(CSSPropertyWebkitBoxReflect, reflectValue.mask(), mask);
     492    reflection->setMask(mask);
     493
     494    return reflection.release();
     495}
     496
    472497} // namespace WebCore
    473498
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r176459 r176524  
    24122412        return;
    24132413    }
    2414     case CSSPropertyWebkitBoxReflect: {
    2415         HANDLE_INHERIT_AND_INITIAL(boxReflect, BoxReflect)
    2416         if (primitiveValue) {
    2417             state.style()->setBoxReflect(RenderStyle::initialBoxReflect());
    2418             return;
    2419         }
    2420 
    2421         if (!is<CSSReflectValue>(*value))
    2422             return;
    2423 
    2424         CSSReflectValue& reflectValue = downcast<CSSReflectValue>(*value);
    2425         RefPtr<StyleReflection> reflection = StyleReflection::create();
    2426         reflection->setDirection(*reflectValue.direction());
    2427         if (reflectValue.offset())
    2428             reflection->setOffset(reflectValue.offset()->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(state.cssToLengthConversionData()));
    2429         NinePieceImage mask;
    2430         mask.setMaskDefaults();
    2431         m_styleMap.mapNinePieceImage(id, reflectValue.mask(), mask);
    2432         reflection->setMask(mask);
    2433 
    2434         state.style()->setBoxReflect(reflection.release());
    2435         return;
    2436     }
    24372414    case CSSPropertySrc: // Only used in @font-face rules.
    24382415        return;
     
    30823059    case CSSPropertyWebkitBoxOrient:
    30833060    case CSSPropertyWebkitBoxPack:
     3061    case CSSPropertyWebkitBoxReflect:
    30843062    case CSSPropertyWebkitColorCorrection:
    30853063    case CSSPropertyWebkitColumnAxis:
Note: See TracChangeset for help on using the changeset viewer.