Changeset 175487 in webkit


Ignore:
Timestamp:
Nov 3, 2014 12:48:23 PM (9 years ago)
Author:
Chris Dumez
Message:

Support modern range loops over CSSValueList
https://bugs.webkit.org/show_bug.cgi?id=138285

Reviewed by Andreas Kling.

Add support for modern range loops over CSSValueList objects.
Port the code base to using range loops for CSSValueList objects and
drop the CSSValueListInspector / CSSValueListIterator classes as they
are no longer needed.

No new tests, no behavior change.

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r175485 r175487  
     12014-11-03  Chris Dumez  <cdumez@apple.com>
     2
     3        Support modern range loops over CSSValueList
     4        https://bugs.webkit.org/show_bug.cgi?id=138285
     5
     6        Reviewed by Andreas Kling.
     7
     8        Add support for modern range loops over CSSValueList objects.
     9        Port the code base to using range loops for CSSValueList objects and
     10        drop the CSSValueListInspector / CSSValueListIterator classes as they
     11        are no longer needed.
     12
     13        No new tests, no behavior change.
     14
    1152014-11-03  Andreas Kling  <akling@apple.com>
    216
  • trunk/Source/WebCore/css/CSSToStyleMap.cpp

    r174300 r175487  
    3131#include "Animation.h"
    3232#include "CSSBorderImageSliceValue.h"
     33#include "CSSImageGeneratorValue.h"
     34#include "CSSImageSetValue.h"
     35#include "CSSImageValue.h"
    3336#include "CSSPrimitiveValue.h"
    3437#include "CSSPrimitiveValueMappings.h"
     
    6366}
    6467
    65 PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSValue* value)
     68PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSValue& value)
    6669{
    6770    return m_resolver->styleImage(propertyId, value);
     
    157160    }
    158161
    159     layer->setImage(styleImage(property, value));
     162    layer->setImage(styleImage(property, *value));
    160163}
    161164
     
    323326}
    324327
    325 void CSSToStyleMap::mapAnimationDelay(Animation* animation, CSSValue* value)
    326 {
    327     if (value->isInitialValue()) {
     328void CSSToStyleMap::mapAnimationDelay(Animation* animation, CSSValue& value)
     329{
     330    if (value.isInitialValue()) {
    328331        animation->setDelay(Animation::initialAnimationDelay());
    329332        return;
    330333    }
    331334
    332     if (!is<CSSPrimitiveValue>(*value))
    333         return;
    334 
    335     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
    336     animation->setDelay(primitiveValue.computeTime<double, CSSPrimitiveValue::Seconds>());
    337 }
    338 
    339 void CSSToStyleMap::mapAnimationDirection(Animation* layer, CSSValue* value)
    340 {
    341     if (value->isInitialValue()) {
     335    if (!is<CSSPrimitiveValue>(value))
     336        return;
     337
     338    animation->setDelay(downcast<CSSPrimitiveValue>(value).computeTime<double, CSSPrimitiveValue::Seconds>());
     339}
     340
     341void CSSToStyleMap::mapAnimationDirection(Animation* layer, CSSValue& value)
     342{
     343    if (value.isInitialValue()) {
    342344        layer->setDirection(Animation::initialAnimationDirection());
    343345        return;
    344346    }
    345347
    346     if (!is<CSSPrimitiveValue>(*value))
    347         return;
    348 
    349     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
    350     switch (primitiveValue.getValueID()) {
     348    if (!is<CSSPrimitiveValue>(value))
     349        return;
     350
     351    switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
    351352    case CSSValueNormal:
    352353        layer->setDirection(Animation::AnimationDirectionNormal);
     
    366367}
    367368
    368 void CSSToStyleMap::mapAnimationDuration(Animation* animation, CSSValue* value)
    369 {
    370     if (value->isInitialValue()) {
     369void CSSToStyleMap::mapAnimationDuration(Animation* animation, CSSValue& value)
     370{
     371    if (value.isInitialValue()) {
    371372        animation->setDuration(Animation::initialAnimationDuration());
    372373        return;
    373374    }
    374375
    375     if (!is<CSSPrimitiveValue>(*value))
    376         return;
    377 
    378     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
    379     animation->setDuration(primitiveValue.computeTime<double, CSSPrimitiveValue::Seconds>());
    380 }
    381 
    382 void CSSToStyleMap::mapAnimationFillMode(Animation* layer, CSSValue* value)
    383 {
    384     if (value->isInitialValue()) {
     376    if (!is<CSSPrimitiveValue>(value))
     377        return;
     378
     379    animation->setDuration(downcast<CSSPrimitiveValue>(value).computeTime<double, CSSPrimitiveValue::Seconds>());
     380}
     381
     382void CSSToStyleMap::mapAnimationFillMode(Animation* layer, CSSValue& value)
     383{
     384    if (value.isInitialValue()) {
    385385        layer->setFillMode(Animation::initialAnimationFillMode());
    386386        return;
    387387    }
    388388
    389     if (!is<CSSPrimitiveValue>(*value))
    390         return;
    391 
    392     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
    393     switch (primitiveValue.getValueID()) {
     389    if (!is<CSSPrimitiveValue>(value))
     390        return;
     391
     392    switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
    394393    case CSSValueNone:
    395394        layer->setFillMode(AnimationFillModeNone);
     
    409408}
    410409
    411 void CSSToStyleMap::mapAnimationIterationCount(Animation* animation, CSSValue* value)
    412 {
    413     if (value->isInitialValue()) {
     410void CSSToStyleMap::mapAnimationIterationCount(Animation* animation, CSSValue& value)
     411{
     412    if (value.isInitialValue()) {
    414413        animation->setIterationCount(Animation::initialAnimationIterationCount());
    415414        return;
    416415    }
    417416
    418     if (!is<CSSPrimitiveValue>(*value))
    419         return;
    420 
    421     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
     417    if (!is<CSSPrimitiveValue>(value))
     418        return;
     419
     420    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
    422421    if (primitiveValue.getValueID() == CSSValueInfinite)
    423422        animation->setIterationCount(Animation::IterationCountInfinite);
     
    426425}
    427426
    428 void CSSToStyleMap::mapAnimationName(Animation* layer, CSSValue* value)
    429 {
    430     if (value->isInitialValue()) {
     427void CSSToStyleMap::mapAnimationName(Animation* layer, CSSValue& value)
     428{
     429    if (value.isInitialValue()) {
    431430        layer->setName(Animation::initialAnimationName());
    432431        return;
    433432    }
    434433
    435     if (!is<CSSPrimitiveValue>(*value))
    436         return;
    437 
    438     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
     434    if (!is<CSSPrimitiveValue>(value))
     435        return;
     436
     437    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
    439438    if (primitiveValue.getValueID() == CSSValueNone)
    440439        layer->setIsNoneAnimation(true);
     
    443442}
    444443
    445 void CSSToStyleMap::mapAnimationPlayState(Animation* layer, CSSValue* value)
    446 {
    447     if (value->isInitialValue()) {
     444void CSSToStyleMap::mapAnimationPlayState(Animation* layer, CSSValue& value)
     445{
     446    if (value.isInitialValue()) {
    448447        layer->setPlayState(Animation::initialAnimationPlayState());
    449448        return;
    450449    }
    451450
    452     if (!is<CSSPrimitiveValue>(*value))
    453         return;
    454 
    455     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
    456     EAnimPlayState playState = (primitiveValue.getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
     451    if (!is<CSSPrimitiveValue>(value))
     452        return;
     453
     454    EAnimPlayState playState = (downcast<CSSPrimitiveValue>(value).getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
    457455    layer->setPlayState(playState);
    458456}
    459457
    460 void CSSToStyleMap::mapAnimationProperty(Animation* animation, CSSValue* value)
    461 {
    462     if (value->isInitialValue()) {
     458void CSSToStyleMap::mapAnimationProperty(Animation* animation, CSSValue& value)
     459{
     460    if (value.isInitialValue()) {
    463461        animation->setAnimationMode(Animation::AnimateAll);
    464462        animation->setProperty(CSSPropertyInvalid);
     
    466464    }
    467465
    468     if (!is<CSSPrimitiveValue>(*value))
    469         return;
    470 
    471     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
     466    if (!is<CSSPrimitiveValue>(value))
     467        return;
     468
     469    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
    472470    if (primitiveValue.getValueID() == CSSValueAll) {
    473471        animation->setAnimationMode(Animation::AnimateAll);
     
    482480}
    483481
    484 void CSSToStyleMap::mapAnimationTimingFunction(Animation* animation, CSSValue* value)
    485 {
    486     if (value->isInitialValue()) {
     482void CSSToStyleMap::mapAnimationTimingFunction(Animation* animation, CSSValue& value)
     483{
     484    if (value.isInitialValue()) {
    487485        animation->setTimingFunction(Animation::initialAnimationTimingFunction());
    488486        return;
    489487    }
    490488
    491     if (is<CSSPrimitiveValue>(*value)) {
    492         CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
    493         switch (primitiveValue.getValueID()) {
     489    if (is<CSSPrimitiveValue>(value)) {
     490        switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
    494491        case CSSValueLinear:
    495492            animation->setTimingFunction(LinearTimingFunction::create());
     
    519516    }
    520517
    521     if (is<CSSCubicBezierTimingFunctionValue>(*value)) {
    522         CSSCubicBezierTimingFunctionValue& cubicTimingFunction = downcast<CSSCubicBezierTimingFunctionValue>(*value);
     518    if (is<CSSCubicBezierTimingFunctionValue>(value)) {
     519        auto& cubicTimingFunction = downcast<CSSCubicBezierTimingFunctionValue>(value);
    523520        animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction.x1(), cubicTimingFunction.y1(), cubicTimingFunction.x2(), cubicTimingFunction.y2()));
    524     } else if (is<CSSStepsTimingFunctionValue>(*value)) {
    525         CSSStepsTimingFunctionValue& stepsTimingFunction = downcast<CSSStepsTimingFunctionValue>(*value);
     521    } else if (is<CSSStepsTimingFunctionValue>(value)) {
     522        auto& stepsTimingFunction = downcast<CSSStepsTimingFunctionValue>(value);
    526523        animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepAtStart()));
    527524    }
     
    546543        imageProperty = property;
    547544
    548     for (unsigned i = 0 ; i < borderImage.length(); ++i) {
    549         CSSValue* current = borderImage.item(i);
    550 
    551         if (current->isImageValue() || current->isImageGeneratorValue()
     545    for (auto& current : borderImage) {
     546        if (is<CSSImageValue>(current.get()) || is<CSSImageGeneratorValue>(current.get())
    552547#if ENABLE(CSS_IMAGE_SET)
    553             || current->isImageSetValue()
     548            || is<CSSImageSetValue>(current.get())
    554549#endif
    555550            )
    556             image.setImage(styleImage(imageProperty, current));
    557         else if (current->isBorderImageSliceValue())
    558             mapNinePieceImageSlice(current, image);
    559         else if (is<CSSValueList>(*current)) {
    560             CSSValueList& slashList = downcast<CSSValueList>(*current);
     551            image.setImage(styleImage(imageProperty, current.get()));
     552        else if (is<CSSBorderImageSliceValue>(current.get()))
     553            mapNinePieceImageSlice(current.get(), image);
     554        else if (is<CSSValueList>(current.get())) {
     555            CSSValueList& slashList = downcast<CSSValueList>(current.get());
    561556            // Map in the image slices.
    562             if (slashList.item(0) && slashList.item(0)->isBorderImageSliceValue())
    563                 mapNinePieceImageSlice(slashList.item(0), image);
     557            if (is<CSSBorderImageSliceValue>(slashList.item(0)))
     558                mapNinePieceImageSlice(*slashList.item(0), image);
    564559
    565560            // Map in the border slices.
    566561            if (slashList.item(1))
    567                 image.setBorderSlices(mapNinePieceImageQuad(slashList.item(1)));
     562                image.setBorderSlices(mapNinePieceImageQuad(*slashList.item(1)));
    568563
    569564            // Map in the outset.
    570565            if (slashList.item(2))
    571                 image.setOutset(mapNinePieceImageQuad(slashList.item(2)));
    572         } else if (current->isPrimitiveValue()) {
     566                image.setOutset(mapNinePieceImageQuad(*slashList.item(2)));
     567        } else if (is<CSSPrimitiveValue>(current.get())) {
    573568            // Set the appropriate rules for stretch/round/repeat of the slices.
    574             mapNinePieceImageRepeat(current, image);
     569            mapNinePieceImageRepeat(current.get(), image);
    575570        }
    576571    }
     
    591586}
    592587
    593 void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& image)
     588void CSSToStyleMap::mapNinePieceImageSlice(CSSValue& value, NinePieceImage& image)
    594589{
    595590    if (!is<CSSBorderImageSliceValue>(value))
     
    597592
    598593    // Retrieve the border image value.
    599     CSSBorderImageSliceValue& borderImageSlice = downcast<CSSBorderImageSliceValue>(*value);
     594    auto& borderImageSlice = downcast<CSSBorderImageSliceValue>(value);
    600595
    601596    // Set up a length box to represent our image slices.
     
    624619}
    625620
    626 LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value)
     621LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue& value)
    627622{
    628623    if (!is<CSSPrimitiveValue>(value))
     
    633628
    634629    // Retrieve the primitive value.
    635     CSSPrimitiveValue& borderWidths = downcast<CSSPrimitiveValue>(*value);
     630    auto& borderWidths = downcast<CSSPrimitiveValue>(value);
    636631
    637632    // Set up a length box to represent our image slices.
     
    669664}
    670665
    671 void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& image)
    672 {
    673     if (!is<CSSPrimitiveValue>(value))
    674         return;
    675 
    676     CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
     666void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue& value, NinePieceImage& image)
     667{
     668    if (!is<CSSPrimitiveValue>(value))
     669        return;
     670
     671    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(value);
    677672    Pair* pair = primitiveValue.getPairValue();
    678673    if (!pair || !pair->first() || !pair->second())
  • trunk/Source/WebCore/css/CSSToStyleMap.h

    r167937 r175487  
    5959    void mapFillMaskSourceType(CSSPropertyID, FillLayer*, CSSValue*);
    6060
    61     void mapAnimationDelay(Animation*, CSSValue*);
    62     void mapAnimationDirection(Animation*, CSSValue*);
    63     void mapAnimationDuration(Animation*, CSSValue*);
    64     void mapAnimationFillMode(Animation*, CSSValue*);
    65     void mapAnimationIterationCount(Animation*, CSSValue*);
    66     void mapAnimationName(Animation*, CSSValue*);
    67     void mapAnimationPlayState(Animation*, CSSValue*);
    68     void mapAnimationProperty(Animation*, CSSValue*);
    69     void mapAnimationTimingFunction(Animation*, CSSValue*);
     61    void mapAnimationDelay(Animation*, CSSValue&);
     62    void mapAnimationDirection(Animation*, CSSValue&);
     63    void mapAnimationDuration(Animation*, CSSValue&);
     64    void mapAnimationFillMode(Animation*, CSSValue&);
     65    void mapAnimationIterationCount(Animation*, CSSValue&);
     66    void mapAnimationName(Animation*, CSSValue&);
     67    void mapAnimationPlayState(Animation*, CSSValue&);
     68    void mapAnimationProperty(Animation*, CSSValue&);
     69    void mapAnimationTimingFunction(Animation*, CSSValue&);
    7070
    7171    void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&);
    72     void mapNinePieceImageSlice(CSSValue*, NinePieceImage&);
    73     LengthBox mapNinePieceImageQuad(CSSValue*);
    74     void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&);
     72    void mapNinePieceImageSlice(CSSValue&, NinePieceImage&);
     73    LengthBox mapNinePieceImageQuad(CSSValue&);
     74    void mapNinePieceImageRepeat(CSSValue&, NinePieceImage&);
    7575
    7676private:
     
    8585    // is held by the StyleResolver, and likely provided to this object
    8686    // during the resolve.
    87     PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*);
     87    PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue&);
    8888
    8989    StyleResolver* m_resolver;
  • trunk/Source/WebCore/css/CSSValueList.h

    r174300 r175487  
    3232class CSSValueList : public CSSValue {
    3333public:
     34    typedef Vector<Ref<CSSValue>, 4>::iterator iterator;
     35    typedef Vector<Ref<CSSValue>, 4>::const_iterator const_iterator;
     36
    3437    static PassRef<CSSValueList> createCommaSeparated()
    3538    {
     
    5457    CSSValue* itemWithoutBoundsCheck(size_t index) { return &m_values[index].get(); }
    5558    const CSSValue* itemWithoutBoundsCheck(size_t index) const { ASSERT(index < m_values.size()); return &m_values[index].get(); }
     59
     60    const_iterator begin() const { return m_values.begin(); }
     61    const_iterator end() const { return m_values.end(); }
     62    iterator begin() { return m_values.begin(); }
     63    iterator end() { return m_values.end(); }
    5664
    5765    void append(PassRef<CSSValue>);
     
    92100}
    93101
    94 // Objects of this class are intended to be stack-allocated and scoped to a single function.
    95 // Please take care not to pass these around as they do hold onto a raw pointer.
    96 class CSSValueListInspector {
    97 public:
    98     CSSValueListInspector(CSSValue* value)
    99         : m_list(is<CSSValueList>(value) ? downcast<CSSValueList>(value) : nullptr)
    100     {
    101     }
    102 
    103     CSSValue* item(size_t index) const { ASSERT_WITH_SECURITY_IMPLICATION(index < length()); return m_list->itemWithoutBoundsCheck(index); }
    104     CSSValue* first() const { return item(0); }
    105     CSSValue* second() const { return item(1); }
    106     size_t length() const { return m_list ? m_list->length() : 0; }
    107 private:
    108     CSSValueList* m_list;
    109 };
    110 
    111 // Wrapper that can be used to iterate over any CSSValue. Non-list values and 0 behave as zero-length lists.
    112 // Objects of this class are intended to be stack-allocated and scoped to a single function.
    113 // Please take care not to pass these around as they do hold onto a raw pointer.
    114 class CSSValueListIterator {
    115 public:
    116     CSSValueListIterator(CSSValue* value) : m_inspector(value), m_position(0) { }
    117     bool hasMore() const { return m_position < m_inspector.length(); }
    118     CSSValue* value() const { return m_inspector.item(m_position); }
    119     bool isPrimitiveValue() const { return value()->isPrimitiveValue(); }
    120     void advance() { m_position++; ASSERT(m_position <= m_inspector.length());}
    121     size_t index() const { return m_position; }
    122 private:
    123     CSSValueListInspector m_inspector;
    124     size_t m_position;
    125 };
    126102} // namespace WebCore
    127103
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r175481 r175487  
    3333#include "CSSCalculationValue.h"
    3434#include "CSSCursorImageValue.h"
     35#include "CSSImageGeneratorValue.h"
    3536#include "CSSImageSetValue.h"
    3637#include "CSSPrimitiveValue.h"
     
    164165class ApplyPropertyStyleImage {
    165166public:
    166     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(property, value)); }
     167    static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(property, *value)); }
    167168    static PropertyHandler createHandler()
    168169    {
     
    851852        switch (modifier) {
    852853        case Outset:
    853             image.setOutset(styleResolver->styleMap()->mapNinePieceImageQuad(value));
     854            image.setOutset(styleResolver->styleMap()->mapNinePieceImageQuad(*value));
    854855            break;
    855856        case Repeat:
    856             styleResolver->styleMap()->mapNinePieceImageRepeat(value, image);
     857            styleResolver->styleMap()->mapNinePieceImageRepeat(*value, image);
    857858            break;
    858859        case Slice:
    859             styleResolver->styleMap()->mapNinePieceImageSlice(value, image);
     860            styleResolver->styleMap()->mapNinePieceImageSlice(*value, image);
    860861            break;
    861862        case Width:
    862             image.setBorderSlices(styleResolver->styleMap()->mapNinePieceImageQuad(value));
     863            image.setBorderSlices(styleResolver->styleMap()->mapNinePieceImageQuad(*value));
    863864            break;
    864865        }
     
    962963                    if (image.updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style.
    963964                        styleResolver->style()->setUnique();
    964                     styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, &image), image.hotSpot());
     965                    styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image.hotSpot());
    965966                } else if (is<CSSPrimitiveValue>(*item)) {
    966967                    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*item);
     
    10441045
    10451046        TextDecorationSkip skip = RenderStyle::initialTextDecorationSkip();
    1046         for (CSSValueListIterator i(value); i.hasMore(); i.advance())
    1047             skip |= valueToDecorationSkip(downcast<CSSPrimitiveValue>(*i.value()));
     1047        if (is<CSSValueList>(*value)) {
     1048            for (auto& currentValue : downcast<CSSValueList>(*value))
     1049                skip |= valueToDecorationSkip(downcast<CSSPrimitiveValue>(currentValue.get()));
     1050        }
    10481051        styleResolver->style()->setTextDecorationSkip(skip);
    10491052    }
     
    11211124
    11221125        unsigned t = 0;
    1123         for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
    1124             CSSValue* item = i.value();
    1125             TextUnderlinePosition t2 = downcast<CSSPrimitiveValue>(*item);
    1126             t |= t2;
     1126        if (is<CSSValueList>(*value)) {
     1127            for (auto& currentValue : downcast<CSSValueList>(*value)) {
     1128                TextUnderlinePosition t2 = downcast<CSSPrimitiveValue>(currentValue.get());
     1129                t |= t2;
     1130            }
    11271131        }
    11281132        styleResolver->style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t));
     
    13411345        Length height;
    13421346        PageSizeType pageSizeType = PAGE_SIZE_AUTO;
    1343         CSSValueListInspector inspector(value);
    1344         switch (inspector.length()) {
     1347        if (!is<CSSValueList>(value))
     1348            return;
     1349
     1350        auto& valueList = downcast<CSSValueList>(*value);
     1351        switch (valueList.length()) {
    13451352        case 2: {
     1353            CSSValue* firstValue = valueList.itemWithoutBoundsCheck(0);
     1354            CSSValue* secondValue = valueList.itemWithoutBoundsCheck(1);
    13461355            // <length>{2} | <page-size> <orientation>
    1347             if (!is<CSSPrimitiveValue>(*inspector.first()) || !is<CSSPrimitiveValue>(*inspector.second()))
     1356            if (!is<CSSPrimitiveValue>(*firstValue) || !is<CSSPrimitiveValue>(*secondValue))
    13481357                return;
    1349             CSSPrimitiveValue& first = downcast<CSSPrimitiveValue>(*inspector.first());
    1350             CSSPrimitiveValue& second = downcast<CSSPrimitiveValue>(*inspector.second());
    1351             if (first.isLength()) {
     1358            auto& firstPrimitiveValue = downcast<CSSPrimitiveValue>(*firstValue);
     1359            auto& secondPrimitiveValue = downcast<CSSPrimitiveValue>(*secondValue);
     1360            if (firstPrimitiveValue.isLength()) {
    13521361                // <length>{2}
    1353                 if (!second.isLength())
     1362                if (!secondPrimitiveValue.isLength())
    13541363                    return;
    13551364                CSSToLengthConversionData conversionData = styleResolver->state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f);
    1356                 width = first.computeLength<Length>(conversionData);
    1357                 height = second.computeLength<Length>(conversionData);
     1365                width = firstPrimitiveValue.computeLength<Length>(conversionData);
     1366                height = secondPrimitiveValue.computeLength<Length>(conversionData);
    13581367            } else {
    13591368                // <page-size> <orientation>
    13601369                // The value order is guaranteed. See CSSParser::parseSizeParameter.
    1361                 if (!getPageSizeFromName(&first, &second, width, height))
     1370                if (!getPageSizeFromName(&firstPrimitiveValue, &secondPrimitiveValue, width, height))
    13621371                    return;
    13631372            }
     
    13661375        }
    13671376        case 1: {
     1377            CSSValue* value = valueList.itemWithoutBoundsCheck(0);
    13681378            // <length> | auto | <page-size> | [ portrait | landscape]
    1369             if (!is<CSSPrimitiveValue>(*inspector.first()))
     1379            if (!is<CSSPrimitiveValue>(*value))
    13701380                return;
    1371             CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*inspector.first());
     1381            auto& primitiveValue = downcast<CSSPrimitiveValue>(*value);
    13721382            if (primitiveValue.isLength()) {
    13731383                // <length>
     
    14991509
    15001510        TextEmphasisPosition position = 0;
    1501         for (CSSValueListIterator i(value); i.hasMore(); i.advance())
    1502             position |= valueToEmphasisPosition(downcast<CSSPrimitiveValue>(*i.value()));
     1511        if (is<CSSValueList>(*value)) {
     1512            for (auto& currentValue : downcast<CSSValueList>(*value))
     1513                position |= valueToEmphasisPosition(downcast<CSSPrimitiveValue>(currentValue.get()));
     1514        }
    15031515        styleResolver->style()->setTextEmphasisPosition(position);
    15041516    }
     
    15161528          void (Animation::*clearFunction)(),
    15171529          T (*initialFunction)(),
    1518           void (CSSToStyleMap::*mapFunction)(Animation*, CSSValue*),
     1530          void (CSSToStyleMap::*mapFunction)(Animation*, CSSValue&),
    15191531          AnimationList* (RenderStyle::*animationGetterFunction)(),
    15201532          const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
     
    15261538    static void clear(Animation& animation) { (animation.*clearFunction)(); }
    15271539    static T initial() { return (*initialFunction)(); }
    1528     static void map(StyleResolver* styleResolver, Animation& animation, CSSValue* value) { (styleResolver->styleMap()->*mapFunction)(&animation, value); }
     1540    static void map(StyleResolver* styleResolver, Animation& animation, CSSValue& value) { (styleResolver->styleMap()->*mapFunction)(&animation, value); }
    15291541    static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
    15301542    static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
     
    15631575        AnimationList* list = accessAnimations(styleResolver->style());
    15641576        size_t childIndex = 0;
    1565         if (value->isValueList()) {
     1577        if (is<CSSValueList>(*value)) {
    15661578            /* Walk each value and put it into an animation, creating new animations as needed. */
    1567             for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
     1579            for (auto& currentValue : downcast<CSSValueList>(*value)) {
    15681580                if (childIndex <= list->size())
    15691581                    list->append(Animation::create());
    1570                 map(styleResolver, list->animation(childIndex), i.value());
     1582                map(styleResolver, list->animation(childIndex), currentValue.get());
    15711583                ++childIndex;
    15721584            }
     
    15741586            if (list->isEmpty())
    15751587                list->append(Animation::create());
    1576             map(styleResolver, list->animation(childIndex), value);
     1588            map(styleResolver, list->animation(childIndex), *value);
    15771589            childIndex = 1;
    15781590        }
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r175464 r175487  
    202202{
    203203    TextDecoration result = RenderStyle::initialTextDecoration();
    204     for (CSSValueListIterator it(&value); it.hasMore(); it.advance())
    205         result |= downcast<CSSPrimitiveValue>(*it.value());
     204    if (is<CSSValueList>(value)) {
     205        for (auto& currentValue : downcast<CSSValueList>(value))
     206            result |= downcast<CSSPrimitiveValue>(currentValue.get());
     207    }
    206208    return result;
    207209}
     
    243245inline PassRefPtr<StyleImage> StyleBuilderConverter::convertBorderImageSource(StyleResolver& styleResolver, CSSValue& value)
    244246{
    245     return styleResolver.styleImage(property, &value);
     247    return styleResolver.styleImage(property, value);
    246248}
    247249
  • trunk/Source/WebCore/css/StyleBuilderCustom.h

    r175481 r175487  
    123123            styleResolver.style()->setShapeOutside(nullptr);
    124124    } if (is<CSSImageValue>(value) || is<CSSImageGeneratorValue>(value) || is<CSSImageSetValue>(value)) {
    125         RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver.styleImage(CSSPropertyWebkitShapeOutside, &value));
     125        RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver.styleImage(CSSPropertyWebkitShapeOutside, value));
    126126        styleResolver.style()->setShapeOutside(shape.release());
    127127    } else if (is<CSSValueList>(value)) {
    128128        RefPtr<BasicShape> shape;
    129129        CSSBoxType referenceBox = BoxMissing;
    130         auto& valueList = downcast<CSSValueList>(value);
    131         for (unsigned i = 0; i < valueList.length(); ++i) {
    132             CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*valueList.itemWithoutBoundsCheck(i));
     130        for (auto& currentValue : downcast<CSSValueList>(value)) {
     131            CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get());
    133132            if (primitiveValue.isShape())
    134133                shape = basicShapeForValue(styleResolver.state().cssToLengthConversionData(), primitiveValue.getShapeValue());
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r175454 r175487  
    19301930}
    19311931
    1932 static bool createGridTrackSize(CSSValue* value, GridTrackSize& trackSize, const StyleResolver::State& state)
    1933 {
    1934     if (is<CSSPrimitiveValue>(*value)) {
    1935         CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
     1932static bool createGridTrackSize(CSSValue& value, GridTrackSize& trackSize, const StyleResolver::State& state)
     1933{
     1934    if (is<CSSPrimitiveValue>(value)) {
     1935        CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(value);
    19361936        GridLength workingLength;
    19371937        if (!createGridTrackBreadth(&primitiveValue, state, workingLength))
     
    19421942    }
    19431943
    1944     CSSFunctionValue& minmaxFunction = downcast<CSSFunctionValue>(*value);
     1944    CSSFunctionValue& minmaxFunction = downcast<CSSFunctionValue>(value);
    19451945    CSSValueList* arguments = minmaxFunction.arguments();
    19461946    ASSERT_WITH_SECURITY_IMPLICATION(arguments->length() == 2);
     
    19621962    }
    19631963
    1964     if (!value->isValueList())
     1964    if (!is<CSSValueList>(*value))
    19651965        return false;
    19661966
    19671967    size_t currentNamedGridLine = 0;
    1968     for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
    1969         CSSValue* currValue = i.value();
    1970         if (is<CSSGridLineNamesValue>(*currValue)) {
    1971             CSSGridLineNamesValue& lineNamesValue = downcast<CSSGridLineNamesValue>(*currValue);
    1972             for (CSSValueListIterator j = &lineNamesValue; j.hasMore(); j.advance()) {
    1973                 String namedGridLine = downcast<CSSPrimitiveValue>(j.value())->getStringValue();
     1968    for (auto& currentValue : downcast<CSSValueList>(*value)) {
     1969        if (is<CSSGridLineNamesValue>(currentValue.get())) {
     1970            for (auto& currentGridLineName : downcast<CSSGridLineNamesValue>(currentValue.get())) {
     1971                String namedGridLine = downcast<CSSPrimitiveValue>(currentGridLineName.get()).getStringValue();
    19741972                NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>());
    19751973                result.iterator->value.append(currentNamedGridLine);
     
    19821980        ++currentNamedGridLine;
    19831981        GridTrackSize trackSize;
    1984         if (!createGridTrackSize(currValue, trackSize, state))
     1982        if (!createGridTrackSize(currentValue.get(), trackSize, state))
    19851983            return false;
    19861984
     
    20112009    }
    20122010
    2013     CSSValueList& values = downcast<CSSValueList>(*value);
     2011    auto& values = downcast<CSSValueList>(*value);
    20142012    ASSERT(values.length());
    20152013
     
    20182016    String gridLineName;
    20192017
    2020     CSSValueListIterator it = &values;
    2021     CSSPrimitiveValue* currentValue = downcast<CSSPrimitiveValue>(it.value());
     2018    auto it = values.begin();
     2019    CSSPrimitiveValue* currentValue = &downcast<CSSPrimitiveValue>(it->get());
    20222020    if (currentValue->getValueID() == CSSValueSpan) {
    20232021        isSpanPosition = true;
    2024         it.advance();
    2025         currentValue = it.hasMore() ? downcast<CSSPrimitiveValue>(it.value()) : nullptr;
     2022        ++it;
     2023        currentValue = it != values.end() ? &downcast<CSSPrimitiveValue>(it->get()) : nullptr;
    20262024    }
    20272025
    20282026    if (currentValue && currentValue->isNumber()) {
    20292027        gridLineNumber = currentValue->getIntValue();
    2030         it.advance();
    2031         currentValue = it.hasMore() ? downcast<CSSPrimitiveValue>(it.value()) : nullptr;
     2028        ++it;
     2029        currentValue = it != values.end() ? &downcast<CSSPrimitiveValue>(it->get()) : nullptr;
    20322030    }
    20332031
    20342032    if (currentValue && currentValue->isString()) {
    20352033        gridLineName = currentValue->getStringValue();
    2036         it.advance();
    2037     }
    2038 
    2039     ASSERT(!it.hasMore());
     2034        ++it;
     2035    }
     2036
     2037    ASSERT(it != values.end());
    20402038    if (isSpanPosition)
    20412039        position.setSpanPosition(gridLineNumber ? gridLineNumber : 1, gridLineName);
     
    20742072
    20752073    points.hasRepeat = false;
    2076     for (CSSValueListIterator it(&value); it.hasMore(); it.advance()) {
    2077         auto& itemValue = downcast<CSSPrimitiveValue>(*it.value());
    2078         if (auto* lengthRepeat = itemValue.getLengthRepeatValue()) {
    2079             if (auto* interval = lengthRepeat->interval()) {
    2080                 points.repeatOffset = parseSnapCoordinate(*interval);
    2081                 points.hasRepeat = true;
    2082                 break;
     2074    if (is<CSSValueList>(value)) {
     2075        for (auto& currentValue : downcast<CSSValueList>(value)) {
     2076            auto& itemValue = downcast<CSSPrimitiveValue>(currentValue.get());
     2077            if (auto* lengthRepeat = itemValue.getLengthRepeatValue()) {
     2078                if (auto* interval = lengthRepeat->interval()) {
     2079                    points.repeatOffset = parseSnapCoordinate(*interval);
     2080                    points.hasRepeat = true;
     2081                    break;
     2082                }
    20832083            }
    2084         }
    2085         points.offsets.append(parseSnapCoordinate(itemValue));
     2084            points.offsets.append(parseSnapCoordinate(itemValue));
     2085        }
    20862086    }
    20872087
     
    21492149            }
    21502150
    2151             if (!value->isValueList())
     2151            if (!is<CSSValueList>(*value))
    21522152                return;
    21532153
    21542154            bool didSet = false;
    2155             for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
    2156                 CSSValue* item = i.value();
    2157                 if (is<CSSImageGeneratorValue>(*item)) {
    2158                     if (is<CSSGradientValue>(*item))
    2159                         state.style()->setContent(StyleGeneratedImage::create(*downcast<CSSGradientValue>(*item).gradientWithStylesResolved(this)), didSet);
     2155            for (auto& item : downcast<CSSValueList>(*value)) {
     2156                if (is<CSSImageGeneratorValue>(item.get())) {
     2157                    if (is<CSSGradientValue>(item.get()))
     2158                        state.style()->setContent(StyleGeneratedImage::create(*downcast<CSSGradientValue>(item.get()).gradientWithStylesResolved(this)), didSet);
    21602159                    else
    2161                         state.style()->setContent(StyleGeneratedImage::create(downcast<CSSImageGeneratorValue>(*item)), didSet);
     2160                        state.style()->setContent(StyleGeneratedImage::create(downcast<CSSImageGeneratorValue>(item.get())), didSet);
    21622161                    didSet = true;
    21632162#if ENABLE(CSS_IMAGE_SET)
    2164                 } else if (is<CSSImageSetValue>(*item)) {
    2165                     state.style()->setContent(setOrPendingFromValue(CSSPropertyContent, downcast<CSSImageSetValue>(item)), didSet);
     2163                } else if (is<CSSImageSetValue>(item.get())) {
     2164                    state.style()->setContent(setOrPendingFromValue(CSSPropertyContent, downcast<CSSImageSetValue>(item.get())), didSet);
    21662165                    didSet = true;
    21672166#endif
    21682167                }
    21692168
    2170                 if (is<CSSImageValue>(*item)) {
    2171                     state.style()->setContent(cachedOrPendingFromValue(CSSPropertyContent, downcast<CSSImageValue>(item)), didSet);
     2169                if (is<CSSImageValue>(item.get())) {
     2170                    state.style()->setContent(cachedOrPendingFromValue(CSSPropertyContent, downcast<CSSImageValue>(item.get())), didSet);
    21722171                    didSet = true;
    21732172                    continue;
    21742173                }
    21752174
    2176                 if (!is<CSSPrimitiveValue>(*item))
     2175                if (!is<CSSPrimitiveValue>(item.get()))
    21772176                    continue;
    21782177
    2179                 CSSPrimitiveValue& contentValue = downcast<CSSPrimitiveValue>(*item);
     2178                auto& contentValue = downcast<CSSPrimitiveValue>(item.get());
    21802179
    21812180                if (contentValue.isString()) {
     
    24032402            return id == CSSPropertyTextShadow ? state.style()->setTextShadow(nullptr) : state.style()->setBoxShadow(nullptr);
    24042403
    2405         if (!value->isValueList())
    2406             return;
    2407 
    2408         for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
    2409             CSSValue* currValue = i.value();
    2410             if (!is<CSSShadowValue>(*currValue))
     2404        if (!is<CSSValueList>(*value))
     2405            return;
     2406
     2407        bool isFirstEntry = true;
     2408        for (auto& currentValue : downcast<CSSValueList>(*value)) {
     2409            if (!is<CSSShadowValue>(currentValue.get()))
    24112410                continue;
    2412             CSSShadowValue& item = downcast<CSSShadowValue>(*currValue);
     2411            auto& item = downcast<CSSShadowValue>(currentValue.get());
    24132412            int x = item.x->computeLength<int>(state.cssToLengthConversionData());
    24142413            int y = item.y->computeLength<int>(state.cssToLengthConversionData());
     
    24242423            auto shadowData = std::make_unique<ShadowData>(IntPoint(x, y), blur, spread, shadowStyle, id == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent);
    24252424            if (id == CSSPropertyTextShadow)
    2426                 state.style()->setTextShadow(WTF::move(shadowData), i.index()); // add to the list if this is not the first entry
     2425                state.style()->setTextShadow(WTF::move(shadowData), !isFirstEntry); // add to the list if this is not the first entry
    24272426            else
    2428                 state.style()->setBoxShadow(WTF::move(shadowData), i.index()); // add to the list if this is not the first entry
     2427                state.style()->setBoxShadow(WTF::move(shadowData), !isFirstEntry); // add to the list if this is not the first entry
     2428
     2429            isFirstEntry = false;
    24292430        }
    24302431        return;
     
    27062707        HANDLE_INHERIT_AND_INITIAL(gridAutoColumns, GridAutoColumns);
    27072708        GridTrackSize trackSize;
    2708         if (!createGridTrackSize(value, trackSize, state))
     2709        if (!createGridTrackSize(*value, trackSize, state))
    27092710            return;
    27102711        state.style()->setGridAutoColumns(trackSize);
     
    27142715        HANDLE_INHERIT_AND_INITIAL(gridAutoRows, GridAutoRows);
    27152716        GridTrackSize trackSize;
    2716         if (!createGridTrackSize(value, trackSize, state))
     2717        if (!createGridTrackSize(*value, trackSize, state))
    27172718            return;
    27182719        state.style()->setGridAutoRows(trackSize);
     
    32143215}
    32153216
    3216 PassRefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValue* value)
    3217 {
    3218     if (is<CSSImageValue>(*value))
     3217PassRefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValue& value)
     3218{
     3219    if (is<CSSImageValue>(value))
    32193220        return cachedOrPendingFromValue(property, downcast<CSSImageValue>(value));
    32203221
    3221     if (is<CSSImageGeneratorValue>(*value)) {
    3222         if (is<CSSGradientValue>(*value))
    3223             return generatedOrPendingFromValue(property, *downcast<CSSGradientValue>(*value).gradientWithStylesResolved(this));
    3224         return generatedOrPendingFromValue(property, downcast<CSSImageGeneratorValue>(*value));
     3222    if (is<CSSImageGeneratorValue>(value)) {
     3223        if (is<CSSGradientValue>(value))
     3224            return generatedOrPendingFromValue(property, *downcast<CSSGradientValue>(value).gradientWithStylesResolved(this));
     3225        return generatedOrPendingFromValue(property, downcast<CSSImageGeneratorValue>(value));
    32253226    }
    32263227
    32273228#if ENABLE(CSS_IMAGE_SET)
    3228     if (is<CSSImageSetValue>(*value))
     3229    if (is<CSSImageSetValue>(value))
    32293230        return setOrPendingFromValue(property, downcast<CSSImageSetValue>(value));
    32303231#endif
    32313232
    3232     if (is<CSSCursorImageValue>(*value))
     3233    if (is<CSSCursorImageValue>(value))
    32333234        return cursorOrPendingFromValue(property, downcast<CSSCursorImageValue>(value));
    32343235
     
    32363237}
    32373238
    3238 PassRefPtr<StyleImage> StyleResolver::cachedOrPendingFromValue(CSSPropertyID property, CSSImageValue* value)
    3239 {
    3240     RefPtr<StyleImage> image = value->cachedOrPendingImage();
     3239PassRefPtr<StyleImage> StyleResolver::cachedOrPendingFromValue(CSSPropertyID property, CSSImageValue& value)
     3240{
     3241    RefPtr<StyleImage> image = value.cachedOrPendingImage();
    32413242    if (image && image->isPendingImage())
    3242         m_state.pendingImageProperties().set(property, value);
     3243        m_state.pendingImageProperties().set(property, &value);
    32433244    return image.release();
    32443245}
     
    32593260
    32603261#if ENABLE(CSS_IMAGE_SET)
    3261 PassRefPtr<StyleImage> StyleResolver::setOrPendingFromValue(CSSPropertyID property, CSSImageSetValue* value)
    3262 {
    3263     RefPtr<StyleImage> image = value->cachedOrPendingImageSet(document());
     3262PassRefPtr<StyleImage> StyleResolver::setOrPendingFromValue(CSSPropertyID property, CSSImageSetValue& value)
     3263{
     3264    RefPtr<StyleImage> image = value.cachedOrPendingImageSet(document());
    32643265    if (image && image->isPendingImage())
    3265         m_state.pendingImageProperties().set(property, value);
     3266        m_state.pendingImageProperties().set(property, &value);
    32663267    return image.release();
    32673268}
    32683269#endif
    32693270
    3270 PassRefPtr<StyleImage> StyleResolver::cursorOrPendingFromValue(CSSPropertyID property, CSSCursorImageValue* value)
    3271 {
    3272     RefPtr<StyleImage> image = value->cachedOrPendingImage(document());
     3271PassRefPtr<StyleImage> StyleResolver::cursorOrPendingFromValue(CSSPropertyID property, CSSCursorImageValue& value)
     3272{
     3273    RefPtr<StyleImage> image = value.cachedOrPendingImage(document());
    32733274    if (image && image->isPendingImage())
    3274         m_state.pendingImageProperties().set(property, value);
     3275        m_state.pendingImageProperties().set(property, &value);
    32753276    return image.release();
    32763277}
     
    35193520    }
    35203521   
    3521     if (!inValue->isValueList())
     3522    if (!is<CSSValueList>(*inValue))
    35223523        return false;
    35233524
    35243525    FilterOperations operations;
    3525     for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
    3526         CSSValue* currValue = i.value();
    3527         if (!is<WebKitCSSFilterValue>(*currValue))
     3526    for (auto& currentValue : downcast<CSSValueList>(*inValue)) {
     3527        if (!is<WebKitCSSFilterValue>(currentValue.get()))
    35283528            continue;
    35293529
    3530         WebKitCSSFilterValue& filterValue = downcast<WebKitCSSFilterValue>(*i.value());
     3530        auto& filterValue = downcast<WebKitCSSFilterValue>(currentValue.get());
    35313531        FilterOperation::OperationType operationType = filterOperationForType(filterValue.operationType());
    35323532
  • trunk/Source/WebCore/css/StyleResolver.h

    r174648 r175487  
    448448    static RenderStyle* styleNotYetAvailable() { return s_styleNotYetAvailable; }
    449449
    450     PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*);
    451     PassRefPtr<StyleImage> cachedOrPendingFromValue(CSSPropertyID, CSSImageValue*);
     450    PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue&);
     451    PassRefPtr<StyleImage> cachedOrPendingFromValue(CSSPropertyID, CSSImageValue&);
    452452    PassRefPtr<StyleImage> generatedOrPendingFromValue(CSSPropertyID, CSSImageGeneratorValue&);
    453453#if ENABLE(CSS_IMAGE_SET)
    454     PassRefPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, CSSImageSetValue*);
     454    PassRefPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, CSSImageSetValue&);
    455455#endif
    456     PassRefPtr<StyleImage> cursorOrPendingFromValue(CSSPropertyID, CSSCursorImageValue*);
     456    PassRefPtr<StyleImage> cursorOrPendingFromValue(CSSPropertyID, CSSCursorImageValue&);
    457457
    458458    bool applyPropertyToRegularStyle() const { return m_state.applyPropertyToRegularStyle(); }
  • trunk/Source/WebCore/css/TransformFunctions.cpp

    r175454 r175487  
    8484bool transformsForValue(CSSValue& value, const CSSToLengthConversionData& conversionData, TransformOperations& outOperations)
    8585{
    86     if (!value.isValueList()) {
     86    if (!is<CSSValueList>(value)) {
    8787        outOperations.clear();
    8888        return false;
     
    9090
    9191    TransformOperations operations;
    92     for (CSSValueListIterator i = &value; i.hasMore(); i.advance()) {
    93         CSSValue& currValue = *i.value();
    94 
    95         if (!is<WebKitCSSTransformValue>(currValue))
     92    for (auto& currentValue : downcast<CSSValueList>(value)) {
     93        if (!is<WebKitCSSTransformValue>(currentValue.get()))
    9694            continue;
    9795
    98         WebKitCSSTransformValue& transformValue = downcast<WebKitCSSTransformValue>(currValue);
     96        auto& transformValue = downcast<WebKitCSSTransformValue>(currentValue.get());
    9997        if (!transformValue.length())
    10098            continue;
Note: See TracChangeset for help on using the changeset viewer.