Changeset 18850 in webkit


Ignore:
Timestamp:
Jan 14, 2007 5:08:44 PM (17 years ago)
Author:
weinig
Message:

Reviewed by Darin and then by Mitz.

Patch for http://bugs.webkit.org/show_bug.cgi?id=12228
Cleanup assorted CSS classes

  • css/CSSBorderImageValue.cpp: (WebCore::CSSBorderImageValue::CSSBorderImageValue): (WebCore::CSSBorderImageValue::cssText):
  • css/CSSBorderImageValue.h:
  • css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForLength): (WebCore::valueForBorderStyle): (WebCore::valueForTextAlign): (WebCore::valueForShadow): (WebCore::getPositionOffsetValue): (WebCore::CSSComputedStyleDeclaration::cssText): (WebCore::primitiveValueFromLength): (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): (WebCore::CSSComputedStyleDeclaration::getPropertyPriority): (WebCore::CSSComputedStyleDeclaration::removeProperty): (WebCore::CSSComputedStyleDeclaration::setProperty): (WebCore::CSSComputedStyleDeclaration::length): (WebCore::CSSComputedStyleDeclaration::item):
  • css/CSSComputedStyleDeclaration.h:
  • css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::CSSCursorImageValue):
  • css/CSSCursorImageValue.h:
  • css/CSSGrammar.y:
  • css/CSSImageValue.cpp:
  • css/CSSImageValue.h:
  • css/CSSInheritedValue.cpp:
  • css/CSSInheritedValue.h:
  • css/CSSInitialValue.cpp:
  • css/CSSInitialValue.h:
  • css/CSSMutableStyleDeclaration.cpp: (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration): (WebCore::CSSMutableStyleDeclaration::operator=): (WebCore::CSSMutableStyleDeclaration::getPropertyValue): (WebCore::CSSMutableStyleDeclaration::get4Values): (WebCore::CSSMutableStyleDeclaration::getShorthandValue): (WebCore::CSSMutableStyleDeclaration::getPropertyCSSValue): (WebCore::CSSMutableStyleDeclaration::removeProperty): (WebCore::CSSMutableStyleDeclaration::setChanged): (WebCore::CSSMutableStyleDeclaration::getPropertyPriority): (WebCore::CSSMutableStyleDeclaration::getPropertyShorthand): (WebCore::CSSMutableStyleDeclaration::isPropertyImplicit): (WebCore::CSSMutableStyleDeclaration::setProperty): (WebCore::CSSMutableStyleDeclaration::setImageProperty): (WebCore::CSSMutableStyleDeclaration::parseDeclaration): (WebCore::CSSMutableStyleDeclaration::addParsedProperties): (WebCore::CSSMutableStyleDeclaration::setLengthProperty): (WebCore::CSSMutableStyleDeclaration::cssText): (WebCore::CSSMutableStyleDeclaration::merge): (WebCore::CSSMutableStyleDeclaration::removePropertiesInSet):
  • css/CSSMutableStyleDeclaration.h: (WebCore::CSSMutableStyleDeclaration::setProperty): (WebCore::CSSMutableStyleDeclaration::removeProperty):
  • css/CSSNamespace.h: (WebCore::CSSNamespace::CSSNamespace):
  • css/CSSPrimitiveValue.cpp: (WebCore::isCSSTokenizerIdentifier): (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::cleanup): (WebCore::CSSPrimitiveValue::computeLengthInt): (WebCore::CSSPrimitiveValue::computeLengthIntForLength): (WebCore::CSSPrimitiveValue::computeLengthShort): (WebCore::CSSPrimitiveValue::computeLengthFloat): (WebCore::CSSPrimitiveValue::setFloatValue): (WebCore::scaleFactorForConversion): (WebCore::CSSPrimitiveValue::getFloatValue): (WebCore::CSSPrimitiveValue::setStringValue): (WebCore::CSSPrimitiveValue::getStringValue): (WebCore::CSSPrimitiveValue::parseString): (WebCore::CSSPrimitiveValue::getIdent): (WebCore::CSSPrimitiveValue::cssText):
  • css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::getCounterValue): (WebCore::CSSPrimitiveValue::getRectValue): (WebCore::CSSPrimitiveValue::getRGBColorValue): (WebCore::CSSPrimitiveValue::getPairValue): (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
  • css/CSSProperty.cpp: (WebCore::operator==):
  • css/CSSProperty.h: (WebCore::CSSProperty::operator=):
  • css/CSSQuirkPrimitiveValue.h: (WebCore::CSSQuirkPrimitiveValue::CSSQuirkPrimitiveValue):
  • css/CSSRuleList.cpp: (WebCore::CSSRuleList::CSSRuleList): (WebCore::CSSRuleList::deleteRule): (WebCore::CSSRuleList::insertRule):
  • css/CSSRuleList.h: (WebCore::CSSRuleList::item):
  • css/CSSSelector.cpp: (WebCore::CSSSelector::print): (WebCore::CSSSelector::specificity): (WebCore::CSSSelector::extractPseudoType): (WebCore::CSSSelector::operator==): (WebCore::CSSSelector::selectorText):
  • css/CSSSelector.h: (WebCore::CSSSelector::CSSSelector): (WebCore::CSSSelector::~CSSSelector): (WebCore::CSSSelector::append): (WebCore::CSSSelector::next): (WebCore::CSSSelector::pseudoType): (WebCore::CSSSelector::hasTag): (WebCore::CSSSelector::hasAttribute):
  • css/CSSStyleDeclaration.cpp: (WebCore::propertyID): (WebCore::CSSStyleDeclaration::getPropertyPriority): (WebCore::CSSStyleDeclaration::getPropertyShorthand): (WebCore::CSSStyleDeclaration::isPropertyImplicit): (WebCore::CSSStyleDeclaration::setProperty): (WebCore::CSSStyleDeclaration::isPropertyName): (WebCore::CSSStyleDeclaration::parentRule): (WebCore::CSSStyleDeclaration::diff): (WebCore::CSSStyleDeclaration::copyPropertiesInSet):
  • css/CSSStyleDeclaration.h:
  • css/Counter.h: (WebCore::Counter::Counter): (WebCore::Counter::listStyleNumber):
  • css/csshelper.cpp: (WebCore::parseURL):
  • css/csshelper.h:
  • css/cssparser.h: (WebCore::domString): (WebCore::atomicString): (WebCore::CSSParser::operator|):
  • css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::matchRulesForList): (WebCore::CSSStyleSelector::checkSelector): (WebCore::CSSStyleSelector::checkOneSelector): (WebCore::CSSRuleSet::addRule):
Location:
trunk/WebCore
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r18848 r18850  
     12007-01-14  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Darin and then by Mitz.
     4
     5        Patch for http://bugs.webkit.org/show_bug.cgi?id=12228
     6        Cleanup assorted CSS classes
     7
     8        * css/CSSBorderImageValue.cpp:
     9        (WebCore::CSSBorderImageValue::CSSBorderImageValue):
     10        (WebCore::CSSBorderImageValue::cssText):
     11        * css/CSSBorderImageValue.h:
     12        * css/CSSComputedStyleDeclaration.cpp:
     13        (WebCore::valueForLength):
     14        (WebCore::valueForBorderStyle):
     15        (WebCore::valueForTextAlign):
     16        (WebCore::valueForShadow):
     17        (WebCore::getPositionOffsetValue):
     18        (WebCore::CSSComputedStyleDeclaration::cssText):
     19        (WebCore::primitiveValueFromLength):
     20        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     21        (WebCore::CSSComputedStyleDeclaration::getPropertyPriority):
     22        (WebCore::CSSComputedStyleDeclaration::removeProperty):
     23        (WebCore::CSSComputedStyleDeclaration::setProperty):
     24        (WebCore::CSSComputedStyleDeclaration::length):
     25        (WebCore::CSSComputedStyleDeclaration::item):
     26        * css/CSSComputedStyleDeclaration.h:
     27        * css/CSSCursorImageValue.cpp:
     28        (WebCore::CSSCursorImageValue::CSSCursorImageValue):
     29        * css/CSSCursorImageValue.h:
     30        * css/CSSGrammar.y:
     31        * css/CSSImageValue.cpp:
     32        * css/CSSImageValue.h:
     33        * css/CSSInheritedValue.cpp:
     34        * css/CSSInheritedValue.h:
     35        * css/CSSInitialValue.cpp:
     36        * css/CSSInitialValue.h:
     37        * css/CSSMutableStyleDeclaration.cpp:
     38        (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
     39        (WebCore::CSSMutableStyleDeclaration::operator=):
     40        (WebCore::CSSMutableStyleDeclaration::getPropertyValue):
     41        (WebCore::CSSMutableStyleDeclaration::get4Values):
     42        (WebCore::CSSMutableStyleDeclaration::getShorthandValue):
     43        (WebCore::CSSMutableStyleDeclaration::getPropertyCSSValue):
     44        (WebCore::CSSMutableStyleDeclaration::removeProperty):
     45        (WebCore::CSSMutableStyleDeclaration::setChanged):
     46        (WebCore::CSSMutableStyleDeclaration::getPropertyPriority):
     47        (WebCore::CSSMutableStyleDeclaration::getPropertyShorthand):
     48        (WebCore::CSSMutableStyleDeclaration::isPropertyImplicit):
     49        (WebCore::CSSMutableStyleDeclaration::setProperty):
     50        (WebCore::CSSMutableStyleDeclaration::setImageProperty):
     51        (WebCore::CSSMutableStyleDeclaration::parseDeclaration):
     52        (WebCore::CSSMutableStyleDeclaration::addParsedProperties):
     53        (WebCore::CSSMutableStyleDeclaration::setLengthProperty):
     54        (WebCore::CSSMutableStyleDeclaration::cssText):
     55        (WebCore::CSSMutableStyleDeclaration::merge):
     56        (WebCore::CSSMutableStyleDeclaration::removePropertiesInSet):
     57        * css/CSSMutableStyleDeclaration.h:
     58        (WebCore::CSSMutableStyleDeclaration::setProperty):
     59        (WebCore::CSSMutableStyleDeclaration::removeProperty):
     60        * css/CSSNamespace.h:
     61        (WebCore::CSSNamespace::CSSNamespace):
     62        * css/CSSPrimitiveValue.cpp:
     63        (WebCore::isCSSTokenizerIdentifier):
     64        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     65        (WebCore::CSSPrimitiveValue::cleanup):
     66        (WebCore::CSSPrimitiveValue::computeLengthInt):
     67        (WebCore::CSSPrimitiveValue::computeLengthIntForLength):
     68        (WebCore::CSSPrimitiveValue::computeLengthShort):
     69        (WebCore::CSSPrimitiveValue::computeLengthFloat):
     70        (WebCore::CSSPrimitiveValue::setFloatValue):
     71        (WebCore::scaleFactorForConversion):
     72        (WebCore::CSSPrimitiveValue::getFloatValue):
     73        (WebCore::CSSPrimitiveValue::setStringValue):
     74        (WebCore::CSSPrimitiveValue::getStringValue):
     75        (WebCore::CSSPrimitiveValue::parseString):
     76        (WebCore::CSSPrimitiveValue::getIdent):
     77        (WebCore::CSSPrimitiveValue::cssText):
     78        * css/CSSPrimitiveValue.h:
     79        (WebCore::CSSPrimitiveValue::getCounterValue):
     80        (WebCore::CSSPrimitiveValue::getRectValue):
     81        (WebCore::CSSPrimitiveValue::getRGBColorValue):
     82        (WebCore::CSSPrimitiveValue::getPairValue):
     83        (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
     84        * css/CSSProperty.cpp:
     85        (WebCore::operator==):
     86        * css/CSSProperty.h:
     87        (WebCore::CSSProperty::operator=):
     88        * css/CSSQuirkPrimitiveValue.h:
     89        (WebCore::CSSQuirkPrimitiveValue::CSSQuirkPrimitiveValue):
     90        * css/CSSRuleList.cpp:
     91        (WebCore::CSSRuleList::CSSRuleList):
     92        (WebCore::CSSRuleList::deleteRule):
     93        (WebCore::CSSRuleList::insertRule):
     94        * css/CSSRuleList.h:
     95        (WebCore::CSSRuleList::item):
     96        * css/CSSSelector.cpp:
     97        (WebCore::CSSSelector::print):
     98        (WebCore::CSSSelector::specificity):
     99        (WebCore::CSSSelector::extractPseudoType):
     100        (WebCore::CSSSelector::operator==):
     101        (WebCore::CSSSelector::selectorText):
     102        * css/CSSSelector.h:
     103        (WebCore::CSSSelector::CSSSelector):
     104        (WebCore::CSSSelector::~CSSSelector):
     105        (WebCore::CSSSelector::append):
     106        (WebCore::CSSSelector::next):
     107        (WebCore::CSSSelector::pseudoType):
     108        (WebCore::CSSSelector::hasTag):
     109        (WebCore::CSSSelector::hasAttribute):
     110        * css/CSSStyleDeclaration.cpp:
     111        (WebCore::propertyID):
     112        (WebCore::CSSStyleDeclaration::getPropertyPriority):
     113        (WebCore::CSSStyleDeclaration::getPropertyShorthand):
     114        (WebCore::CSSStyleDeclaration::isPropertyImplicit):
     115        (WebCore::CSSStyleDeclaration::setProperty):
     116        (WebCore::CSSStyleDeclaration::isPropertyName):
     117        (WebCore::CSSStyleDeclaration::parentRule):
     118        (WebCore::CSSStyleDeclaration::diff):
     119        (WebCore::CSSStyleDeclaration::copyPropertiesInSet):
     120        * css/CSSStyleDeclaration.h:
     121        * css/Counter.h:
     122        (WebCore::Counter::Counter):
     123        (WebCore::Counter::listStyleNumber):
     124        * css/csshelper.cpp:
     125        (WebCore::parseURL):
     126        * css/csshelper.h:
     127        * css/cssparser.h:
     128        (WebCore::domString):
     129        (WebCore::atomicString):
     130        (WebCore::CSSParser::operator|):
     131        * css/cssstyleselector.cpp:
     132        (WebCore::CSSStyleSelector::matchRulesForList):
     133        (WebCore::CSSStyleSelector::checkSelector):
     134        (WebCore::CSSStyleSelector::checkOneSelector):
     135        (WebCore::CSSRuleSet::addRule):
     136
    11372007-01-14  Mitz Pettel  <mitz@webkit.org>
    2138
  • trunk/WebCore/css/CSSBorderImageValue.cpp

    r14408 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSBorderImageValue.h"
     
    2930namespace WebCore {
    3031
    31 CSSBorderImageValue::CSSBorderImageValue(PassRefPtr<CSSImageValue> image,
    32     PassRefPtr<RectImpl> imageRect, int horizontalRule, int verticalRule)
     32CSSBorderImageValue::CSSBorderImageValue(PassRefPtr<CSSImageValue> image, PassRefPtr<RectImpl> imageRect, int horizontalRule, int verticalRule)
    3333    : m_image(image)
    3434    , m_imageSliceRect(imageRect)
     
    4343    String text(m_image->cssText());
    4444    text += " ";
    45    
     45
    4646    // Now the rect, but it isn't really a rect, so we dump manually
    4747    text += m_imageSliceRect->top()->cssText();
     
    5252    text += " ";
    5353    text += m_imageSliceRect->left()->cssText();
    54    
     54
    5555    // Now the keywords.
    5656    text += " ";
     
    6262}
    6363
    64 }
     64} // namespace WebCore
  • trunk/WebCore/css/CSSBorderImageValue.h

    r14408 r18850  
    2121 */
    2222
    23 #ifndef CSSBorderImageValue_H
    24 #define CSSBorderImageValue_H
     23#ifndef CSSBorderImageValue_h
     24#define CSSBorderImageValue_h
    2525
    2626#include "CSSValue.h"
     
    3333class RectImpl;
    3434
    35 class CSSBorderImageValue : public CSSValue
    36 {
     35class CSSBorderImageValue : public CSSValue {
    3736public:
    3837    CSSBorderImageValue();
     
    4847    // or percentages.
    4948    RefPtr<RectImpl> m_imageSliceRect;
    50    
     49
    5150    // Values for how to handle the scaling/stretching/tiling of the image slices.
    5251    int m_horizontalSizeRule; // Rule for how to adjust the widths of the top/middle/bottom
     
    5453};
    5554
    56 } // namespace
     55} // namespace WebCore
    5756
    58 #endif
     57#endif // CSSBorderImageValue_h
  • trunk/WebCore/css/CSSComputedStyleDeclaration.cpp

    r18838 r18850  
    11/**
    2  * CSSComputedStyleDeclaration.cpp
    32 *
    43 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
     
    2423#include "CSSComputedStyleDeclaration.h"
    2524
    26 #include "CachedImage.h"
    27 #include "DashboardRegion.h"
    28 #include "Document.h"
    29 #include "ExceptionCode.h"
    3025#include "CSSMutableStyleDeclaration.h"
    3126#include "CSSPrimitiveValue.h"
     
    3328#include "CSSValueKeywords.h"
    3429#include "CSSValueList.h"
     30#include "CachedImage.h"
     31#include "DashboardRegion.h"
     32#include "Document.h"
     33#include "ExceptionCode.h"
    3534#include "Pair.h"
    3635#include "RenderObject.h"
     
    183182        case Relative:
    184183        case Static:
    185             // Should never be reached.
    186184            break;
    187185    }
    188     // Should never be reached, but if we do, just return "auto".
    189     return new CSSPrimitiveValue(CSS_VAL_AUTO);
     186    ASSERT_NOT_REACHED();
     187    return 0;
    190188}
    191189
     
    198196}
    199197
    200 static CSSValue *valueForBorderStyle(EBorderStyle style)
     198static CSSValue* valueForBorderStyle(EBorderStyle style)
    201199{
    202200    switch (style) {
     
    226224}
    227225
    228 static CSSValue *valueForTextAlign(ETextAlign align)
     226static CSSValue* valueForTextAlign(ETextAlign align)
    229227{
    230228    switch (align) {
     
    254252    if (!shadow)
    255253        return new CSSPrimitiveValue(CSS_VAL_NONE);
     254
    256255    CSSValueList* list = new CSSValueList;
    257256    for (const ShadowData* s = shadow; s; s = s->next) {
     
    265264}
    266265
    267 static CSSValue *getPositionOffsetValue(RenderObject *renderer, int propertyID)
     266static CSSValue* getPositionOffsetValue(RenderObject* renderer, int propertyID)
    268267{
    269268    if (!renderer)
    270269        return 0;
    271270
    272     RenderStyle *style = renderer->style();
     271    RenderStyle* style = renderer->style();
    273272    if (!style)
    274273        return 0;
     
    276275    Length l;
    277276    switch (propertyID) {
    278     case CSS_PROP_LEFT:
    279         l = style->left();
    280         break;
    281     case CSS_PROP_RIGHT:
    282         l = style->right();
    283         break;
    284     case CSS_PROP_TOP:
    285         l = style->top();
    286         break;
    287     case CSS_PROP_BOTTOM:
    288         l = style->bottom();
    289         break;
    290     default:
    291         return 0;
     277        case CSS_PROP_LEFT:
     278            l = style->left();
     279            break;
     280        case CSS_PROP_RIGHT:
     281            l = style->right();
     282            break;
     283        case CSS_PROP_TOP:
     284            l = style->top();
     285            break;
     286        case CSS_PROP_BOTTOM:
     287            l = style->bottom();
     288            break;
     289        default:
     290            return 0;
    292291    }
    293292
    294293    if (renderer->isPositioned())
    295294        return valueForLength(l);
    296    
     295
    297296    if (renderer->isRelPositioned())
    298297        // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined.
     
    300299        // So we should get the opposite length unit and see if it is auto.
    301300        return valueForLength(l);
    302    
     301
    303302    return new CSSPrimitiveValue(CSS_VAL_AUTO);
    304303}
     
    323322{
    324323    String result("");
    325    
     324
    326325    for (unsigned i = 0; i < numComputedProperties; i++) {
    327         if (i != 0)
     326        if (i)
    328327            result += " ";
    329328        result += getPropertyName(computedProperties[i]);
     
    332331        result += ";";
    333332    }
    334    
     333
    335334    return result;
    336335}
     
    356355{
    357356    String string;
    358     if (length.isPercent())
    359         string = numberAsString(length.percent()) + "%";
    360     else if (length.isFixed())
    361         string = numberAsString(length.calcMinValue(0));
    362     else if (length.isAuto())
    363         string = "auto";
     357    switch (length.type()) {
     358        case Percent:
     359            string = numberAsString(length.percent()) + "%";
     360            break;
     361        case Fixed:
     362            string = numberAsString(length.calcMinValue(0));
     363            break;
     364        case Auto:
     365            string = "auto";
     366            break;
     367        default:
     368            break;
     369    }
    364370    return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
    365371}
     
    379385    if (!renderer)
    380386        return 0;
     387
    381388    RenderStyle* style = renderer->style();
    382389    if (!style)
    383390        return 0;
    384391
    385     switch (propertyID)
    386     {
    387     case CSS_PROP_BACKGROUND_COLOR:
    388         return new CSSPrimitiveValue(style->backgroundColor().rgb());
    389     case CSS_PROP_BACKGROUND_IMAGE:
    390         if (style->backgroundImage())
    391             return new CSSPrimitiveValue(style->backgroundImage()->url(), CSSPrimitiveValue::CSS_URI);
    392         return new CSSPrimitiveValue(CSS_VAL_NONE);
    393     case CSS_PROP__WEBKIT_BACKGROUND_SIZE: {
    394         Length widthLength = style->backgroundSize().width;
    395         Length heightLength = style->backgroundSize().height;
    396         CSSPrimitiveValue* bgWidth = primitiveValueFromLength(widthLength, renderer, style);
    397         CSSPrimitiveValue* bgHeight = primitiveValueFromLength(heightLength, renderer, style);
    398         Pair* pair = new Pair(bgWidth, bgHeight);
    399         return new CSSPrimitiveValue(pair);
    400     }
    401     case CSS_PROP_BACKGROUND_REPEAT:
    402         switch (style->backgroundRepeat()) {
    403             case REPEAT:
    404                 return new CSSPrimitiveValue(CSS_VAL_REPEAT);
    405             case REPEAT_X:
    406                 return new CSSPrimitiveValue(CSS_VAL_REPEAT_X);
    407             case REPEAT_Y:
    408                 return new CSSPrimitiveValue(CSS_VAL_REPEAT_Y);
    409             case NO_REPEAT:
    410                 return new CSSPrimitiveValue(CSS_VAL_NO_REPEAT);
     392    switch (propertyID) {
     393        case CSS_PROP_BACKGROUND_COLOR:
     394            return new CSSPrimitiveValue(style->backgroundColor().rgb());
     395        case CSS_PROP_BACKGROUND_IMAGE:
     396            if (style->backgroundImage())
     397                return new CSSPrimitiveValue(style->backgroundImage()->url(), CSSPrimitiveValue::CSS_URI);
     398            return new CSSPrimitiveValue(CSS_VAL_NONE);
     399        case CSS_PROP__WEBKIT_BACKGROUND_SIZE: {
     400            Length widthLength = style->backgroundSize().width;
     401            Length heightLength = style->backgroundSize().height;
     402            CSSPrimitiveValue* bgWidth = primitiveValueFromLength(widthLength, renderer, style);
     403            CSSPrimitiveValue* bgHeight = primitiveValueFromLength(heightLength, renderer, style);
     404            Pair* pair = new Pair(bgWidth, bgHeight);
     405            return new CSSPrimitiveValue(pair);
    411406        }
    412         ASSERT_NOT_REACHED();
    413         return 0;
    414     case CSS_PROP__WEBKIT_BACKGROUND_COMPOSITE:
    415         switch (style->backgroundComposite()) {
    416             case CompositeClear:
    417                 return new CSSPrimitiveValue(CSS_VAL_CLEAR);
    418             case CompositeCopy:
    419                 return new CSSPrimitiveValue(CSS_VAL_COPY);
    420             case CompositeSourceOver:
    421                 return new CSSPrimitiveValue(CSS_VAL_SOURCE_OVER);
    422             case CompositeSourceIn:
    423                 return new CSSPrimitiveValue(CSS_VAL_SOURCE_IN);
    424             case CompositeSourceOut:
    425                 return new CSSPrimitiveValue(CSS_VAL_SOURCE_OUT);
    426             case CompositeSourceAtop:
    427                 return new CSSPrimitiveValue(CSS_VAL_SOURCE_ATOP);
    428             case CompositeDestinationOver:
    429                 return new CSSPrimitiveValue(CSS_VAL_DESTINATION_OVER);
    430             case CompositeDestinationIn:
    431                 return new CSSPrimitiveValue(CSS_VAL_DESTINATION_IN);
    432             case CompositeDestinationOut:
    433                 return new CSSPrimitiveValue(CSS_VAL_DESTINATION_OUT);
    434             case CompositeDestinationAtop:
    435                 return new CSSPrimitiveValue(CSS_VAL_DESTINATION_ATOP);
    436             case CompositeXOR:
    437                 return new CSSPrimitiveValue(CSS_VAL_XOR);
    438             case CompositePlusDarker:
    439                 return new CSSPrimitiveValue(CSS_VAL_PLUS_DARKER);
    440             case CompositeHighlight:
    441                 return new CSSPrimitiveValue(CSS_VAL_HIGHLIGHT);
    442             case CompositePlusLighter:
    443                 return new CSSPrimitiveValue(CSS_VAL_PLUS_LIGHTER);
     407        case CSS_PROP_BACKGROUND_REPEAT:
     408            switch (style->backgroundRepeat()) {
     409                case REPEAT:
     410                    return new CSSPrimitiveValue(CSS_VAL_REPEAT);
     411                case REPEAT_X:
     412                    return new CSSPrimitiveValue(CSS_VAL_REPEAT_X);
     413                case REPEAT_Y:
     414                    return new CSSPrimitiveValue(CSS_VAL_REPEAT_Y);
     415                case NO_REPEAT:
     416                    return new CSSPrimitiveValue(CSS_VAL_NO_REPEAT);
     417            }
     418            ASSERT_NOT_REACHED();
     419            return 0;
     420        case CSS_PROP__WEBKIT_BACKGROUND_COMPOSITE:
     421            switch (style->backgroundComposite()) {
     422                case CompositeClear:
     423                    return new CSSPrimitiveValue(CSS_VAL_CLEAR);
     424                case CompositeCopy:
     425                    return new CSSPrimitiveValue(CSS_VAL_COPY);
     426                case CompositeSourceOver:
     427                    return new CSSPrimitiveValue(CSS_VAL_SOURCE_OVER);
     428                case CompositeSourceIn:
     429                    return new CSSPrimitiveValue(CSS_VAL_SOURCE_IN);
     430                case CompositeSourceOut:
     431                    return new CSSPrimitiveValue(CSS_VAL_SOURCE_OUT);
     432                case CompositeSourceAtop:
     433                    return new CSSPrimitiveValue(CSS_VAL_SOURCE_ATOP);
     434                case CompositeDestinationOver:
     435                    return new CSSPrimitiveValue(CSS_VAL_DESTINATION_OVER);
     436                case CompositeDestinationIn:
     437                    return new CSSPrimitiveValue(CSS_VAL_DESTINATION_IN);
     438                case CompositeDestinationOut:
     439                    return new CSSPrimitiveValue(CSS_VAL_DESTINATION_OUT);
     440                case CompositeDestinationAtop:
     441                    return new CSSPrimitiveValue(CSS_VAL_DESTINATION_ATOP);
     442                case CompositeXOR:
     443                    return new CSSPrimitiveValue(CSS_VAL_XOR);
     444                case CompositePlusDarker:
     445                    return new CSSPrimitiveValue(CSS_VAL_PLUS_DARKER);
     446                case CompositeHighlight:
     447                    return new CSSPrimitiveValue(CSS_VAL_HIGHLIGHT);
     448                case CompositePlusLighter:
     449                    return new CSSPrimitiveValue(CSS_VAL_PLUS_LIGHTER);
     450            }
     451            ASSERT_NOT_REACHED();
     452            return 0;
     453        case CSS_PROP_BACKGROUND_ATTACHMENT:
     454            if (style->backgroundAttachment())
     455                return new CSSPrimitiveValue(CSS_VAL_SCROLL);
     456            return new CSSPrimitiveValue(CSS_VAL_FIXED);
     457        case CSS_PROP__WEBKIT_BACKGROUND_CLIP:
     458        case CSS_PROP__WEBKIT_BACKGROUND_ORIGIN: {
     459            EBackgroundBox box = (propertyID == CSS_PROP__WEBKIT_BACKGROUND_CLIP ? style->backgroundClip() : style->backgroundOrigin());
     460            switch (box) {
     461                case BGBORDER:
     462                    return new CSSPrimitiveValue(CSS_VAL_BORDER);
     463                case BGPADDING:
     464                    return new CSSPrimitiveValue(CSS_VAL_PADDING);
     465                case BGCONTENT:
     466                    return new CSSPrimitiveValue(CSS_VAL_CONTENT);
     467            }
     468            ASSERT_NOT_REACHED();
     469            return 0;
    444470        }
    445         ASSERT_NOT_REACHED();
    446         return 0;
    447     case CSS_PROP_BACKGROUND_ATTACHMENT:
    448         if (style->backgroundAttachment())
    449             return new CSSPrimitiveValue(CSS_VAL_SCROLL);
    450         return new CSSPrimitiveValue(CSS_VAL_FIXED);
    451     case CSS_PROP__WEBKIT_BACKGROUND_CLIP:
    452     case CSS_PROP__WEBKIT_BACKGROUND_ORIGIN: {
    453         EBackgroundBox box = (propertyID == CSS_PROP__WEBKIT_BACKGROUND_CLIP ? style->backgroundClip() : style->backgroundOrigin());
    454         if (box == BGBORDER)
    455             return new CSSPrimitiveValue(CSS_VAL_BORDER);
    456         if (box == BGPADDING)
    457             return new CSSPrimitiveValue(CSS_VAL_PADDING);
    458         return new CSSPrimitiveValue(CSS_VAL_CONTENT);
    459     }
    460     case CSS_PROP_BACKGROUND_POSITION:
    461     {
    462         String string;
    463         Length length(style->backgroundXPosition());
    464         if (length.isPercent())
    465             string = numberAsString(length.percent()) + "%";
    466         else
    467             string = numberAsString(length.calcMinValue(renderer->contentWidth()));
    468         string += " ";
    469         length = style->backgroundYPosition();
    470         if (length.isPercent())
    471             string += numberAsString(length.percent()) + "%";
    472         else
    473             string += numberAsString(length.calcMinValue(renderer->contentWidth()));
    474         return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
    475     }
    476     case CSS_PROP_BACKGROUND_POSITION_X:
    477         return valueForLength(style->backgroundXPosition());
    478     case CSS_PROP_BACKGROUND_POSITION_Y:
    479         return valueForLength(style->backgroundYPosition());
     471        case CSS_PROP_BACKGROUND_POSITION: {
     472            String string;
     473            Length length(style->backgroundXPosition());
     474            if (length.isPercent())
     475                string = numberAsString(length.percent()) + "%";
     476            else
     477                string = numberAsString(length.calcMinValue(renderer->contentWidth()));
     478            string += " ";
     479            length = style->backgroundYPosition();
     480            if (length.isPercent())
     481                string += numberAsString(length.percent()) + "%";
     482            else
     483                string += numberAsString(length.calcMinValue(renderer->contentWidth()));
     484            return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
     485        }
     486        case CSS_PROP_BACKGROUND_POSITION_X:
     487            return valueForLength(style->backgroundXPosition());
     488        case CSS_PROP_BACKGROUND_POSITION_Y:
     489            return valueForLength(style->backgroundYPosition());
    480490#ifdef XBL_SUPPORT
    481     case CSS_PROP__WEBKIT_BINDING:
    482         // FIXME: unimplemented
    483         break;
     491        case CSS_PROP__WEBKIT_BINDING:
     492            // FIXME: unimplemented
     493            break;
    484494#endif
    485     case CSS_PROP_BORDER_COLLAPSE:
    486         if (style->borderCollapse())
    487             return new CSSPrimitiveValue(CSS_VAL_COLLAPSE);
    488         else
     495        case CSS_PROP_BORDER_COLLAPSE:
     496            if (style->borderCollapse())
     497                return new CSSPrimitiveValue(CSS_VAL_COLLAPSE);
    489498            return new CSSPrimitiveValue(CSS_VAL_SEPARATE);
    490     case CSS_PROP_BORDER_SPACING:
    491     {
    492         String string(numberAsString(style->horizontalBorderSpacing()) + "px " + numberAsString(style->verticalBorderSpacing()) + "px");
    493         return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
    494     }
    495     case CSS_PROP__WEBKIT_BORDER_HORIZONTAL_SPACING:
    496         return new CSSPrimitiveValue(style->horizontalBorderSpacing(), CSSPrimitiveValue::CSS_PX);
    497     case CSS_PROP__WEBKIT_BORDER_VERTICAL_SPACING:
    498         return new CSSPrimitiveValue(style->verticalBorderSpacing(), CSSPrimitiveValue::CSS_PX);
    499     case CSS_PROP_BORDER_TOP_COLOR:
    500         return currentColorOrValidColor(style, style->borderTopColor());
    501     case CSS_PROP_BORDER_RIGHT_COLOR:
    502         return currentColorOrValidColor(style, style->borderRightColor());
    503     case CSS_PROP_BORDER_BOTTOM_COLOR:
    504         return currentColorOrValidColor(style, style->borderBottomColor());
    505     case CSS_PROP_BORDER_LEFT_COLOR:
    506         return currentColorOrValidColor(style, style->borderLeftColor());
    507     case CSS_PROP_BORDER_TOP_STYLE:
    508         return valueForBorderStyle(style->borderTopStyle());
    509     case CSS_PROP_BORDER_RIGHT_STYLE:
    510         return valueForBorderStyle(style->borderRightStyle());
    511     case CSS_PROP_BORDER_BOTTOM_STYLE:
    512         return valueForBorderStyle(style->borderBottomStyle());
    513     case CSS_PROP_BORDER_LEFT_STYLE:
    514         return valueForBorderStyle(style->borderLeftStyle());
    515     case CSS_PROP_BORDER_TOP_WIDTH:
    516         return new CSSPrimitiveValue(style->borderTopWidth(), CSSPrimitiveValue::CSS_PX);
    517     case CSS_PROP_BORDER_RIGHT_WIDTH:
    518         return new CSSPrimitiveValue(style->borderRightWidth(), CSSPrimitiveValue::CSS_PX);
    519     case CSS_PROP_BORDER_BOTTOM_WIDTH:
    520         return new CSSPrimitiveValue(style->borderBottomWidth(), CSSPrimitiveValue::CSS_PX);
    521     case CSS_PROP_BORDER_LEFT_WIDTH:
    522         return new CSSPrimitiveValue(style->borderLeftWidth(), CSSPrimitiveValue::CSS_PX);
    523     case CSS_PROP_BOTTOM:
    524         return getPositionOffsetValue(renderer, CSS_PROP_BOTTOM);
    525     case CSS_PROP__WEBKIT_BOX_ALIGN:
    526         switch (style->boxAlign()) {
    527             case BSTRETCH:
    528                 return new CSSPrimitiveValue(CSS_VAL_STRETCH);
    529             case BSTART:
    530                 return new CSSPrimitiveValue(CSS_VAL_START);
    531             case BCENTER:
    532                 return new CSSPrimitiveValue(CSS_VAL_CENTER);
    533             case BEND:
    534                 return new CSSPrimitiveValue(CSS_VAL_END);
    535             case BBASELINE:
    536                 return new CSSPrimitiveValue(CSS_VAL_BASELINE);
    537             case BJUSTIFY:
    538                 break; // not allowed
     499        case CSS_PROP_BORDER_SPACING: {
     500            String string(numberAsString(style->horizontalBorderSpacing()) + "px " + numberAsString(style->verticalBorderSpacing()) + "px");
     501            return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
    539502        }
    540         ASSERT_NOT_REACHED();
    541         return 0;
    542     case CSS_PROP__WEBKIT_BOX_DIRECTION:
    543         switch (style->boxDirection()) {
    544             case BNORMAL:
     503        case CSS_PROP__WEBKIT_BORDER_HORIZONTAL_SPACING:
     504            return new CSSPrimitiveValue(style->horizontalBorderSpacing(), CSSPrimitiveValue::CSS_PX);
     505        case CSS_PROP__WEBKIT_BORDER_VERTICAL_SPACING:
     506            return new CSSPrimitiveValue(style->verticalBorderSpacing(), CSSPrimitiveValue::CSS_PX);
     507        case CSS_PROP_BORDER_TOP_COLOR:
     508            return currentColorOrValidColor(style, style->borderTopColor());
     509        case CSS_PROP_BORDER_RIGHT_COLOR:
     510            return currentColorOrValidColor(style, style->borderRightColor());
     511        case CSS_PROP_BORDER_BOTTOM_COLOR:
     512            return currentColorOrValidColor(style, style->borderBottomColor());
     513        case CSS_PROP_BORDER_LEFT_COLOR:
     514            return currentColorOrValidColor(style, style->borderLeftColor());
     515        case CSS_PROP_BORDER_TOP_STYLE:
     516            return valueForBorderStyle(style->borderTopStyle());
     517        case CSS_PROP_BORDER_RIGHT_STYLE:
     518            return valueForBorderStyle(style->borderRightStyle());
     519        case CSS_PROP_BORDER_BOTTOM_STYLE:
     520            return valueForBorderStyle(style->borderBottomStyle());
     521        case CSS_PROP_BORDER_LEFT_STYLE:
     522            return valueForBorderStyle(style->borderLeftStyle());
     523        case CSS_PROP_BORDER_TOP_WIDTH:
     524            return new CSSPrimitiveValue(style->borderTopWidth(), CSSPrimitiveValue::CSS_PX);
     525        case CSS_PROP_BORDER_RIGHT_WIDTH:
     526            return new CSSPrimitiveValue(style->borderRightWidth(), CSSPrimitiveValue::CSS_PX);
     527        case CSS_PROP_BORDER_BOTTOM_WIDTH:
     528            return new CSSPrimitiveValue(style->borderBottomWidth(), CSSPrimitiveValue::CSS_PX);
     529        case CSS_PROP_BORDER_LEFT_WIDTH:
     530            return new CSSPrimitiveValue(style->borderLeftWidth(), CSSPrimitiveValue::CSS_PX);
     531        case CSS_PROP_BOTTOM:
     532            return getPositionOffsetValue(renderer, CSS_PROP_BOTTOM);
     533        case CSS_PROP__WEBKIT_BOX_ALIGN:
     534            switch (style->boxAlign()) {
     535                case BSTRETCH:
     536                    return new CSSPrimitiveValue(CSS_VAL_STRETCH);
     537                case BSTART:
     538                    return new CSSPrimitiveValue(CSS_VAL_START);
     539                case BCENTER:
     540                    return new CSSPrimitiveValue(CSS_VAL_CENTER);
     541                case BEND:
     542                    return new CSSPrimitiveValue(CSS_VAL_END);
     543                case BBASELINE:
     544                    return new CSSPrimitiveValue(CSS_VAL_BASELINE);
     545                case BJUSTIFY:
     546                    break; // not allowed
     547            }
     548            ASSERT_NOT_REACHED();
     549            return 0;
     550        case CSS_PROP__WEBKIT_BOX_DIRECTION:
     551            switch (style->boxDirection()) {
     552                case BNORMAL:
     553                    return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     554                case BREVERSE:
     555                    return new CSSPrimitiveValue(CSS_VAL_REVERSE);
     556            }
     557            ASSERT_NOT_REACHED();
     558            return 0;
     559        case CSS_PROP__WEBKIT_BOX_FLEX:
     560            return new CSSPrimitiveValue(style->boxFlex(), CSSPrimitiveValue::CSS_NUMBER);
     561        case CSS_PROP__WEBKIT_BOX_FLEX_GROUP:
     562            return new CSSPrimitiveValue(style->boxFlexGroup(), CSSPrimitiveValue::CSS_NUMBER);
     563        case CSS_PROP__WEBKIT_BOX_LINES:
     564            switch (style->boxLines()) {
     565                case SINGLE:
     566                    return new CSSPrimitiveValue(CSS_VAL_SINGLE);
     567                case MULTIPLE:
     568                    return new CSSPrimitiveValue(CSS_VAL_MULTIPLE);
     569            }
     570            ASSERT_NOT_REACHED();
     571            return 0;
     572        case CSS_PROP__WEBKIT_BOX_ORDINAL_GROUP:
     573            return new CSSPrimitiveValue(style->boxOrdinalGroup(), CSSPrimitiveValue::CSS_NUMBER);
     574        case CSS_PROP__WEBKIT_BOX_ORIENT:
     575            switch (style->boxOrient()) {
     576                case HORIZONTAL:
     577                    return new CSSPrimitiveValue(CSS_VAL_HORIZONTAL);
     578                case VERTICAL:
     579                    return new CSSPrimitiveValue(CSS_VAL_VERTICAL);
     580            }
     581            ASSERT_NOT_REACHED();
     582            return 0;
     583        case CSS_PROP__WEBKIT_BOX_PACK:
     584            switch (style->boxPack()) {
     585                case BSTART:
     586                    return new CSSPrimitiveValue(CSS_VAL_START);
     587                case BEND:
     588                    return new CSSPrimitiveValue(CSS_VAL_END);
     589                case BCENTER:
     590                    return new CSSPrimitiveValue(CSS_VAL_CENTER);
     591                case BJUSTIFY:
     592                    return new CSSPrimitiveValue(CSS_VAL_JUSTIFY);
     593                case BSTRETCH:
     594                case BBASELINE:
     595                    break; // not allowed
     596            }
     597            ASSERT_NOT_REACHED();
     598            return 0;
     599        case CSS_PROP__WEBKIT_BOX_SHADOW:
     600            return valueForShadow(style->boxShadow());
     601        case CSS_PROP_CAPTION_SIDE:
     602            switch (style->captionSide()) {
     603                case CAPLEFT:
     604                    return new CSSPrimitiveValue(CSS_VAL_LEFT);
     605                case CAPRIGHT:
     606                    return new CSSPrimitiveValue(CSS_VAL_RIGHT);
     607                case CAPTOP:
     608                    return new CSSPrimitiveValue(CSS_VAL_TOP);
     609                case CAPBOTTOM:
     610                    return new CSSPrimitiveValue(CSS_VAL_BOTTOM);
     611            }
     612            ASSERT_NOT_REACHED();
     613            return 0;
     614        case CSS_PROP_CLEAR:
     615            switch (style->clear()) {
     616                case CNONE:
     617                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     618                case CLEFT:
     619                    return new CSSPrimitiveValue(CSS_VAL_LEFT);
     620                case CRIGHT:
     621                    return new CSSPrimitiveValue(CSS_VAL_RIGHT);
     622                case CBOTH:
     623                    return new CSSPrimitiveValue(CSS_VAL_BOTH);
     624            }
     625            ASSERT_NOT_REACHED();
     626            return 0;
     627        case CSS_PROP_CLIP:
     628            // FIXME: unimplemented
     629            break;
     630        case CSS_PROP_COLOR:
     631            return new CSSPrimitiveValue(style->color().rgb());
     632        case CSS_PROP__WEBKIT_COLUMN_COUNT:
     633            if (style->hasAutoColumnCount())
     634                return new CSSPrimitiveValue(CSS_VAL_AUTO);
     635            return new CSSPrimitiveValue(style->columnCount(), CSSPrimitiveValue::CSS_NUMBER);
     636        case CSS_PROP__WEBKIT_COLUMN_GAP:
     637            if (style->hasNormalColumnGap())
    545638                return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    546             case BREVERSE:
    547                 return new CSSPrimitiveValue(CSS_VAL_REVERSE);
     639            return new CSSPrimitiveValue(style->columnGap(), CSSPrimitiveValue::CSS_NUMBER);
     640        case CSS_PROP__WEBKIT_COLUMN_RULE_COLOR:
     641            return currentColorOrValidColor(style, style->columnRuleColor());
     642        case CSS_PROP__WEBKIT_COLUMN_RULE_STYLE:
     643            return valueForBorderStyle(style->columnRuleStyle());
     644        case CSS_PROP__WEBKIT_COLUMN_RULE_WIDTH:
     645            return new CSSPrimitiveValue(style->columnRuleWidth(), CSSPrimitiveValue::CSS_PX);
     646        case CSS_PROP__WEBKIT_COLUMN_BREAK_AFTER:
     647            switch (style->columnBreakAfter()) {
     648                case PBAUTO:
     649                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     650                case PBALWAYS:
     651                    return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
     652                case PBAVOID:
     653                    return new CSSPrimitiveValue(CSS_VAL_AVOID);
     654            }
     655            ASSERT_NOT_REACHED();
     656            return 0;
     657        case CSS_PROP__WEBKIT_COLUMN_BREAK_BEFORE:
     658            switch (style->columnBreakBefore()) {
     659                case PBAUTO:
     660                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     661                case PBALWAYS:
     662                    return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
     663                case PBAVOID:
     664                    return new CSSPrimitiveValue(CSS_VAL_AVOID);
     665            }
     666            ASSERT_NOT_REACHED();
     667            return 0;
     668        case CSS_PROP__WEBKIT_COLUMN_BREAK_INSIDE:
     669            switch (style->columnBreakInside()) {
     670                case PBAUTO:
     671                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     672                case PBAVOID:
     673                    return new CSSPrimitiveValue(CSS_VAL_AVOID);
     674                case PBALWAYS:
     675                    break; // not allowed
     676            }
     677            ASSERT_NOT_REACHED();
     678            return 0;
     679        case CSS_PROP__WEBKIT_COLUMN_WIDTH:
     680            if (style->hasAutoColumnWidth())
     681                return new CSSPrimitiveValue(CSS_VAL_AUTO);
     682            return new CSSPrimitiveValue(style->columnWidth(), CSSPrimitiveValue::CSS_NUMBER);
     683        case CSS_PROP_CONTENT:
     684            // FIXME: unimplemented
     685            break;
     686        case CSS_PROP_COUNTER_INCREMENT:
     687            // FIXME: unimplemented
     688            // Specification says "as specified", which means we'd need to keep a copy of the original CSS list around.
     689            break;
     690        case CSS_PROP_COUNTER_RESET:
     691            // FIXME: unimplemented
     692            // Specification says "as specified", which means we'd need to keep a copy of the original CSS list around.
     693            break;
     694        case CSS_PROP_CURSOR: {
     695            CSSValueList* list = 0;
     696            CursorList* cursors = style->cursors();
     697            if (cursors && cursors->size() > 0) {
     698                list = new CSSValueList;
     699                for (unsigned i = 0; i < cursors->size(); ++i)
     700                    list->append(new CSSPrimitiveValue((*cursors)[i].cursorImage->url(), CSSPrimitiveValue::CSS_URI));
     701            }
     702            CSSValue* value = 0;
     703            switch (style->cursor()) {
     704                case CURSOR_AUTO:
     705                    value = new CSSPrimitiveValue(CSS_VAL_AUTO);
     706                    break;
     707                case CURSOR_CROSS:
     708                    value = new CSSPrimitiveValue(CSS_VAL_CROSSHAIR);
     709                    break;
     710                case CURSOR_DEFAULT:
     711                    value = new CSSPrimitiveValue(CSS_VAL_DEFAULT);
     712                    break;
     713                case CURSOR_POINTER:
     714                    value = new CSSPrimitiveValue(CSS_VAL_POINTER);
     715                    break;
     716                case CURSOR_MOVE:
     717                    value = new CSSPrimitiveValue(CSS_VAL_MOVE);
     718                    break;
     719                case CURSOR_CELL:
     720                    value = new CSSPrimitiveValue(CSS_VAL_CELL);
     721                    break;
     722                case CURSOR_VERTICAL_TEXT:
     723                    value = new CSSPrimitiveValue(CSS_VAL_VERTICAL_TEXT);
     724                    break;
     725                case CURSOR_CONTEXT_MENU:
     726                    value = new CSSPrimitiveValue(CSS_VAL_CONTEXT_MENU);
     727                    break;
     728                case CURSOR_ALIAS:
     729                    value = new CSSPrimitiveValue(CSS_VAL_ALIAS);
     730                    break;
     731                case CURSOR_COPY:
     732                    value = new CSSPrimitiveValue(CSS_VAL_COPY);
     733                    break;
     734                case CURSOR_NONE:
     735                    value = new CSSPrimitiveValue(CSS_VAL_NONE);
     736                    break;
     737                case CURSOR_PROGRESS:
     738                    value = new CSSPrimitiveValue(CSS_VAL_PROGRESS);
     739                    break;
     740                case CURSOR_NO_DROP:
     741                    value = new CSSPrimitiveValue(CSS_VAL_NO_DROP);
     742                    break;
     743                case CURSOR_NOT_ALLOWED:
     744                    value = new CSSPrimitiveValue(CSS_VAL_NOT_ALLOWED);
     745                    break;
     746                case CURSOR_E_RESIZE:
     747                    value = new CSSPrimitiveValue(CSS_VAL_E_RESIZE);
     748                    break;
     749                case CURSOR_NE_RESIZE:
     750                    value = new CSSPrimitiveValue(CSS_VAL_NE_RESIZE);
     751                    break;
     752                case CURSOR_NW_RESIZE:
     753                    value = new CSSPrimitiveValue(CSS_VAL_NW_RESIZE);
     754                    break;
     755                case CURSOR_N_RESIZE:
     756                    value = new CSSPrimitiveValue(CSS_VAL_N_RESIZE);
     757                    break;
     758                case CURSOR_SE_RESIZE:
     759                    value = new CSSPrimitiveValue(CSS_VAL_SE_RESIZE);
     760                    break;
     761                case CURSOR_SW_RESIZE:
     762                    value = new CSSPrimitiveValue(CSS_VAL_SW_RESIZE);
     763                    break;
     764                case CURSOR_S_RESIZE:
     765                    value = new CSSPrimitiveValue(CSS_VAL_S_RESIZE);
     766                    break;
     767                case CURSOR_W_RESIZE:
     768                    value = new CSSPrimitiveValue(CSS_VAL_W_RESIZE);
     769                    break;
     770                case CURSOR_EW_RESIZE:
     771                    value = new CSSPrimitiveValue(CSS_VAL_EW_RESIZE);
     772                    break;
     773                case CURSOR_NS_RESIZE:
     774                    value = new CSSPrimitiveValue(CSS_VAL_NS_RESIZE);
     775                    break;
     776                case CURSOR_NESW_RESIZE:
     777                    value = new CSSPrimitiveValue(CSS_VAL_NESW_RESIZE);
     778                    break;
     779                case CURSOR_NWSE_RESIZE:
     780                    value = new CSSPrimitiveValue(CSS_VAL_NWSE_RESIZE);
     781                    break;
     782                case CURSOR_COL_RESIZE:
     783                    value = new CSSPrimitiveValue(CSS_VAL_COL_RESIZE);
     784                    break;
     785                case CURSOR_ROW_RESIZE:
     786                    value = new CSSPrimitiveValue(CSS_VAL_ROW_RESIZE);
     787                    break;
     788                case CURSOR_TEXT:
     789                    value = new CSSPrimitiveValue(CSS_VAL_TEXT);
     790                    break;
     791                case CURSOR_WAIT:
     792                    value = new CSSPrimitiveValue(CSS_VAL_WAIT);
     793                    break;
     794                case CURSOR_HELP:
     795                    value = new CSSPrimitiveValue(CSS_VAL_HELP);
     796                    break;
     797                case CURSOR_ALL_SCROLL:
     798                    value = new CSSPrimitiveValue(CSS_VAL_ALL_SCROLL);
     799                    break;
     800            }
     801            ASSERT(value);
     802            if (list) {
     803                list->append(value);
     804                return list;
     805            }
     806            return value;
    548807        }
    549         ASSERT_NOT_REACHED();
    550         return 0;
    551     case CSS_PROP__WEBKIT_BOX_FLEX:
    552         return new CSSPrimitiveValue(style->boxFlex(), CSSPrimitiveValue::CSS_NUMBER);
    553     case CSS_PROP__WEBKIT_BOX_FLEX_GROUP:
    554         return new CSSPrimitiveValue(style->boxFlexGroup(), CSSPrimitiveValue::CSS_NUMBER);
    555     case CSS_PROP__WEBKIT_BOX_LINES:
    556         switch (style->boxLines()) {
    557             case SINGLE:
    558                 return new CSSPrimitiveValue(CSS_VAL_SINGLE);
    559             case MULTIPLE:
    560                 return new CSSPrimitiveValue(CSS_VAL_MULTIPLE);
    561         }
    562         ASSERT_NOT_REACHED();
    563         return 0;
    564     case CSS_PROP__WEBKIT_BOX_ORDINAL_GROUP:
    565         return new CSSPrimitiveValue(style->boxOrdinalGroup(), CSSPrimitiveValue::CSS_NUMBER);
    566     case CSS_PROP__WEBKIT_BOX_ORIENT:
    567         switch (style->boxOrient()) {
    568             case HORIZONTAL:
    569                 return new CSSPrimitiveValue(CSS_VAL_HORIZONTAL);
    570             case VERTICAL:
    571                 return new CSSPrimitiveValue(CSS_VAL_VERTICAL);
    572         }
    573         ASSERT_NOT_REACHED();
    574         return 0;
    575     case CSS_PROP__WEBKIT_BOX_PACK:
    576         switch (style->boxPack()) {
    577             case BSTART:
    578                 return new CSSPrimitiveValue(CSS_VAL_START);
    579             case BEND:
    580                 return new CSSPrimitiveValue(CSS_VAL_END);
    581             case BCENTER:
    582                 return new CSSPrimitiveValue(CSS_VAL_CENTER);
    583             case BJUSTIFY:
    584                 return new CSSPrimitiveValue(CSS_VAL_JUSTIFY);
    585             case BSTRETCH:
    586             case BBASELINE:
    587                 break; // not allowed
    588         }
    589         ASSERT_NOT_REACHED();
    590         return 0;
    591     case CSS_PROP__WEBKIT_BOX_SHADOW:
    592         return valueForShadow(style->boxShadow());
    593     case CSS_PROP_CAPTION_SIDE:
    594         switch (style->captionSide()) {
    595             case CAPLEFT:
    596                 return new CSSPrimitiveValue(CSS_VAL_LEFT);
    597             case CAPRIGHT:
    598                 return new CSSPrimitiveValue(CSS_VAL_RIGHT);
    599             case CAPTOP:
    600                 return new CSSPrimitiveValue(CSS_VAL_TOP);
    601             case CAPBOTTOM:
    602                 return new CSSPrimitiveValue(CSS_VAL_BOTTOM);
    603         }
    604         ASSERT_NOT_REACHED();
    605         return 0;
    606     case CSS_PROP_CLEAR:
    607         switch (style->clear()) {
    608             case CNONE:
     808        case CSS_PROP_DIRECTION:
     809            switch (style->direction()) {
     810                case LTR:
     811                    return new CSSPrimitiveValue(CSS_VAL_LTR);
     812                case RTL:
     813                    return new CSSPrimitiveValue(CSS_VAL_RTL);
     814            }
     815            ASSERT_NOT_REACHED();
     816            return 0;
     817        case CSS_PROP_DISPLAY:
     818            switch (style->display()) {
     819                case INLINE:
     820                    return new CSSPrimitiveValue(CSS_VAL_INLINE);
     821                case BLOCK:
     822                    return new CSSPrimitiveValue(CSS_VAL_BLOCK);
     823                case LIST_ITEM:
     824                    return new CSSPrimitiveValue(CSS_VAL_LIST_ITEM);
     825                case RUN_IN:
     826                    return new CSSPrimitiveValue(CSS_VAL_RUN_IN);
     827                case COMPACT:
     828                    return new CSSPrimitiveValue(CSS_VAL_COMPACT);
     829                case INLINE_BLOCK:
     830                    return new CSSPrimitiveValue(CSS_VAL_INLINE_BLOCK);
     831                case TABLE:
     832                    return new CSSPrimitiveValue(CSS_VAL_TABLE);
     833                case INLINE_TABLE:
     834                    return new CSSPrimitiveValue(CSS_VAL_INLINE_TABLE);
     835                case TABLE_ROW_GROUP:
     836                    return new CSSPrimitiveValue(CSS_VAL_TABLE_ROW_GROUP);
     837                case TABLE_HEADER_GROUP:
     838                    return new CSSPrimitiveValue(CSS_VAL_TABLE_HEADER_GROUP);
     839                case TABLE_FOOTER_GROUP:
     840                    return new CSSPrimitiveValue(CSS_VAL_TABLE_FOOTER_GROUP);
     841                case TABLE_ROW:
     842                    return new CSSPrimitiveValue(CSS_VAL_TABLE_ROW);
     843                case TABLE_COLUMN_GROUP:
     844                    return new CSSPrimitiveValue(CSS_VAL_TABLE_COLUMN_GROUP);
     845                case TABLE_COLUMN:
     846                    return new CSSPrimitiveValue(CSS_VAL_TABLE_COLUMN);
     847                case TABLE_CELL:
     848                    return new CSSPrimitiveValue(CSS_VAL_TABLE_CELL);
     849                case TABLE_CAPTION:
     850                    return new CSSPrimitiveValue(CSS_VAL_TABLE_CAPTION);
     851                case BOX:
     852                    return new CSSPrimitiveValue(CSS_VAL__WEBKIT_BOX);
     853                case INLINE_BOX:
     854                    return new CSSPrimitiveValue(CSS_VAL__WEBKIT_INLINE_BOX);
     855                case NONE:
     856                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     857            }
     858            ASSERT_NOT_REACHED();
     859            return 0;
     860        case CSS_PROP_EMPTY_CELLS:
     861            switch (style->emptyCells()) {
     862                case SHOW:
     863                    return new CSSPrimitiveValue(CSS_VAL_SHOW);
     864                case HIDE:
     865                    return new CSSPrimitiveValue(CSS_VAL_HIDE);
     866            }
     867            ASSERT_NOT_REACHED();
     868            return 0;
     869        case CSS_PROP_FLOAT:
     870            switch (style->floating()) {
     871                case FNONE:
     872                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     873                case FLEFT:
     874                    return new CSSPrimitiveValue(CSS_VAL_LEFT);
     875                case FRIGHT:
     876                    return new CSSPrimitiveValue(CSS_VAL_RIGHT);
     877            }
     878            ASSERT_NOT_REACHED();
     879            return 0;
     880        case CSS_PROP_FONT_FAMILY:
     881            // FIXME: This only returns the first family.
     882            return new CSSPrimitiveValue(style->fontDescription().family().family().domString(), CSSPrimitiveValue::CSS_STRING);
     883        case CSS_PROP_FONT_SIZE:
     884            return new CSSPrimitiveValue(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX);
     885        case CSS_PROP_FONT_STRETCH:
     886            // FIXME: unimplemented
     887            break;
     888        case CSS_PROP_FONT_STYLE:
     889            if (style->fontDescription().italic())
     890                return new CSSPrimitiveValue(CSS_VAL_ITALIC);
     891            return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     892        case CSS_PROP_FONT_VARIANT:
     893            if (style->fontDescription().smallCaps())
     894                return new CSSPrimitiveValue(CSS_VAL_SMALL_CAPS);
     895            return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     896        case CSS_PROP_FONT_WEIGHT:
     897            // FIXME: this does not reflect the full range of weights
     898            // that can be expressed with CSS
     899            if (style->fontDescription().weight() == cBoldWeight)
     900                return new CSSPrimitiveValue(CSS_VAL_BOLD);
     901            return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     902        case CSS_PROP_HEIGHT:
     903            return new CSSPrimitiveValue(renderer->contentHeight(), CSSPrimitiveValue::CSS_PX);
     904        case CSS_PROP__WEBKIT_HIGHLIGHT:
     905            if (style->highlight() == nullAtom)
    609906                return new CSSPrimitiveValue(CSS_VAL_NONE);
    610             case CLEFT:
    611                 return new CSSPrimitiveValue(CSS_VAL_LEFT);
    612             case CRIGHT:
    613                 return new CSSPrimitiveValue(CSS_VAL_RIGHT);
    614             case CBOTH:
    615                 return new CSSPrimitiveValue(CSS_VAL_BOTH);
    616         }
    617         ASSERT_NOT_REACHED();
    618         return 0;
    619     case CSS_PROP_CLIP:
    620         // FIXME: unimplemented
    621         break;
    622     case CSS_PROP_COLOR:
    623         return new CSSPrimitiveValue(style->color().rgb());
    624     case CSS_PROP__WEBKIT_COLUMN_COUNT:
    625         if (style->hasAutoColumnCount())
    626             return new CSSPrimitiveValue(CSS_VAL_AUTO);
    627         return new CSSPrimitiveValue(style->columnCount(), CSSPrimitiveValue::CSS_NUMBER);
    628     case CSS_PROP__WEBKIT_COLUMN_GAP:
    629         if (style->hasNormalColumnGap())
    630             return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    631         return new CSSPrimitiveValue(style->columnGap(), CSSPrimitiveValue::CSS_NUMBER);
    632     case CSS_PROP__WEBKIT_COLUMN_RULE_COLOR:
    633         return currentColorOrValidColor(style, style->columnRuleColor());
    634     case CSS_PROP__WEBKIT_COLUMN_RULE_STYLE:
    635         return valueForBorderStyle(style->columnRuleStyle());
    636     case CSS_PROP__WEBKIT_COLUMN_RULE_WIDTH:
    637         return new CSSPrimitiveValue(style->columnRuleWidth(), CSSPrimitiveValue::CSS_PX);
    638     case CSS_PROP__WEBKIT_COLUMN_BREAK_AFTER:
    639         switch (style->columnBreakAfter()) {
    640             case PBAUTO:
    641                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    642             case PBALWAYS:
    643                 return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
    644             case PBAVOID:
    645                 return new CSSPrimitiveValue(CSS_VAL_AVOID);
    646         }
    647         ASSERT_NOT_REACHED();
    648         return 0;
    649     case CSS_PROP__WEBKIT_COLUMN_BREAK_BEFORE:
    650         switch (style->columnBreakBefore()) {
    651             case PBAUTO:
    652                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    653             case PBALWAYS:
    654                 return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
    655             case PBAVOID:
    656                 return new CSSPrimitiveValue(CSS_VAL_AVOID);
    657         }
    658         ASSERT_NOT_REACHED();
    659         return 0;
    660     case CSS_PROP__WEBKIT_COLUMN_BREAK_INSIDE:
    661         switch (style->columnBreakInside()) {
    662             case PBAUTO:
    663                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    664             case PBAVOID:
    665                 return new CSSPrimitiveValue(CSS_VAL_AVOID);
    666             case PBALWAYS:
    667                 break; // not allowed
    668         }
    669         ASSERT_NOT_REACHED();
    670         return 0;
    671     case CSS_PROP__WEBKIT_COLUMN_WIDTH:
    672         if (style->hasAutoColumnWidth())
    673             return new CSSPrimitiveValue(CSS_VAL_AUTO);
    674         return new CSSPrimitiveValue(style->columnWidth(), CSSPrimitiveValue::CSS_NUMBER);
    675     case CSS_PROP_CONTENT:
    676         // FIXME: unimplemented
    677         break;
    678     case CSS_PROP_COUNTER_INCREMENT:
    679         // FIXME: unimplemented
    680         // Specification says "as specified", which means we'd need to keep a copy of the original CSS list around.
    681         break;
    682     case CSS_PROP_COUNTER_RESET:
    683         // FIXME: unimplemented
    684         // Specification says "as specified", which means we'd need to keep a copy of the original CSS list around.
    685         break;
    686     case CSS_PROP_CURSOR: {
    687         CSSValueList* list = 0;
    688         CSSValue* value = 0;
    689         CursorList* cursors = style->cursors();
    690         if (cursors && cursors->size() > 0) {
    691             list = new CSSValueList;
    692             for (unsigned i = 0; i < cursors->size(); ++i)
    693                 list->append(new CSSPrimitiveValue((*cursors)[i].cursorImage->url(), CSSPrimitiveValue::CSS_URI));
    694         }
    695         switch (style->cursor()) {
    696             case CURSOR_AUTO:
    697                 value = new CSSPrimitiveValue(CSS_VAL_AUTO);
    698                 break;
    699             case CURSOR_CROSS:
    700                 value = new CSSPrimitiveValue(CSS_VAL_CROSSHAIR);
    701                 break;
    702             case CURSOR_DEFAULT:
    703                 value = new CSSPrimitiveValue(CSS_VAL_DEFAULT);
    704                 break;
    705             case CURSOR_POINTER:
    706                 value = new CSSPrimitiveValue(CSS_VAL_POINTER);
    707                 break;
    708             case CURSOR_MOVE:
    709                 value = new CSSPrimitiveValue(CSS_VAL_MOVE);
    710                 break;
    711             case CURSOR_CELL:
    712                 value = new CSSPrimitiveValue(CSS_VAL_CELL);
    713                 break;
    714             case CURSOR_VERTICAL_TEXT:
    715                 value = new CSSPrimitiveValue(CSS_VAL_VERTICAL_TEXT);
    716                 break;
    717             case CURSOR_CONTEXT_MENU:
    718                 value = new CSSPrimitiveValue(CSS_VAL_CONTEXT_MENU);
    719                 break;
    720             case CURSOR_ALIAS:
    721                 value = new CSSPrimitiveValue(CSS_VAL_ALIAS);
    722                 break;
    723             case CURSOR_COPY:
    724                 value = new CSSPrimitiveValue(CSS_VAL_COPY);
    725                 break;
    726             case CURSOR_NONE:
    727                 value = new CSSPrimitiveValue(CSS_VAL_NONE);
    728                 break;
    729             case CURSOR_PROGRESS:
    730                 value = new CSSPrimitiveValue(CSS_VAL_PROGRESS);
    731                 break;
    732             case CURSOR_NO_DROP:
    733                 value = new CSSPrimitiveValue(CSS_VAL_NO_DROP);
    734                 break;
    735             case CURSOR_NOT_ALLOWED:
    736                 value = new CSSPrimitiveValue(CSS_VAL_NOT_ALLOWED);
    737                 break;
    738             case CURSOR_E_RESIZE:
    739                 value = new CSSPrimitiveValue(CSS_VAL_E_RESIZE);
    740                 break;
    741             case CURSOR_NE_RESIZE:
    742                 value = new CSSPrimitiveValue(CSS_VAL_NE_RESIZE);
    743                 break;
    744             case CURSOR_NW_RESIZE:
    745                 value = new CSSPrimitiveValue(CSS_VAL_NW_RESIZE);
    746                 break;
    747             case CURSOR_N_RESIZE:
    748                 value = new CSSPrimitiveValue(CSS_VAL_N_RESIZE);
    749                 break;
    750             case CURSOR_SE_RESIZE:
    751                 value = new CSSPrimitiveValue(CSS_VAL_SE_RESIZE);
    752                 break;
    753             case CURSOR_SW_RESIZE:
    754                 value = new CSSPrimitiveValue(CSS_VAL_SW_RESIZE);
    755                 break;
    756             case CURSOR_S_RESIZE:
    757                 value = new CSSPrimitiveValue(CSS_VAL_S_RESIZE);
    758                 break;
    759             case CURSOR_W_RESIZE:
    760                 value = new CSSPrimitiveValue(CSS_VAL_W_RESIZE);
    761                 break;
    762             case CURSOR_EW_RESIZE:
    763                 value = new CSSPrimitiveValue(CSS_VAL_EW_RESIZE);
    764                 break;
    765             case CURSOR_NS_RESIZE:
    766                 value = new CSSPrimitiveValue(CSS_VAL_NS_RESIZE);
    767                 break;
    768             case CURSOR_NESW_RESIZE:
    769                 value = new CSSPrimitiveValue(CSS_VAL_NESW_RESIZE);
    770                 break;
    771             case CURSOR_NWSE_RESIZE:
    772                 value = new CSSPrimitiveValue(CSS_VAL_NWSE_RESIZE);
    773                 break;
    774             case CURSOR_COL_RESIZE:
    775                 value = new CSSPrimitiveValue(CSS_VAL_COL_RESIZE);
    776                 break;
    777             case CURSOR_ROW_RESIZE:
    778                 value = new CSSPrimitiveValue(CSS_VAL_ROW_RESIZE);
    779                 break;
    780             case CURSOR_TEXT:
    781                 value = new CSSPrimitiveValue(CSS_VAL_TEXT);
    782                 break;
    783             case CURSOR_WAIT:
    784                 value = new CSSPrimitiveValue(CSS_VAL_WAIT);
    785                 break;
    786             case CURSOR_HELP:
    787                 value = new CSSPrimitiveValue(CSS_VAL_HELP);
    788                 break;
    789             case CURSOR_ALL_SCROLL:
    790                 value = new CSSPrimitiveValue(CSS_VAL_ALL_SCROLL);
    791                 break;
    792         }
    793         ASSERT(value);
    794         if (list) {
    795             list->append(value);
    796             return list;
    797         }
    798         return value;
    799     }
    800     case CSS_PROP_DIRECTION:
    801         switch (style->direction()) {
    802             case LTR:
    803                 return new CSSPrimitiveValue(CSS_VAL_LTR);
    804             case RTL:
    805                 return new CSSPrimitiveValue(CSS_VAL_RTL);
    806         }
    807         ASSERT_NOT_REACHED();
    808         return 0;
    809     case CSS_PROP_DISPLAY:
    810         switch (style->display()) {
    811             case INLINE:
    812                 return new CSSPrimitiveValue(CSS_VAL_INLINE);
    813             case BLOCK:
    814                 return new CSSPrimitiveValue(CSS_VAL_BLOCK);
    815             case LIST_ITEM:
    816                 return new CSSPrimitiveValue(CSS_VAL_LIST_ITEM);
    817             case RUN_IN:
    818                 return new CSSPrimitiveValue(CSS_VAL_RUN_IN);
    819             case COMPACT:
    820                 return new CSSPrimitiveValue(CSS_VAL_COMPACT);
    821             case INLINE_BLOCK:
    822                 return new CSSPrimitiveValue(CSS_VAL_INLINE_BLOCK);
    823             case TABLE:
    824                 return new CSSPrimitiveValue(CSS_VAL_TABLE);
    825             case INLINE_TABLE:
    826                 return new CSSPrimitiveValue(CSS_VAL_INLINE_TABLE);
    827             case TABLE_ROW_GROUP:
    828                 return new CSSPrimitiveValue(CSS_VAL_TABLE_ROW_GROUP);
    829             case TABLE_HEADER_GROUP:
    830                 return new CSSPrimitiveValue(CSS_VAL_TABLE_HEADER_GROUP);
    831             case TABLE_FOOTER_GROUP:
    832                 return new CSSPrimitiveValue(CSS_VAL_TABLE_FOOTER_GROUP);
    833             case TABLE_ROW:
    834                 return new CSSPrimitiveValue(CSS_VAL_TABLE_ROW);
    835             case TABLE_COLUMN_GROUP:
    836                 return new CSSPrimitiveValue(CSS_VAL_TABLE_COLUMN_GROUP);
    837             case TABLE_COLUMN:
    838                 return new CSSPrimitiveValue(CSS_VAL_TABLE_COLUMN);
    839             case TABLE_CELL:
    840                 return new CSSPrimitiveValue(CSS_VAL_TABLE_CELL);
    841             case TABLE_CAPTION:
    842                 return new CSSPrimitiveValue(CSS_VAL_TABLE_CAPTION);
    843             case BOX:
    844                 return new CSSPrimitiveValue(CSS_VAL__WEBKIT_BOX);
    845             case INLINE_BOX:
    846                 return new CSSPrimitiveValue(CSS_VAL__WEBKIT_INLINE_BOX);
    847             case NONE:
     907            return new CSSPrimitiveValue(style->highlight(), CSSPrimitiveValue::CSS_STRING);
     908        case CSS_PROP_LEFT:
     909            return getPositionOffsetValue(renderer, CSS_PROP_LEFT);
     910        case CSS_PROP_LETTER_SPACING:
     911            if (!style->letterSpacing())
     912                return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     913            return new CSSPrimitiveValue(style->letterSpacing(), CSSPrimitiveValue::CSS_PX);
     914        case CSS_PROP__WEBKIT_LINE_CLAMP:
     915            if (style->lineClamp() == -1)
    848916                return new CSSPrimitiveValue(CSS_VAL_NONE);
    849         }
    850         ASSERT_NOT_REACHED();
    851         return 0;
    852     case CSS_PROP_EMPTY_CELLS:
    853         switch (style->emptyCells()) {
    854             case SHOW:
    855                 return new CSSPrimitiveValue(CSS_VAL_SHOW);
    856             case HIDE:
    857                 return new CSSPrimitiveValue(CSS_VAL_HIDE);
    858         }
    859         ASSERT_NOT_REACHED();
    860         return 0;
    861     case CSS_PROP_FLOAT:
    862         switch (style->floating()) {
    863             case FNONE:
    864                 return new CSSPrimitiveValue(CSS_VAL_NONE);
    865             case FLEFT:
    866                 return new CSSPrimitiveValue(CSS_VAL_LEFT);
    867             case FRIGHT:
    868                 return new CSSPrimitiveValue(CSS_VAL_RIGHT);
    869         }
    870         ASSERT_NOT_REACHED();
    871         return 0;
    872     case CSS_PROP_FONT_FAMILY:
    873     {
    874         // FIXME: This only returns the first family.
    875         const FontDescription& desc = style->fontDescription();
    876         return new CSSPrimitiveValue(desc.family().family().domString(), CSSPrimitiveValue::CSS_STRING);
    877     }
    878     case CSS_PROP_FONT_SIZE:
    879     {
    880         FontDescription desc = style->fontDescription();
    881         return new CSSPrimitiveValue(desc.computedPixelSize(), CSSPrimitiveValue::CSS_PX);
    882     }
    883     case CSS_PROP_FONT_STRETCH:
    884         // FIXME: unimplemented
    885         break;
    886     case CSS_PROP_FONT_STYLE:
    887     {
    888         // FIXME: handle oblique?
    889         const FontDescription& desc = style->fontDescription();
    890         if (desc.italic())
    891             return new CSSPrimitiveValue(CSS_VAL_ITALIC);
    892         else
    893             return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    894     }
    895     case CSS_PROP_FONT_VARIANT:
    896     {
    897         const FontDescription& desc = style->fontDescription();
    898         if (desc.smallCaps())
    899             return new CSSPrimitiveValue(CSS_VAL_SMALL_CAPS);
    900         else
    901             return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    902     }
    903     case CSS_PROP_FONT_WEIGHT:
    904     {
    905         // FIXME: this does not reflect the full range of weights
    906         // that can be expressed with CSS
    907         const FontDescription& desc = style->fontDescription();
    908         if (desc.weight() == cBoldWeight)
    909             return new CSSPrimitiveValue(CSS_VAL_BOLD);
    910         else
    911             return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    912     }
    913     case CSS_PROP_HEIGHT:
    914         return new CSSPrimitiveValue(renderer->contentHeight(), CSSPrimitiveValue::CSS_PX);
    915     case CSS_PROP__WEBKIT_HIGHLIGHT: {
    916         if (style->highlight() == nullAtom)
    917             return new CSSPrimitiveValue(CSS_VAL_NONE);
    918         else
    919             return new CSSPrimitiveValue(style->highlight(), CSSPrimitiveValue::CSS_STRING);
    920     }
    921     case CSS_PROP_LEFT:
    922         return getPositionOffsetValue(renderer, CSS_PROP_LEFT);
    923     case CSS_PROP_LETTER_SPACING:
    924         if (style->letterSpacing() == 0)
    925             return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    926         return new CSSPrimitiveValue(style->letterSpacing(), CSSPrimitiveValue::CSS_PX);
    927     case CSS_PROP__WEBKIT_LINE_CLAMP:
    928         if (style->lineClamp() == -1)
    929             return new CSSPrimitiveValue(CSS_VAL_NONE);
    930         return new CSSPrimitiveValue(style->lineClamp(), CSSPrimitiveValue::CSS_PERCENTAGE);
    931     case CSS_PROP_LINE_HEIGHT: {
    932         Length length(style->lineHeight());
    933         if (length.isNegative())
    934             return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    935         if (length.isPercent()) {
    936             // This is imperfect, because it doesn't include the zoom factor and the real computation
    937             // for how high to be in pixels does include things like minimum font size and the zoom factor.
    938             // On the other hand, since font-size doesn't include the zoom factor, we really can't do
    939             // that here either.
    940             float fontSize = style->fontDescription().specifiedSize();
    941             return new CSSPrimitiveValue((int)(length.percent() * fontSize) / 100, CSSPrimitiveValue::CSS_PX);
    942         }
    943         else {
     917            return new CSSPrimitiveValue(style->lineClamp(), CSSPrimitiveValue::CSS_PERCENTAGE);
     918        case CSS_PROP_LINE_HEIGHT: {
     919            Length length = style->lineHeight();
     920            if (length.isNegative())
     921                return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     922            if (length.isPercent())
     923                // This is imperfect, because it doesn't include the zoom factor and the real computation
     924                // for how high to be in pixels does include things like minimum font size and the zoom factor.
     925                // On the other hand, since font-size doesn't include the zoom factor, we really can't do
     926                // that here either.
     927                return new CSSPrimitiveValue(static_cast<int>(length.percent() * style->fontDescription().specifiedSize()) / 100, CSSPrimitiveValue::CSS_PX);
    944928            return new CSSPrimitiveValue(length.value(), CSSPrimitiveValue::CSS_PX);
    945929        }
    946     }
    947     case CSS_PROP_LIST_STYLE_IMAGE:
    948         if (style->listStyleImage())
    949             return new CSSPrimitiveValue(style->listStyleImage()->url(), CSSPrimitiveValue::CSS_URI);
    950         return new CSSPrimitiveValue(CSS_VAL_NONE);
    951     case CSS_PROP_LIST_STYLE_POSITION:
    952         switch (style->listStylePosition()) {
    953             case OUTSIDE:
    954                 return new CSSPrimitiveValue(CSS_VAL_OUTSIDE);
    955             case INSIDE:
    956                 return new CSSPrimitiveValue(CSS_VAL_INSIDE);
     930        case CSS_PROP_LIST_STYLE_IMAGE:
     931            if (style->listStyleImage())
     932                return new CSSPrimitiveValue(style->listStyleImage()->url(), CSSPrimitiveValue::CSS_URI);
     933            return new CSSPrimitiveValue(CSS_VAL_NONE);
     934        case CSS_PROP_LIST_STYLE_POSITION:
     935            switch (style->listStylePosition()) {
     936                case OUTSIDE:
     937                    return new CSSPrimitiveValue(CSS_VAL_OUTSIDE);
     938                case INSIDE:
     939                    return new CSSPrimitiveValue(CSS_VAL_INSIDE);
     940            }
     941            ASSERT_NOT_REACHED();
     942            return 0;
     943        case CSS_PROP_LIST_STYLE_TYPE:
     944            switch (style->listStyleType()) {
     945                case LNONE:
     946                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     947                case DISC:
     948                    return new CSSPrimitiveValue(CSS_VAL_DISC);
     949                case CIRCLE:
     950                    return new CSSPrimitiveValue(CSS_VAL_CIRCLE);
     951                case SQUARE:
     952                    return new CSSPrimitiveValue(CSS_VAL_SQUARE);
     953                case LDECIMAL:
     954                    return new CSSPrimitiveValue(CSS_VAL_DECIMAL);
     955                case DECIMAL_LEADING_ZERO:
     956                    return new CSSPrimitiveValue(CSS_VAL_DECIMAL_LEADING_ZERO);
     957                case LOWER_ROMAN:
     958                    return new CSSPrimitiveValue(CSS_VAL_LOWER_ROMAN);
     959                case UPPER_ROMAN:
     960                    return new CSSPrimitiveValue(CSS_VAL_UPPER_ROMAN);
     961                case LOWER_GREEK:
     962                    return new CSSPrimitiveValue(CSS_VAL_LOWER_GREEK);
     963                case LOWER_ALPHA:
     964                    return new CSSPrimitiveValue(CSS_VAL_LOWER_ALPHA);
     965                case LOWER_LATIN:
     966                    return new CSSPrimitiveValue(CSS_VAL_LOWER_LATIN);
     967                case UPPER_ALPHA:
     968                    return new CSSPrimitiveValue(CSS_VAL_UPPER_ALPHA);
     969                case UPPER_LATIN:
     970                    return new CSSPrimitiveValue(CSS_VAL_UPPER_LATIN);
     971                case HEBREW:
     972                    return new CSSPrimitiveValue(CSS_VAL_HEBREW);
     973                case ARMENIAN:
     974                    return new CSSPrimitiveValue(CSS_VAL_ARMENIAN);
     975                case GEORGIAN:
     976                    return new CSSPrimitiveValue(CSS_VAL_GEORGIAN);
     977                case CJK_IDEOGRAPHIC:
     978                    return new CSSPrimitiveValue(CSS_VAL_CJK_IDEOGRAPHIC);
     979                case HIRAGANA:
     980                    return new CSSPrimitiveValue(CSS_VAL_HIRAGANA);
     981                case KATAKANA:
     982                    return new CSSPrimitiveValue(CSS_VAL_KATAKANA);
     983                case HIRAGANA_IROHA:
     984                    return new CSSPrimitiveValue(CSS_VAL_HIRAGANA_IROHA);
     985                case KATAKANA_IROHA:
     986                    return new CSSPrimitiveValue(CSS_VAL_KATAKANA_IROHA);
     987            }
     988            ASSERT_NOT_REACHED();
     989            return 0;
     990        case CSS_PROP_MARGIN_TOP:
     991            // FIXME: Supposed to return the percentage if percentage was specified.
     992            return new CSSPrimitiveValue(renderer->marginTop(), CSSPrimitiveValue::CSS_PX);
     993        case CSS_PROP_MARGIN_RIGHT:
     994            // FIXME: Supposed to return the percentage if percentage was specified.
     995            return new CSSPrimitiveValue(renderer->marginRight(), CSSPrimitiveValue::CSS_PX);
     996        case CSS_PROP_MARGIN_BOTTOM:
     997            // FIXME: Supposed to return the percentage if percentage was specified.
     998            return new CSSPrimitiveValue(renderer->marginBottom(), CSSPrimitiveValue::CSS_PX);
     999        case CSS_PROP_MARGIN_LEFT:
     1000            // FIXME: Supposed to return the percentage if percentage was specified.
     1001            return new CSSPrimitiveValue(renderer->marginLeft(), CSSPrimitiveValue::CSS_PX);
     1002        case CSS_PROP__WEBKIT_MARQUEE:
     1003            // FIXME: unimplemented
     1004            break;
     1005        case CSS_PROP__WEBKIT_MARQUEE_DIRECTION:
     1006            switch (style->marqueeDirection()) {
     1007                case MFORWARD:
     1008                    return new CSSPrimitiveValue(CSS_VAL_FORWARDS);
     1009                case MBACKWARD:
     1010                    return new CSSPrimitiveValue(CSS_VAL_BACKWARDS);
     1011                case MAUTO:
     1012                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     1013                case MUP:
     1014                    return new CSSPrimitiveValue(CSS_VAL_UP);
     1015                case MDOWN:
     1016                    return new CSSPrimitiveValue(CSS_VAL_DOWN);
     1017                case MLEFT:
     1018                    return new CSSPrimitiveValue(CSS_VAL_LEFT);
     1019                case MRIGHT:
     1020                    return new CSSPrimitiveValue(CSS_VAL_RIGHT);
     1021            }
     1022            ASSERT_NOT_REACHED();
     1023            return 0;
     1024        case CSS_PROP__WEBKIT_MARQUEE_INCREMENT:
     1025            return valueForLength(style->marqueeIncrement());
     1026        case CSS_PROP__WEBKIT_MARQUEE_REPETITION:
     1027            if (style->marqueeLoopCount() < 0)
     1028                return new CSSPrimitiveValue(CSS_VAL_INFINITE);
     1029            return new CSSPrimitiveValue(style->marqueeLoopCount(), CSSPrimitiveValue::CSS_NUMBER);
     1030        case CSS_PROP__WEBKIT_MARQUEE_SPEED:
     1031            // FIXME: unimplemented
     1032            break;
     1033        case CSS_PROP__WEBKIT_MARQUEE_STYLE:
     1034            switch (style->marqueeBehavior()) {
     1035                case MNONE:
     1036                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     1037                case MSCROLL:
     1038                    return new CSSPrimitiveValue(CSS_VAL_SCROLL);
     1039                case MSLIDE:
     1040                    return new CSSPrimitiveValue(CSS_VAL_SLIDE);
     1041                case MALTERNATE:
     1042                    return new CSSPrimitiveValue(CSS_VAL_ALTERNATE);
     1043            }
     1044            ASSERT_NOT_REACHED();
     1045            return 0;
     1046        case CSS_PROP__WEBKIT_USER_MODIFY:
     1047            switch (style->userModify()) {
     1048                case READ_ONLY:
     1049                    return new CSSPrimitiveValue(CSS_VAL_READ_ONLY);
     1050                case READ_WRITE:
     1051                    return new CSSPrimitiveValue(CSS_VAL_READ_WRITE);
     1052                case READ_WRITE_PLAINTEXT_ONLY:
     1053                    return new CSSPrimitiveValue(CSS_VAL_READ_WRITE_PLAINTEXT_ONLY);
     1054            }
     1055            ASSERT_NOT_REACHED();
     1056            return 0;
     1057        case CSS_PROP_MAX_HEIGHT:
     1058            return valueForMaxLength(style->maxHeight());
     1059        case CSS_PROP_MAX_WIDTH:
     1060            return valueForMaxLength(style->maxWidth());
     1061        case CSS_PROP_MIN_HEIGHT:
     1062            return valueForLength(style->minHeight());
     1063        case CSS_PROP_MIN_WIDTH:
     1064            return valueForLength(style->minWidth());
     1065        case CSS_PROP_OPACITY:
     1066            return new CSSPrimitiveValue(style->opacity(), CSSPrimitiveValue::CSS_NUMBER);
     1067        case CSS_PROP_ORPHANS:
     1068            return new CSSPrimitiveValue(style->orphans(), CSSPrimitiveValue::CSS_NUMBER);
     1069        case CSS_PROP_OUTLINE_COLOR:
     1070            return currentColorOrValidColor(style, style->outlineColor());
     1071        case CSS_PROP_OUTLINE_OFFSET:
     1072            // FIXME: unimplemented
     1073            break;
     1074        case CSS_PROP_OUTLINE_STYLE:
     1075            if (style->outlineStyleIsAuto())
     1076                return new CSSPrimitiveValue(CSS_VAL_AUTO);
     1077            return valueForBorderStyle(style->outlineStyle());
     1078        case CSS_PROP_OUTLINE_WIDTH:
     1079            // FIXME: unimplemented
     1080            break;
     1081        case CSS_PROP_OVERFLOW:
     1082        case CSS_PROP_OVERFLOW_X:
     1083        case CSS_PROP_OVERFLOW_Y: {
     1084            EOverflow overflow;
     1085            switch (propertyID) {
     1086                case CSS_PROP_OVERFLOW_X:
     1087                    overflow = style->overflowX();
     1088                    break;
     1089                case CSS_PROP_OVERFLOW_Y:
     1090                    overflow = style->overflowY();
     1091                    break;
     1092                default:
     1093                    overflow = max(style->overflowX(), style->overflowY());
     1094            }
     1095            switch (overflow) {
     1096                case OVISIBLE:
     1097                    return new CSSPrimitiveValue(CSS_VAL_VISIBLE);
     1098                case OHIDDEN:
     1099                    return new CSSPrimitiveValue(CSS_VAL_HIDDEN);
     1100                case OSCROLL:
     1101                    return new CSSPrimitiveValue(CSS_VAL_SCROLL);
     1102                case OAUTO:
     1103                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     1104                case OMARQUEE:
     1105                    return new CSSPrimitiveValue(CSS_VAL__WEBKIT_MARQUEE);
     1106                case OOVERLAY:
     1107                    return new CSSPrimitiveValue(CSS_VAL_OVERLAY);
     1108            }
     1109            ASSERT_NOT_REACHED();
     1110            return 0;
    9571111        }
    958         ASSERT_NOT_REACHED();
    959         return 0;
    960     case CSS_PROP_LIST_STYLE_TYPE:
    961         switch (style->listStyleType()) {
    962             case LNONE:
     1112        case CSS_PROP_PADDING_TOP:
     1113            return new CSSPrimitiveValue(renderer->paddingTop(), CSSPrimitiveValue::CSS_PX);
     1114        case CSS_PROP_PADDING_RIGHT:
     1115            return new CSSPrimitiveValue(renderer->paddingRight(), CSSPrimitiveValue::CSS_PX);
     1116        case CSS_PROP_PADDING_BOTTOM:
     1117            return new CSSPrimitiveValue(renderer->paddingBottom(), CSSPrimitiveValue::CSS_PX);
     1118        case CSS_PROP_PADDING_LEFT:
     1119            return new CSSPrimitiveValue(renderer->paddingLeft(), CSSPrimitiveValue::CSS_PX);
     1120        case CSS_PROP_PAGE:
     1121            // FIXME: unimplemented
     1122            break;
     1123        case CSS_PROP_PAGE_BREAK_AFTER:
     1124            switch (style->pageBreakAfter()) {
     1125                case PBAUTO:
     1126                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     1127                case PBALWAYS:
     1128                    return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
     1129                case PBAVOID:
     1130                    return new CSSPrimitiveValue(CSS_VAL_AVOID);
     1131            }
     1132            ASSERT_NOT_REACHED();
     1133            return 0;
     1134        case CSS_PROP_PAGE_BREAK_BEFORE:
     1135            switch (style->pageBreakBefore()) {
     1136                case PBAUTO:
     1137                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     1138                case PBALWAYS:
     1139                    return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
     1140                case PBAVOID:
     1141                    return new CSSPrimitiveValue(CSS_VAL_AVOID);
     1142            }
     1143            ASSERT_NOT_REACHED();
     1144            return 0;
     1145        case CSS_PROP_PAGE_BREAK_INSIDE:
     1146            switch (style->pageBreakInside()) {
     1147                case PBAUTO:
     1148                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     1149                case PBAVOID:
     1150                    return new CSSPrimitiveValue(CSS_VAL_AVOID);
     1151                case PBALWAYS:
     1152                    break; // not allowed
     1153            }
     1154            ASSERT_NOT_REACHED();
     1155            return 0;
     1156        case CSS_PROP_POSITION:
     1157            switch (style->position()) {
     1158                case StaticPosition:
     1159                    return new CSSPrimitiveValue(CSS_VAL_STATIC);
     1160                case RelativePosition:
     1161                    return new CSSPrimitiveValue(CSS_VAL_RELATIVE);
     1162                case AbsolutePosition:
     1163                    return new CSSPrimitiveValue(CSS_VAL_ABSOLUTE);
     1164                case FixedPosition:
     1165                    return new CSSPrimitiveValue(CSS_VAL_FIXED);
     1166            }
     1167            ASSERT_NOT_REACHED();
     1168            return 0;
     1169        case CSS_PROP_QUOTES:
     1170            // FIXME: unimplemented
     1171            break;
     1172        case CSS_PROP_RIGHT:
     1173            return getPositionOffsetValue(renderer, CSS_PROP_RIGHT);
     1174        case CSS_PROP_SIZE:
     1175            // FIXME: unimplemented
     1176            break;
     1177        case CSS_PROP_TABLE_LAYOUT:
     1178            switch (style->tableLayout()) {
     1179                case TAUTO:
     1180                    return new CSSPrimitiveValue(CSS_VAL_AUTO);
     1181                case TFIXED:
     1182                    return new CSSPrimitiveValue(CSS_VAL_FIXED);
     1183            }
     1184            ASSERT_NOT_REACHED();
     1185            return 0;
     1186        case CSS_PROP_TEXT_ALIGN:
     1187            return valueForTextAlign(style->textAlign());
     1188        case CSS_PROP_TEXT_DECORATION: {
     1189            String string;
     1190            if (style->textDecoration() & UNDERLINE)
     1191                string += "underline";
     1192            if (style->textDecoration() & OVERLINE) {
     1193                if (string.length())
     1194                    string += " ";
     1195                string += "overline";
     1196            }
     1197            if (style->textDecoration() & LINE_THROUGH) {
     1198                if (string.length())
     1199                    string += " ";
     1200                string += "line-through";
     1201            }
     1202            if (style->textDecoration() & BLINK) {
     1203                if (string.length())
     1204                    string += " ";
     1205                string += "blink";
     1206            }
     1207            if (!string.length())
    9631208                return new CSSPrimitiveValue(CSS_VAL_NONE);
    964             case DISC:
    965                 return new CSSPrimitiveValue(CSS_VAL_DISC);
    966             case CIRCLE:
    967                 return new CSSPrimitiveValue(CSS_VAL_CIRCLE);
    968             case SQUARE:
    969                 return new CSSPrimitiveValue(CSS_VAL_SQUARE);
    970             case LDECIMAL:
    971                 return new CSSPrimitiveValue(CSS_VAL_DECIMAL);
    972             case DECIMAL_LEADING_ZERO:
    973                 return new CSSPrimitiveValue(CSS_VAL_DECIMAL_LEADING_ZERO);
    974             case LOWER_ROMAN:
    975                 return new CSSPrimitiveValue(CSS_VAL_LOWER_ROMAN);
    976             case UPPER_ROMAN:
    977                 return new CSSPrimitiveValue(CSS_VAL_UPPER_ROMAN);
    978             case LOWER_GREEK:
    979                 return new CSSPrimitiveValue(CSS_VAL_LOWER_GREEK);
    980             case LOWER_ALPHA:
    981                 return new CSSPrimitiveValue(CSS_VAL_LOWER_ALPHA);
    982             case LOWER_LATIN:
    983                 return new CSSPrimitiveValue(CSS_VAL_LOWER_LATIN);
    984             case UPPER_ALPHA:
    985                 return new CSSPrimitiveValue(CSS_VAL_UPPER_ALPHA);
    986             case UPPER_LATIN:
    987                 return new CSSPrimitiveValue(CSS_VAL_UPPER_LATIN);
    988             case HEBREW:
    989                 return new CSSPrimitiveValue(CSS_VAL_HEBREW);
    990             case ARMENIAN:
    991                 return new CSSPrimitiveValue(CSS_VAL_ARMENIAN);
    992             case GEORGIAN:
    993                 return new CSSPrimitiveValue(CSS_VAL_GEORGIAN);
    994             case CJK_IDEOGRAPHIC:
    995                 return new CSSPrimitiveValue(CSS_VAL_CJK_IDEOGRAPHIC);
    996             case HIRAGANA:
    997                 return new CSSPrimitiveValue(CSS_VAL_HIRAGANA);
    998             case KATAKANA:
    999                 return new CSSPrimitiveValue(CSS_VAL_KATAKANA);
    1000             case HIRAGANA_IROHA:
    1001                 return new CSSPrimitiveValue(CSS_VAL_HIRAGANA_IROHA);
    1002             case KATAKANA_IROHA:
    1003                 return new CSSPrimitiveValue(CSS_VAL_KATAKANA_IROHA);
     1209            return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
    10041210        }
    1005         ASSERT_NOT_REACHED();
    1006         return 0;
    1007     case CSS_PROP_MARGIN_TOP:
    1008         // FIXME: Supposed to return the percentage if percentage was specified.
    1009         return new CSSPrimitiveValue(renderer->marginTop(), CSSPrimitiveValue::CSS_PX);
    1010     case CSS_PROP_MARGIN_RIGHT:
    1011         // FIXME: Supposed to return the percentage if percentage was specified.
    1012         return new CSSPrimitiveValue(renderer->marginRight(), CSSPrimitiveValue::CSS_PX);
    1013     case CSS_PROP_MARGIN_BOTTOM:
    1014         // FIXME: Supposed to return the percentage if percentage was specified.
    1015         return new CSSPrimitiveValue(renderer->marginBottom(), CSSPrimitiveValue::CSS_PX);
    1016     case CSS_PROP_MARGIN_LEFT:
    1017         // FIXME: Supposed to return the percentage if percentage was specified.
    1018         return new CSSPrimitiveValue(renderer->marginLeft(), CSSPrimitiveValue::CSS_PX);
    1019     case CSS_PROP__WEBKIT_MARQUEE:
    1020         // FIXME: unimplemented
    1021         break;
    1022     case CSS_PROP__WEBKIT_MARQUEE_DIRECTION:
    1023         switch (style->marqueeDirection()) {
    1024             case MFORWARD:
    1025                 return new CSSPrimitiveValue(CSS_VAL_FORWARDS);
    1026             case MBACKWARD:
    1027                 return new CSSPrimitiveValue(CSS_VAL_BACKWARDS);
    1028             case MAUTO:
     1211        case CSS_PROP__WEBKIT_TEXT_DECORATIONS_IN_EFFECT: {
     1212            String string;
     1213            if (style->textDecorationsInEffect() & UNDERLINE)
     1214                string += "underline";
     1215            if (style->textDecorationsInEffect() & OVERLINE) {
     1216                if (string.length())
     1217                    string += " ";
     1218                string += "overline";
     1219            }
     1220            if (style->textDecorationsInEffect() & LINE_THROUGH) {
     1221                if (string.length())
     1222                    string += " ";
     1223                string += "line-through";
     1224            }
     1225            if (style->textDecorationsInEffect() & BLINK) {
     1226                if (string.length())
     1227                    string += " ";
     1228                string += "blink";
     1229            }
     1230            if (!string.length())
     1231                return new CSSPrimitiveValue(CSS_VAL_NONE);
     1232            return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
     1233        }
     1234        case CSS_PROP__WEBKIT_TEXT_FILL_COLOR:
     1235            return currentColorOrValidColor(style, style->textFillColor());
     1236        case CSS_PROP_TEXT_INDENT:
     1237            return valueForLength(style->textIndent());
     1238        case CSS_PROP_TEXT_SHADOW:
     1239            return valueForShadow(style->textShadow());
     1240        case CSS_PROP__WEBKIT_TEXT_SECURITY:
     1241            switch (style->textSecurity()) {
     1242                case TSNONE:
     1243                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     1244                case TSDISC:
     1245                    return new CSSPrimitiveValue(CSS_VAL_DISC);
     1246                case TSCIRCLE:
     1247                    return new CSSPrimitiveValue(CSS_VAL_CIRCLE);
     1248                case TSSQUARE:
     1249                    return new CSSPrimitiveValue(CSS_VAL_SQUARE);
     1250            }
     1251            ASSERT_NOT_REACHED();
     1252            return 0;
     1253        case CSS_PROP__WEBKIT_TEXT_SIZE_ADJUST:
     1254            if (style->textSizeAdjust())
    10291255                return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1030             case MUP:
    1031                 return new CSSPrimitiveValue(CSS_VAL_UP);
    1032             case MDOWN:
    1033                 return new CSSPrimitiveValue(CSS_VAL_DOWN);
    1034             case MLEFT:
    1035                 return new CSSPrimitiveValue(CSS_VAL_LEFT);
    1036             case MRIGHT:
    1037                 return new CSSPrimitiveValue(CSS_VAL_RIGHT);
    1038         }
    1039         ASSERT_NOT_REACHED();
    1040         return 0;
    1041     case CSS_PROP__WEBKIT_MARQUEE_INCREMENT:
    1042         return valueForLength(style->marqueeIncrement());
    1043     case CSS_PROP__WEBKIT_MARQUEE_REPETITION:
    1044         if (style->marqueeLoopCount() < 0)
    1045             return new CSSPrimitiveValue(CSS_VAL_INFINITE);
    1046         return new CSSPrimitiveValue(style->marqueeLoopCount(), CSSPrimitiveValue::CSS_NUMBER);
    1047     case CSS_PROP__WEBKIT_MARQUEE_SPEED:
    1048         // FIXME: unimplemented
    1049         break;
    1050     case CSS_PROP__WEBKIT_MARQUEE_STYLE:
    1051         switch (style->marqueeBehavior()) {
    1052             case MNONE:
    1053                 return new CSSPrimitiveValue(CSS_VAL_NONE);
    1054             case MSCROLL:
    1055                 return new CSSPrimitiveValue(CSS_VAL_SCROLL);
    1056             case MSLIDE:
    1057                 return new CSSPrimitiveValue(CSS_VAL_SLIDE);
    1058             case MALTERNATE:
    1059                 return new CSSPrimitiveValue(CSS_VAL_ALTERNATE);
    1060         }
    1061         ASSERT_NOT_REACHED();
    1062         return 0;
    1063     case CSS_PROP__WEBKIT_USER_MODIFY:
    1064         switch (style->userModify()) {
    1065             case READ_ONLY:
    1066                 return new CSSPrimitiveValue(CSS_VAL_READ_ONLY);
    1067             case READ_WRITE:
    1068                 return new CSSPrimitiveValue(CSS_VAL_READ_WRITE);
    1069             case READ_WRITE_PLAINTEXT_ONLY:
    1070                 return new CSSPrimitiveValue(CSS_VAL_READ_WRITE_PLAINTEXT_ONLY);
    1071         }
    1072         ASSERT_NOT_REACHED();
    1073         return 0;
    1074     case CSS_PROP_MAX_HEIGHT:
    1075         return valueForMaxLength(style->maxHeight());
    1076     case CSS_PROP_MAX_WIDTH:
    1077         return valueForMaxLength(style->maxWidth());
    1078     case CSS_PROP_MIN_HEIGHT:
    1079         return valueForLength(style->minHeight());
    1080     case CSS_PROP_MIN_WIDTH:
    1081         return valueForLength(style->minWidth());
    1082     case CSS_PROP_OPACITY:
    1083         return new CSSPrimitiveValue(style->opacity(), CSSPrimitiveValue::CSS_NUMBER);
    1084     case CSS_PROP_ORPHANS:
    1085         return new CSSPrimitiveValue(style->orphans(), CSSPrimitiveValue::CSS_NUMBER);
    1086     case CSS_PROP_OUTLINE_COLOR:
    1087         return currentColorOrValidColor(style, style->outlineColor());
    1088     case CSS_PROP_OUTLINE_OFFSET:
    1089         // FIXME: unimplemented
    1090         break;
    1091     case CSS_PROP_OUTLINE_STYLE:
    1092         if (style->outlineStyleIsAuto())
    1093             return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1094         return valueForBorderStyle(style->outlineStyle());
    1095     case CSS_PROP_OUTLINE_WIDTH:
    1096         // FIXME: unimplemented
    1097         break;
    1098     case CSS_PROP_OVERFLOW:
    1099     case CSS_PROP_OVERFLOW_X:
    1100     case CSS_PROP_OVERFLOW_Y:
    1101         EOverflow overflow;
    1102         switch (propertyID) {
    1103             case CSS_PROP_OVERFLOW_X:
    1104                 overflow = style->overflowX();
    1105                 break;
    1106             case CSS_PROP_OVERFLOW_Y:
    1107                 overflow = style->overflowY();
    1108                 break;
    1109             default:
    1110                 overflow = max(style->overflowX(), style->overflowY());
    1111         }
    1112         switch (overflow) {
    1113             case OVISIBLE:
    1114                 return new CSSPrimitiveValue(CSS_VAL_VISIBLE);
    1115             case OHIDDEN:
    1116                 return new CSSPrimitiveValue(CSS_VAL_HIDDEN);
    1117             case OSCROLL:
    1118                 return new CSSPrimitiveValue(CSS_VAL_SCROLL);
    1119             case OAUTO:
    1120                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1121             case OMARQUEE:
    1122                 return new CSSPrimitiveValue(CSS_VAL__WEBKIT_MARQUEE);
    1123             case OOVERLAY:
    1124                 return new CSSPrimitiveValue(CSS_VAL_OVERLAY);
    1125         }
    1126         ASSERT_NOT_REACHED();
    1127         return 0;
    1128     case CSS_PROP_PADDING_TOP:
    1129         return new CSSPrimitiveValue(renderer->paddingTop(), CSSPrimitiveValue::CSS_PX);
    1130     case CSS_PROP_PADDING_RIGHT:
    1131         return new CSSPrimitiveValue(renderer->paddingRight(), CSSPrimitiveValue::CSS_PX);
    1132     case CSS_PROP_PADDING_BOTTOM:
    1133         return new CSSPrimitiveValue(renderer->paddingBottom(), CSSPrimitiveValue::CSS_PX);
    1134     case CSS_PROP_PADDING_LEFT:
    1135         return new CSSPrimitiveValue(renderer->paddingLeft(), CSSPrimitiveValue::CSS_PX);
    1136     case CSS_PROP_PAGE:
    1137         // FIXME: unimplemented
    1138         break;
    1139     case CSS_PROP_PAGE_BREAK_AFTER:
    1140         switch (style->pageBreakAfter()) {
    1141             case PBAUTO:
    1142                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1143             case PBALWAYS:
    1144                 return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
    1145             case PBAVOID:
    1146                 return new CSSPrimitiveValue(CSS_VAL_AVOID);
    1147         }
    1148         ASSERT_NOT_REACHED();
    1149         return 0;
    1150     case CSS_PROP_PAGE_BREAK_BEFORE:
    1151         switch (style->pageBreakBefore()) {
    1152             case PBAUTO:
    1153                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1154             case PBALWAYS:
    1155                 return new CSSPrimitiveValue(CSS_VAL_ALWAYS);
    1156             case PBAVOID:
    1157                 return new CSSPrimitiveValue(CSS_VAL_AVOID);
    1158         }
    1159         ASSERT_NOT_REACHED();
    1160         return 0;
    1161     case CSS_PROP_PAGE_BREAK_INSIDE:
    1162         switch (style->pageBreakInside()) {
    1163             case PBAUTO:
    1164                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1165             case PBAVOID:
    1166                 return new CSSPrimitiveValue(CSS_VAL_AVOID);
    1167             case PBALWAYS:
    1168                 break; // not allowed
    1169         }
    1170         ASSERT_NOT_REACHED();
    1171         return 0;
    1172     case CSS_PROP_POSITION:
    1173         switch (style->position()) {
    1174             case StaticPosition:
    1175                 return new CSSPrimitiveValue(CSS_VAL_STATIC);
    1176             case RelativePosition:
    1177                 return new CSSPrimitiveValue(CSS_VAL_RELATIVE);
    1178             case AbsolutePosition:
    1179                 return new CSSPrimitiveValue(CSS_VAL_ABSOLUTE);
    1180             case FixedPosition:
    1181                 return new CSSPrimitiveValue(CSS_VAL_FIXED);
    1182         }
    1183         ASSERT_NOT_REACHED();
    1184         return 0;
    1185     case CSS_PROP_QUOTES:
    1186         // FIXME: unimplemented
    1187         break;
    1188     case CSS_PROP_RIGHT:
    1189         return getPositionOffsetValue(renderer, CSS_PROP_RIGHT);
    1190     case CSS_PROP_SIZE:
    1191         // FIXME: unimplemented
    1192         break;
    1193     case CSS_PROP_TABLE_LAYOUT:
    1194         switch (style->tableLayout()) {
    1195             case TAUTO:
    1196                 return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1197             case TFIXED:
    1198                 return new CSSPrimitiveValue(CSS_VAL_FIXED);
    1199         }
    1200         ASSERT_NOT_REACHED();
    1201         return 0;
    1202     case CSS_PROP_TEXT_ALIGN:
    1203         return valueForTextAlign(style->textAlign());
    1204     case CSS_PROP_TEXT_DECORATION:
    1205     {
    1206         String string;
    1207         if (style->textDecoration() & UNDERLINE)
    1208             string += "underline";
    1209         if (style->textDecoration() & OVERLINE) {
    1210             if (string.length() > 0)
    1211                 string += " ";
    1212             string += "overline";
    1213         }
    1214         if (style->textDecoration() & LINE_THROUGH) {
    1215             if (string.length() > 0)
    1216                 string += " ";
    1217             string += "line-through";
    1218         }
    1219         if (style->textDecoration() & BLINK) {
    1220             if (string.length() > 0)
    1221                 string += " ";
    1222             string += "blink";
    1223         }
    1224         if (string.length() == 0)
    12251256            return new CSSPrimitiveValue(CSS_VAL_NONE);
    1226         return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
    1227     }
    1228     case CSS_PROP__WEBKIT_TEXT_DECORATIONS_IN_EFFECT:
    1229     {
    1230         String string;
    1231         if (style->textDecorationsInEffect() & UNDERLINE)
    1232             string += "underline";
    1233         if (style->textDecorationsInEffect() & OVERLINE) {
    1234             if (string.length() > 0)
    1235                 string += " ";
    1236             string += "overline";
    1237         }
    1238         if (style->textDecorationsInEffect() & LINE_THROUGH) {
    1239             if (string.length() > 0)
    1240                 string += " ";
    1241             string += "line-through";
    1242         }
    1243         if (style->textDecorationsInEffect() & BLINK) {
    1244             if (string.length() > 0)
    1245                 string += " ";
    1246             string += "blink";
    1247         }
    1248         if (string.length() == 0)
    1249             return new CSSPrimitiveValue(CSS_VAL_NONE);
    1250         return new CSSPrimitiveValue(string, CSSPrimitiveValue::CSS_STRING);
    1251     }
    1252     case CSS_PROP__WEBKIT_TEXT_FILL_COLOR:
    1253         return currentColorOrValidColor(style, style->textFillColor());
    1254     case CSS_PROP_TEXT_INDENT:
    1255         return valueForLength(style->textIndent());
    1256     case CSS_PROP_TEXT_SHADOW:
    1257         return valueForShadow(style->textShadow());
    1258     case CSS_PROP__WEBKIT_TEXT_SECURITY:
    1259     {
    1260         switch (style->textSecurity()) {
    1261             case TSNONE:
    1262                 return new CSSPrimitiveValue(CSS_VAL_NONE);
    1263             case TSDISC:
    1264                 return new CSSPrimitiveValue(CSS_VAL_DISC);
    1265             case TSCIRCLE:
    1266                 return new CSSPrimitiveValue(CSS_VAL_CIRCLE);
    1267             case TSSQUARE:
    1268                 return new CSSPrimitiveValue(CSS_VAL_SQUARE);
    1269         }
    1270         ASSERT_NOT_REACHED();
    1271         return 0;
    1272     }
    1273     case CSS_PROP__WEBKIT_TEXT_SIZE_ADJUST:
    1274         if (style->textSizeAdjust())
    1275             return new CSSPrimitiveValue(CSS_VAL_AUTO);
    1276         else
    1277             return new CSSPrimitiveValue(CSS_VAL_NONE);
    1278     case CSS_PROP__WEBKIT_TEXT_STROKE_COLOR:
    1279         return currentColorOrValidColor(style, style->textStrokeColor());
    1280     case CSS_PROP__WEBKIT_TEXT_STROKE_WIDTH:
    1281         return new CSSPrimitiveValue(style->textStrokeWidth(), CSSPrimitiveValue::CSS_NUMBER);
    1282     case CSS_PROP_TEXT_TRANSFORM:
    1283         switch (style->textTransform()) {
    1284             case CAPITALIZE:
    1285                 return new CSSPrimitiveValue(CSS_VAL_CAPITALIZE);
    1286             case UPPERCASE:
    1287                 return new CSSPrimitiveValue(CSS_VAL_UPPERCASE);
    1288             case LOWERCASE:
    1289                 return new CSSPrimitiveValue(CSS_VAL_LOWERCASE);
    1290             case TTNONE:
    1291                 return new CSSPrimitiveValue(CSS_VAL_NONE);
    1292         }
    1293         ASSERT_NOT_REACHED();
    1294         return 0;
    1295     case CSS_PROP_TOP:
    1296         return getPositionOffsetValue(renderer, CSS_PROP_TOP);
    1297     case CSS_PROP_UNICODE_BIDI:
    1298         switch (style->unicodeBidi()) {
    1299             case UBNormal:
     1257        case CSS_PROP__WEBKIT_TEXT_STROKE_COLOR:
     1258            return currentColorOrValidColor(style, style->textStrokeColor());
     1259        case CSS_PROP__WEBKIT_TEXT_STROKE_WIDTH:
     1260            return new CSSPrimitiveValue(style->textStrokeWidth(), CSSPrimitiveValue::CSS_NUMBER);
     1261        case CSS_PROP_TEXT_TRANSFORM:
     1262            switch (style->textTransform()) {
     1263                case CAPITALIZE:
     1264                    return new CSSPrimitiveValue(CSS_VAL_CAPITALIZE);
     1265                case UPPERCASE:
     1266                    return new CSSPrimitiveValue(CSS_VAL_UPPERCASE);
     1267                case LOWERCASE:
     1268                    return new CSSPrimitiveValue(CSS_VAL_LOWERCASE);
     1269                case TTNONE:
     1270                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     1271            }
     1272            ASSERT_NOT_REACHED();
     1273            return 0;
     1274        case CSS_PROP_TOP:
     1275            return getPositionOffsetValue(renderer, CSS_PROP_TOP);
     1276        case CSS_PROP_UNICODE_BIDI:
     1277            switch (style->unicodeBidi()) {
     1278                case UBNormal:
     1279                    return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     1280                case Embed:
     1281                    return new CSSPrimitiveValue(CSS_VAL_EMBED);
     1282                case Override:
     1283                    return new CSSPrimitiveValue(CSS_VAL_BIDI_OVERRIDE);
     1284            }
     1285            ASSERT_NOT_REACHED();
     1286            return 0;
     1287        case CSS_PROP_VERTICAL_ALIGN:
     1288            switch (style->verticalAlign()) {
     1289                case BASELINE:
     1290                    return new CSSPrimitiveValue(CSS_VAL_BASELINE);
     1291                case MIDDLE:
     1292                    return new CSSPrimitiveValue(CSS_VAL_MIDDLE);
     1293                case SUB:
     1294                    return new CSSPrimitiveValue(CSS_VAL_SUB);
     1295                case SUPER:
     1296                    return new CSSPrimitiveValue(CSS_VAL_SUPER);
     1297                case TEXT_TOP:
     1298                    return new CSSPrimitiveValue(CSS_VAL_TEXT_TOP);
     1299                case TEXT_BOTTOM:
     1300                    return new CSSPrimitiveValue(CSS_VAL_TEXT_BOTTOM);
     1301                case TOP:
     1302                    return new CSSPrimitiveValue(CSS_VAL_TOP);
     1303                case BOTTOM:
     1304                    return new CSSPrimitiveValue(CSS_VAL_BOTTOM);
     1305                case BASELINE_MIDDLE:
     1306                    return new CSSPrimitiveValue(CSS_VAL__WEBKIT_BASELINE_MIDDLE);
     1307                case LENGTH:
     1308                    return valueForLength(style->verticalAlignLength());
     1309            }
     1310            ASSERT_NOT_REACHED();
     1311            return 0;
     1312        case CSS_PROP_VISIBILITY:
     1313            switch (style->visibility()) {
     1314                case VISIBLE:
     1315                    return new CSSPrimitiveValue(CSS_VAL_VISIBLE);
     1316                case HIDDEN:
     1317                    return new CSSPrimitiveValue(CSS_VAL_HIDDEN);
     1318                case COLLAPSE:
     1319                    return new CSSPrimitiveValue(CSS_VAL_COLLAPSE);
     1320            }
     1321            ASSERT_NOT_REACHED();
     1322            return 0;
     1323        case CSS_PROP_WHITE_SPACE:
     1324            switch (style->whiteSpace()) {
     1325                case NORMAL:
     1326                    return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     1327                case PRE:
     1328                    return new CSSPrimitiveValue(CSS_VAL_PRE);
     1329                case PRE_WRAP:
     1330                    return new CSSPrimitiveValue(CSS_VAL_PRE_WRAP);
     1331                case PRE_LINE:
     1332                    return new CSSPrimitiveValue(CSS_VAL_PRE_LINE);
     1333                case NOWRAP:
     1334                    return new CSSPrimitiveValue(CSS_VAL_NOWRAP);
     1335                case KHTML_NOWRAP:
     1336                    return new CSSPrimitiveValue(CSS_VAL__WEBKIT_NOWRAP);
     1337            }
     1338            ASSERT_NOT_REACHED();
     1339            return 0;
     1340        case CSS_PROP_WIDOWS:
     1341            return new CSSPrimitiveValue(style->widows(), CSSPrimitiveValue::CSS_NUMBER);
     1342        case CSS_PROP_WIDTH:
     1343            return new CSSPrimitiveValue(renderer->contentWidth(), CSSPrimitiveValue::CSS_PX);
     1344        case CSS_PROP_WORD_SPACING:
     1345            return new CSSPrimitiveValue(style->wordSpacing(), CSSPrimitiveValue::CSS_PX);
     1346        case CSS_PROP_WORD_WRAP:
     1347            switch (style->wordWrap()) {
     1348                case WBNORMAL:
     1349                    return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     1350                case BREAK_WORD:
     1351                    return new CSSPrimitiveValue(CSS_VAL_BREAK_WORD);
     1352            }
     1353            ASSERT_NOT_REACHED();
     1354            return 0;
     1355        case CSS_PROP__WEBKIT_LINE_BREAK:
     1356            switch (style->khtmlLineBreak()) {
     1357                case LBNORMAL:
     1358                    return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     1359                case AFTER_WHITE_SPACE:
     1360                    return new CSSPrimitiveValue(CSS_VAL_AFTER_WHITE_SPACE);
     1361            }
     1362            ASSERT_NOT_REACHED();
     1363            return 0;
     1364        case CSS_PROP__WEBKIT_NBSP_MODE:
     1365            switch (style->nbspMode()) {
     1366                case NBNORMAL:
     1367                    return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     1368                case SPACE:
     1369                    return new CSSPrimitiveValue(CSS_VAL_SPACE);
     1370            }
     1371            ASSERT_NOT_REACHED();
     1372            return 0;
     1373        case CSS_PROP__WEBKIT_MATCH_NEAREST_MAIL_BLOCKQUOTE_COLOR:
     1374            switch (style->matchNearestMailBlockquoteColor()) {
     1375                case BCNORMAL:
     1376                    return new CSSPrimitiveValue(CSS_VAL_NORMAL);
     1377                case MATCH:
     1378                    return new CSSPrimitiveValue(CSS_VAL_MATCH);
     1379            }
     1380            ASSERT_NOT_REACHED();
     1381            return 0;
     1382        case CSS_PROP_RESIZE:
     1383            switch (style->resize()) {
     1384                case RESIZE_BOTH:
     1385                    return new CSSPrimitiveValue(CSS_VAL_BOTH);
     1386                case RESIZE_HORIZONTAL:
     1387                    return new CSSPrimitiveValue(CSS_VAL_HORIZONTAL);
     1388                case RESIZE_VERTICAL:
     1389                    return new CSSPrimitiveValue(CSS_VAL_VERTICAL);
     1390                case RESIZE_NONE:
     1391                    return new CSSPrimitiveValue(CSS_VAL_NONE);
     1392            }
     1393            ASSERT_NOT_REACHED();
     1394            return 0;
     1395        case CSS_PROP_Z_INDEX:
     1396            if (style->hasAutoZIndex())
    13001397                return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    1301             case Embed:
    1302                 return new CSSPrimitiveValue(CSS_VAL_EMBED);
    1303             case Override:
    1304                 return new CSSPrimitiveValue(CSS_VAL_BIDI_OVERRIDE);
    1305         }
    1306         ASSERT_NOT_REACHED();
    1307         return 0;
    1308     case CSS_PROP_VERTICAL_ALIGN:
    1309         switch (style->verticalAlign()) {
    1310             case BASELINE:
    1311                 return new CSSPrimitiveValue(CSS_VAL_BASELINE);
    1312             case MIDDLE:
    1313                 return new CSSPrimitiveValue(CSS_VAL_MIDDLE);
    1314             case SUB:
    1315                 return new CSSPrimitiveValue(CSS_VAL_SUB);
    1316             case SUPER:
    1317                 return new CSSPrimitiveValue(CSS_VAL_SUPER);
    1318             case TEXT_TOP:
    1319                 return new CSSPrimitiveValue(CSS_VAL_TEXT_TOP);
    1320             case TEXT_BOTTOM:
    1321                 return new CSSPrimitiveValue(CSS_VAL_TEXT_BOTTOM);
    1322             case TOP:
    1323                 return new CSSPrimitiveValue(CSS_VAL_TOP);
    1324             case BOTTOM:
    1325                 return new CSSPrimitiveValue(CSS_VAL_BOTTOM);
    1326             case BASELINE_MIDDLE:
    1327                 return new CSSPrimitiveValue(CSS_VAL__WEBKIT_BASELINE_MIDDLE);
    1328             case LENGTH:
    1329                 return valueForLength(style->verticalAlignLength());
    1330         }
    1331         ASSERT_NOT_REACHED();
    1332         return 0;
    1333     case CSS_PROP_VISIBILITY:
    1334         switch (style->visibility()) {
    1335             case VISIBLE:
    1336                 return new CSSPrimitiveValue(CSS_VAL_VISIBLE);
    1337             case HIDDEN:
    1338                 return new CSSPrimitiveValue(CSS_VAL_HIDDEN);
    1339             case COLLAPSE:
    1340                 return new CSSPrimitiveValue(CSS_VAL_COLLAPSE);
    1341         }
    1342         ASSERT_NOT_REACHED();
    1343         return 0;
    1344     case CSS_PROP_WHITE_SPACE:
    1345         switch (style->whiteSpace()) {
    1346             case NORMAL:
    1347                 return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    1348             case PRE:
    1349                 return new CSSPrimitiveValue(CSS_VAL_PRE);
    1350             case PRE_WRAP:
    1351                 return new CSSPrimitiveValue(CSS_VAL_PRE_WRAP);
    1352             case PRE_LINE:
    1353                 return new CSSPrimitiveValue(CSS_VAL_PRE_LINE);
    1354             case NOWRAP:
    1355                 return new CSSPrimitiveValue(CSS_VAL_NOWRAP);
    1356             case KHTML_NOWRAP:
    1357                 return new CSSPrimitiveValue(CSS_VAL__WEBKIT_NOWRAP);
    1358         }
    1359         ASSERT_NOT_REACHED();
    1360         return 0;
    1361     case CSS_PROP_WIDOWS:
    1362         return new CSSPrimitiveValue(style->widows(), CSSPrimitiveValue::CSS_NUMBER);
    1363     case CSS_PROP_WIDTH:
    1364         return new CSSPrimitiveValue(renderer->contentWidth(), CSSPrimitiveValue::CSS_PX);
    1365     case CSS_PROP_WORD_SPACING:
    1366         return new CSSPrimitiveValue(style->wordSpacing(), CSSPrimitiveValue::CSS_PX);
    1367     case CSS_PROP_WORD_WRAP:
    1368         switch (style->wordWrap()) {
    1369             case WBNORMAL:
    1370                 return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    1371             case BREAK_WORD:
    1372                 return new CSSPrimitiveValue(CSS_VAL_BREAK_WORD);
    1373         }
    1374         ASSERT_NOT_REACHED();
    1375         return 0;
    1376     case CSS_PROP__WEBKIT_LINE_BREAK:
    1377         switch (style->khtmlLineBreak()) {
    1378             case LBNORMAL:
    1379                 return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    1380             case AFTER_WHITE_SPACE:
    1381                 return new CSSPrimitiveValue(CSS_VAL_AFTER_WHITE_SPACE);
    1382         }
    1383         ASSERT_NOT_REACHED();
    1384         return 0;
    1385     case CSS_PROP__WEBKIT_NBSP_MODE:
    1386         switch (style->nbspMode()) {
    1387             case NBNORMAL:
    1388                 return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    1389             case SPACE:
    1390                 return new CSSPrimitiveValue(CSS_VAL_SPACE);
    1391         }
    1392         ASSERT_NOT_REACHED();
    1393         return 0;
    1394     case CSS_PROP__WEBKIT_MATCH_NEAREST_MAIL_BLOCKQUOTE_COLOR:
    1395         switch (style->matchNearestMailBlockquoteColor()) {
    1396             case BCNORMAL:
    1397                 return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    1398             case MATCH:
    1399                 return new CSSPrimitiveValue(CSS_VAL_MATCH);
    1400         }
    1401         ASSERT_NOT_REACHED();
    1402         return 0;
    1403     case CSS_PROP_RESIZE:
    1404         switch (style->resize()) {
    1405             case RESIZE_BOTH:
    1406                 return new CSSPrimitiveValue(CSS_VAL_BOTH);
    1407             case RESIZE_HORIZONTAL:
    1408                 return new CSSPrimitiveValue(CSS_VAL_HORIZONTAL);
    1409             case RESIZE_VERTICAL:
    1410                 return new CSSPrimitiveValue(CSS_VAL_VERTICAL);
    1411             case RESIZE_NONE:
    1412             default:
    1413                 return new CSSPrimitiveValue(CSS_VAL_NONE);
    1414         }
    1415     case CSS_PROP_Z_INDEX:
    1416         if (style->hasAutoZIndex())
    1417             return new CSSPrimitiveValue(CSS_VAL_NORMAL);
    1418         return new CSSPrimitiveValue(style->zIndex(), CSSPrimitiveValue::CSS_NUMBER);
    1419     case CSS_PROP_BACKGROUND:
    1420         // FIXME: unimplemented
    1421         break;
    1422     case CSS_PROP_BORDER:
    1423         // FIXME: unimplemented
    1424         break;
    1425     case CSS_PROP_BORDER_COLOR:
    1426         // FIXME: unimplemented
    1427         break;
    1428     case CSS_PROP_BORDER_STYLE:
    1429         // FIXME: unimplemented
    1430         break;
    1431     case CSS_PROP_BORDER_TOP:
    1432         // FIXME: unimplemented
    1433         break;
    1434     case CSS_PROP_BORDER_RIGHT:
    1435         // FIXME: unimplemented
    1436         break;
    1437     case CSS_PROP_BORDER_BOTTOM:
    1438         // FIXME: unimplemented
    1439         break;
    1440     case CSS_PROP_BORDER_LEFT:
    1441         // FIXME: unimplemented
    1442         break;
    1443     case CSS_PROP_BORDER_WIDTH:
    1444         // FIXME: unimplemented
    1445         break;
    1446     case CSS_PROP_FONT:
    1447         // FIXME: unimplemented
    1448         break;
    1449     case CSS_PROP_LIST_STYLE:
    1450         // FIXME: unimplemented
    1451         break;
    1452     case CSS_PROP_MARGIN:
    1453         // FIXME: unimplemented
    1454         break;
    1455     case CSS_PROP_OUTLINE:
    1456         // FIXME: unimplemented
    1457         break;
    1458     case CSS_PROP_PADDING:
    1459         // FIXME: unimplemented
    1460         break;
     1398            return new CSSPrimitiveValue(style->zIndex(), CSSPrimitiveValue::CSS_NUMBER);
     1399        case CSS_PROP_BACKGROUND:
     1400            // FIXME: unimplemented
     1401            break;
     1402        case CSS_PROP_BORDER:
     1403            // FIXME: unimplemented
     1404            break;
     1405        case CSS_PROP_BORDER_COLOR:
     1406            // FIXME: unimplemented
     1407            break;
     1408        case CSS_PROP_BORDER_STYLE:
     1409            // FIXME: unimplemented
     1410            break;
     1411        case CSS_PROP_BORDER_TOP:
     1412            // FIXME: unimplemented
     1413            break;
     1414        case CSS_PROP_BORDER_RIGHT:
     1415            // FIXME: unimplemented
     1416            break;
     1417        case CSS_PROP_BORDER_BOTTOM:
     1418            // FIXME: unimplemented
     1419            break;
     1420        case CSS_PROP_BORDER_LEFT:
     1421            // FIXME: unimplemented
     1422            break;
     1423        case CSS_PROP_BORDER_WIDTH:
     1424            // FIXME: unimplemented
     1425            break;
     1426        case CSS_PROP_FONT:
     1427            // FIXME: unimplemented
     1428            break;
     1429        case CSS_PROP_LIST_STYLE:
     1430            // FIXME: unimplemented
     1431            break;
     1432        case CSS_PROP_MARGIN:
     1433            // FIXME: unimplemented
     1434            break;
     1435        case CSS_PROP_OUTLINE:
     1436            // FIXME: unimplemented
     1437            break;
     1438        case CSS_PROP_PADDING:
     1439            // FIXME: unimplemented
     1440            break;
    14611441#if PLATFORM(MAC)
    14621442        case CSS_PROP__WEBKIT_DASHBOARD_REGION: {
     
    14651445            if (count == 1 && regions[0].type == StyleDashboardRegion::None)
    14661446                return new CSSPrimitiveValue(CSS_VAL_NONE);
    1467            
     1447
    14681448            RefPtr<DashboardRegion> firstRegion;
    14691449            DashboardRegion* previousRegion = 0;
     
    14781458                region->setBottom(new CSSPrimitiveValue(offset.bottom.value(), CSSPrimitiveValue::CSS_PX));
    14791459                region->setLeft(new CSSPrimitiveValue(offset.left.value(), CSSPrimitiveValue::CSS_PX));
    1480                 region->m_isRectangle = (styleRegion.type == StyleDashboardRegion::Rectangle); 
     1460                region->m_isRectangle = (styleRegion.type == StyleDashboardRegion::Rectangle);
    14811461                region->m_isCircle = (styleRegion.type == StyleDashboardRegion::Circle);
    14821462
     
    15041484}
    15051485
    1506 bool CSSComputedStyleDeclaration::getPropertyPriority(int) const
     1486bool CSSComputedStyleDeclaration::getPropertyPriority(int /*propertyID*/) const
    15071487{
    15081488    // All computed styles have a priority of false (not "important").
     
    15101490}
    15111491
    1512 String CSSComputedStyleDeclaration::removeProperty(int, ExceptionCode& ec)
     1492String CSSComputedStyleDeclaration::removeProperty(int /*propertyID*/, ExceptionCode& ec)
    15131493{
    15141494    ec = NO_MODIFICATION_ALLOWED_ERR;
     
    15161496}
    15171497
    1518 void CSSComputedStyleDeclaration::setProperty(int, const String&, bool, ExceptionCode& ec)
     1498void CSSComputedStyleDeclaration::setProperty(int /*propertyID*/, const String& /*value*/, bool /*important*/, ExceptionCode& ec)
    15191499{
    15201500    ec = NO_MODIFICATION_ALLOWED_ERR;
     
    15261506    if (!node)
    15271507        return 0;
     1508
    15281509    RenderObject* renderer = node->renderer();
    15291510    if (!renderer)
    15301511        return 0;
     1512
    15311513    RenderStyle* style = renderer->style();
    15321514    if (!style)
    15331515        return 0;
     1516
    15341517    return numComputedProperties;
    15351518}
     
    15391522    if (i >= length())
    15401523        return String();
    1541    
     1524
    15421525    return getPropertyName(computedProperties[i]);
    15431526}
  • trunk/WebCore/css/CSSComputedStyleDeclaration.h

    r18676 r18850  
    11/**
    2  * CSSComputedStyleDeclaration.h
    32 *
    43 * Copyright (C)  2004  Zack Rusin <zack@kde.org>
     
    2120 */
    2221
    23 #ifndef CSS_COMPUTEDSTYLE_H
    24 #define CSS_COMPUTEDSTYLE_H
     22#ifndef CSSComputedStyleDeclaration_h
     23#define CSSComputedStyleDeclaration_h
    2524
    2625#include "CSSStyleDeclaration.h"
     
    6362private:
    6463    virtual void setCssText(const String&, ExceptionCode&);
     64
    6565    virtual String removeProperty(int propertyID, ExceptionCode&);
    6666    virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&);
     
    6969};
    7070
    71 }
     71} // namespace WebCore
    7272
    73 #endif
     73#endif // CSSComputedStyleDeclaration_h
  • trunk/WebCore/css/CSSCursorImageValue.cpp

    r16549 r18850  
    1919 * Boston, MA 02111-1307, USA.
    2020 */
     21
    2122#include "config.h"
    2223#include "CSSCursorImageValue.h"
     
    2425namespace WebCore {
    2526
    26 CSSCursorImageValue::CSSCursorImageValue(const String& url, const IntPoint& p, StyleBase* style)
     27CSSCursorImageValue::CSSCursorImageValue(const String& url, const IntPoint& hotspot, StyleBase* style)
    2728    : CSSImageValue(url, style)
    28     , m_hotspot(p)
     29    , m_hotspot(hotspot)
    2930{
    3031}
     
    3334{
    3435}
    35 }
     36
     37} // namespace WebCore
  • trunk/WebCore/css/CSSCursorImageValue.h

    r16549 r18850  
    2020 */
    2121
    22 #ifndef CSSCursorImageValue_H
    23 #define CSSCursorImageValue_H
     22#ifndef CSSCursorImageValue_h
     23#define CSSCursorImageValue_h
    2424
     25#include "CSSImageValue.h"
    2526#include "IntPoint.h"
    26 #include "CSSImageValue.h"
    2727
    2828namespace WebCore {
    2929
    30 class CSSCursorImageValue : public CSSImageValue
    31 {
     30class CSSCursorImageValue : public CSSImageValue {
    3231public:
    33     CSSCursorImageValue(const String& url, const IntPoint&, StyleBase*);
     32    CSSCursorImageValue(const String& url, const IntPoint& hotspot, StyleBase*);
    3433    virtual ~CSSCursorImageValue();
    3534
     
    3938    IntPoint m_hotspot;
    4039};
    41 } // namespace
    4240
    43 #endif
     41} // namespace WebCore
     42
     43#endif // CSSCursorImageValue_h
  • trunk/WebCore/css/CSSGrammar.y

    r17730 r18850  
    66 *  Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
    77 *  Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
    8  * 
     8 *
    99 *  This library is free software; you can redistribute it and/or
    1010 *  modify it under the terms of the GNU Lesser General Public
     
    7676            tagStr = prop.ascii();
    7777        }
    78        
     78
    7979        // Honor the use of old-style opacity (for Safari 1.1).
    8080        if (prop == "-webkit-opacity") {
     
    9292}
    9393
    94 }
     94} // namespace WebCore
    9595
    9696static inline int getValueID(const char* tagStr, int len)
     
    110110    }
    111111
    112     const struct css_value *val = findValue(tagStr, len);
     112    const struct css_value* val = findValue(tagStr, len);
    113113    if (!val)
    114114        return 0;
     
    153153%{
    154154
    155 static inline int cssyyerror(const char *) { return 1; }
    156 static int cssyylex(YYSTYPE *yylval) { return CSSParser::current()->lex(yylval); }
     155static inline int cssyyerror(const char*) { return 1; }
     156static int cssyylex(YYSTYPE* yylval) { return CSSParser::current()->lex(yylval); }
    157157
    158158%}
     
    318318webkit_value:
    319319    WEBKIT_VALUE_SYM '{' maybe_space expr '}' {
    320         CSSParser *p = static_cast<CSSParser *>(parser);
     320        CSSParser* p = static_cast<CSSParser*>(parser);
    321321        if ($4) {
    322322            p->valueList = p->sinkFloatingValueList($4);
     
    357357  CHARSET_SYM maybe_space STRING maybe_space ';' {
    358358     CSSParser* p = static_cast<CSSParser*>(parser);
    359      $$ = static_cast<CSSParser *>(parser)->createCharsetRule($3);
     359     $$ = static_cast<CSSParser*>(parser)->createCharsetRule($3);
    360360     if ($$ && p->styleElement && p->styleElement->isCSSStyleSheet())
    361361         p->styleElement->append($$);
     
    402402import:
    403403    IMPORT_SYM maybe_space string_or_uri maybe_space maybe_media_list ';' {
    404         $$ = static_cast<CSSParser *>(parser)->createImportRule($3, $5);
     404        $$ = static_cast<CSSParser*>(parser)->createImportRule($3, $5);
    405405    }
    406406  | IMPORT_SYM error invalid_block {
     
    414414namespace:
    415415NAMESPACE_SYM maybe_space maybe_ns_prefix string_or_uri maybe_space ';' {
    416     CSSParser *p = static_cast<CSSParser *>(parser);
     416    CSSParser* p = static_cast<CSSParser*>(parser);
    417417    if (p->styleElement && p->styleElement->isCSSStyleSheet())
    418418        static_cast<CSSStyleSheet*>(p->styleElement)->addNamespace(p, atomicString($3), atomicString($4));
     
    604604            $$ = $1;
    605605            $$->append(p->sinkFloatingSelector($4));
    606         } else {
     606        } else
    607607            $$ = 0;
    608         }
    609608    }
    610609  | selector_list error {
     
    619618    | selector combinator simple_selector {
    620619        $$ = $3;
    621         if (!$1) {
     620        if (!$1)
    622621            $$ = 0;
    623         }
    624622        else if ($$) {
    625623            CSSParser* p = static_cast<CSSParser*>(parser);
    626624            CSSSelector* end = $$;
    627             while (end->tagHistory)
    628                 end = end->tagHistory;
     625            while (end->m_tagHistory)
     626                end = end->m_tagHistory;
    629627            end->m_relation = $2;
    630             end->tagHistory = p->sinkFloatingSelector($1);
     628            end->m_tagHistory = p->sinkFloatingSelector($1);
    631629            if ($2 == CSSSelector::Descendant || $2 == CSSSelector::Child) {
    632630                if (Document* doc = p->document())
     
    651649simple_selector:
    652650    element_name maybe_space {
    653         CSSParser *p = static_cast<CSSParser *>(parser);
     651        CSSParser* p = static_cast<CSSParser*>(parser);
    654652        $$ = p->createFloatingSelector();
    655         $$->tag = QualifiedName(nullAtom, atomicString($1), p->defaultNamespace);
     653        $$->m_tag = QualifiedName(nullAtom, atomicString($1), p->defaultNamespace);
    656654    }
    657655    | element_name specifier_list maybe_space {
    658656        $$ = $2;
    659657        if ($$) {
    660             CSSParser *p = static_cast<CSSParser *>(parser);
    661             $$->tag = QualifiedName(nullAtom, atomicString($1), p->defaultNamespace);
     658            CSSParser* p = static_cast<CSSParser*>(parser);
     659            $$->m_tag = QualifiedName(nullAtom, atomicString($1), p->defaultNamespace);
    662660        }
    663661    }
    664662    | specifier_list maybe_space {
    665663        $$ = $1;
    666         CSSParser *p = static_cast<CSSParser *>(parser);
     664        CSSParser* p = static_cast<CSSParser*>(parser);
    667665        if ($$ && p->defaultNamespace != starAtom)
    668             $$->tag = QualifiedName(nullAtom, starAtom, p->defaultNamespace);
     666            $$->m_tag = QualifiedName(nullAtom, starAtom, p->defaultNamespace);
    669667    }
    670668    | namespace_selector element_name maybe_space {
    671669        AtomicString namespacePrefix = atomicString($1);
    672         CSSParser *p = static_cast<CSSParser *>(parser);
     670        CSSParser* p = static_cast<CSSParser*>(parser);
    673671        $$ = p->createFloatingSelector();
    674672        if (p->styleElement && p->styleElement->isCSSStyleSheet())
    675             $$->tag = QualifiedName(namespacePrefix,
     673            $$->m_tag = QualifiedName(namespacePrefix,
    676674                                    atomicString($2),
    677675                                    static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
    678676        else // FIXME: Shouldn't this case be an error?
    679             $$->tag = QualifiedName(nullAtom, atomicString($2), p->defaultNamespace);
     677            $$->m_tag = QualifiedName(nullAtom, atomicString($2), p->defaultNamespace);
    680678    }
    681679    | namespace_selector element_name specifier_list maybe_space {
     
    683681        if ($$) {
    684682            AtomicString namespacePrefix = atomicString($1);
    685             CSSParser *p = static_cast<CSSParser *>(parser);
     683            CSSParser* p = static_cast<CSSParser*>(parser);
    686684            if (p->styleElement && p->styleElement->isCSSStyleSheet())
    687                 $$->tag = QualifiedName(namespacePrefix,
    688                                         atomicString($2),
    689                                         static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
     685                $$->m_tag = QualifiedName(namespacePrefix,
     686                                          atomicString($2),
     687                                          static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
    690688            else // FIXME: Shouldn't this case be an error?
    691                 $$->tag = QualifiedName(nullAtom, atomicString($2), p->defaultNamespace);
     689                $$->m_tag = QualifiedName(nullAtom, atomicString($2), p->defaultNamespace);
    692690        }
    693691    }
     
    696694        if ($$) {
    697695            AtomicString namespacePrefix = atomicString($1);
    698             CSSParser *p = static_cast<CSSParser *>(parser);
     696            CSSParser* p = static_cast<CSSParser*>(parser);
    699697            if (p->styleElement && p->styleElement->isCSSStyleSheet())
    700                 $$->tag = QualifiedName(namespacePrefix,
    701                                         starAtom,
    702                                         static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
     698                $$->m_tag = QualifiedName(namespacePrefix,
     699                                          starAtom,
     700                                          static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
    703701        }
    704702    }
     
    708706    IDENT {
    709707        ParseString& str = $1;
    710         CSSParser *p = static_cast<CSSParser *>(parser);
    711         Document *doc = p->document();
     708        CSSParser* p = static_cast<CSSParser*>(parser);
     709        Document* doc = p->document();
    712710        if (doc && doc->isHTMLDocument())
    713711            str.lower();
     
    730728            CSSParser* p = static_cast<CSSParser*>(parser);
    731729            CSSSelector* end = $1;
    732             while (end->tagHistory)
    733                 end = end->tagHistory;
     730            while (end->m_tagHistory)
     731                end = end->m_tagHistory;
    734732            end->m_relation = CSSSelector::SubSelector;
    735             end->tagHistory = p->sinkFloatingSelector($2);
     733            end->m_tagHistory = p->sinkFloatingSelector($2);
    736734        }
    737735    }
     
    743741specifier:
    744742    HASH {
    745         CSSParser *p = static_cast<CSSParser *>(parser);
     743        CSSParser* p = static_cast<CSSParser*>(parser);
    746744        $$ = p->createFloatingSelector();
    747         $$->match = CSSSelector::Id;
     745        $$->m_match = CSSSelector::Id;
    748746        if (!p->strict)
    749747            $1.lower();
    750         $$->attr = idAttr;
    751         $$->value = atomicString($1);
     748        $$->m_attr = idAttr;
     749        $$->m_value = atomicString($1);
    752750    }
    753751  | class
     
    758756class:
    759757    '.' IDENT {
    760         CSSParser *p = static_cast<CSSParser *>(parser);
     758        CSSParser* p = static_cast<CSSParser*>(parser);
    761759        $$ = p->createFloatingSelector();
    762         $$->match = CSSSelector::Class;
     760        $$->m_match = CSSSelector::Class;
    763761        if (!p->strict)
    764762            $2.lower();
    765         $$->attr = classAttr;
    766         $$->value = atomicString($2);
     763        $$->m_attr = classAttr;
     764        $$->m_value = atomicString($2);
    767765    }
    768766  ;
     
    771769    IDENT maybe_space {
    772770        ParseString& str = $1;
    773         CSSParser *p = static_cast<CSSParser *>(parser);
    774         Document *doc = p->document();
     771        CSSParser* p = static_cast<CSSParser*>(parser);
     772        Document* doc = p->document();
    775773        if (doc && doc->isHTMLDocument())
    776774            str.lower();
     
    782780    '[' maybe_space attr_name ']' {
    783781        $$ = static_cast<CSSParser*>(parser)->createFloatingSelector();
    784         $$->attr = QualifiedName(nullAtom, atomicString($3), nullAtom);
    785         $$->match = CSSSelector::Set;
     782        $$->m_attr = QualifiedName(nullAtom, atomicString($3), nullAtom);
     783        $$->m_match = CSSSelector::Set;
    786784    }
    787785    | '[' maybe_space attr_name match maybe_space ident_or_string maybe_space ']' {
    788786        $$ = static_cast<CSSParser*>(parser)->createFloatingSelector();
    789         $$->attr = QualifiedName(nullAtom, atomicString($3), nullAtom);
    790         $$->match = (CSSSelector::Match)$4;
    791         $$->value = atomicString($6);
     787        $$->m_attr = QualifiedName(nullAtom, atomicString($3), nullAtom);
     788        $$->m_match = (CSSSelector::Match)$4;
     789        $$->m_value = atomicString($6);
    792790    }
    793791    | '[' maybe_space namespace_selector attr_name ']' {
    794792        AtomicString namespacePrefix = atomicString($3);
    795         CSSParser *p = static_cast<CSSParser *>(parser);
     793        CSSParser* p = static_cast<CSSParser*>(parser);
    796794        $$ = p->createFloatingSelector();
    797         $$->attr = QualifiedName(namespacePrefix,
    798                                  atomicString($4),
    799                                  static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
    800         $$->match = CSSSelector::Set;
     795        $$->m_attr = QualifiedName(namespacePrefix,
     796                                   atomicString($4),
     797                                   static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
     798        $$->m_match = CSSSelector::Set;
    801799    }
    802800    | '[' maybe_space namespace_selector attr_name match maybe_space ident_or_string maybe_space ']' {
    803801        AtomicString namespacePrefix = atomicString($3);
    804         CSSParser *p = static_cast<CSSParser *>(parser);
     802        CSSParser* p = static_cast<CSSParser*>(parser);
    805803        $$ = p->createFloatingSelector();
    806         $$->attr = QualifiedName(namespacePrefix,
    807                                  atomicString($4),
    808                                  static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
    809         $$->match = (CSSSelector::Match)$5;
    810         $$->value = atomicString($7);
     804        $$->m_attr = QualifiedName(namespacePrefix,
     805                                   atomicString($4),
     806                                   static_cast<CSSStyleSheet*>(p->styleElement)->determineNamespace(namespacePrefix));
     807        $$->m_match = (CSSSelector::Match)$5;
     808        $$->m_value = atomicString($7);
    811809    }
    812810  ;
     
    841839    ':' IDENT {
    842840        $$ = static_cast<CSSParser*>(parser)->createFloatingSelector();
    843         $$->match = CSSSelector::PseudoClass;
     841        $$->m_match = CSSSelector::PseudoClass;
    844842        $2.lower();
    845         $$->value = atomicString($2);
    846         if ($$->value == "empty" || $$->value == "only-child" ||
    847             $$->value == "first-child" || $$->value == "last-child") {
    848             CSSParser *p = static_cast<CSSParser *>(parser);
    849             Document *doc = p->document();
     843        $$->m_value = atomicString($2);
     844        if ($$->m_value == "empty" || $$->m_value == "only-child" ||
     845            $$->m_value == "first-child" || $$->m_value == "last-child") {
     846            CSSParser* p = static_cast<CSSParser*>(parser);
     847            Document* doc = p->document();
    850848            if (doc)
    851849                doc->setUsesSiblingRules(true);
     
    854852    | ':' ':' IDENT {
    855853        $$ = static_cast<CSSParser*>(parser)->createFloatingSelector();
    856         $$->match = CSSSelector::PseudoElement;
     854        $$->m_match = CSSSelector::PseudoElement;
    857855        $3.lower();
    858         $$->value = atomicString($3);
     856        $$->m_value = atomicString($3);
    859857    }
    860858    // used by :lang
    861859    | ':' FUNCTION IDENT ')' {
    862860        $$ = static_cast<CSSParser*>(parser)->createFloatingSelector();
    863         $$->match = CSSSelector::PseudoClass;
    864         $$->argument = atomicString($3);
     861        $$->m_match = CSSSelector::PseudoClass;
     862        $$->m_argument = atomicString($3);
    865863        $2.lower();
    866         $$->value = atomicString($2);
     864        $$->m_value = atomicString($2);
    867865    }
    868866    // used by :not
     
    870868        CSSParser* p = static_cast<CSSParser*>(parser);
    871869        $$ = p->createFloatingSelector();
    872         $$->match = CSSSelector::PseudoClass;
    873         $$->simpleSelector = p->sinkFloatingSelector($4);
     870        $$->m_match = CSSSelector::PseudoClass;
     871        $$->m_simpleSelector = p->sinkFloatingSelector($4);
    874872        $2.lower();
    875         $$->value = atomicString($2);
     873        $$->m_value = atomicString($2);
    876874    }
    877875  ;
     
    915913    | decl_list declaration ';' maybe_space {
    916914        $$ = $1;
    917         if ( $2 )
     915        if ($2)
    918916            $$ = $2;
    919917    }
     
    929927    property ':' maybe_space expr prio {
    930928        $$ = false;
    931         CSSParser *p = static_cast<CSSParser *>(parser);
     929        CSSParser* p = static_cast<CSSParser*>(parser);
    932930        if ($1 && $4) {
    933931            p->valueList = p->sinkFloatingValueList($4);
     
    10401038  | hexcolor { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_RGBCOLOR; }
    10411039  | '#' maybe_space { $$.id = 0; $$.string = ParseString(); $$.unit = CSSPrimitiveValue::CSS_RGBCOLOR; } /* Handle error case: "color: #;" */
    1042 /* ### according to the specs a function can have a unary_operator in front. I know no case where this makes sense */
     1040/* FIXME: according to the specs a function can have a unary_operator in front. I know no case where this makes sense */
    10431041  | function {
    10441042      $$ = $1;
  • trunk/WebCore/css/CSSImageValue.cpp

    r17131 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSImageValue.h"
    2425
     26#include "CSSValueKeywords.h"
    2527#include "Cache.h"
    2628#include "CachedImage.h"
    27 #include "CSSValueKeywords.h"
    2829#include "DocLoader.h"
    2930
     
    6869}
    6970
    70 }
     71} // namespace WebCore
  • trunk/WebCore/css/CSSImageValue.h

    r15269 r18850  
    2121 */
    2222
    23 #ifndef CSSImageValue_H
    24 #define CSSImageValue_H
     23#ifndef CSSImageValue_h
     24#define CSSImageValue_h
    2525
    2626#include "CSSPrimitiveValue.h"
     
    3131class DocLoader;
    3232
    33 class CSSImageValue : public CSSPrimitiveValue, public CachedResourceClient
    34 {
     33class CSSImageValue : public CSSPrimitiveValue, public CachedResourceClient {
    3534public:
    3635    CSSImageValue();
     
    4544};
    4645
    47 } // namespace
     46} // namespace WebCore
    4847
    49 #endif
     48#endif // CSSImageValue_h
  • trunk/WebCore/css/CSSInheritedValue.cpp

    r14408 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSInheritedValue.h"
     
    3738}
    3839
    39 }
     40} // namespace WebCore
  • trunk/WebCore/css/CSSInheritedValue.h

    r14407 r18850  
    2121 */
    2222
    23 #ifndef CSSInheritedValue_H
    24 #define CSSInheritedValue_H
     23#ifndef CSSInheritedValue_h
     24#define CSSInheritedValue_h
    2525
    2626#include "CSSValue.h"
     
    2828namespace WebCore {
    2929
    30 class CSSInheritedValue : public CSSValue
    31 {
     30class CSSInheritedValue : public CSSValue {
    3231public:
    3332    virtual unsigned short cssValueType() const;
     
    3534};
    3635
    37 } // namespace
     36} // namespace WebCore
    3837
    39 #endif
     38#endif // CSSInheritedValue_h
  • trunk/WebCore/css/CSSInitialValue.cpp

    r14408 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSInitialValue.h"
     
    3738}
    3839
    39 }
     40} // namespace WebCore
  • trunk/WebCore/css/CSSInitialValue.h

    r14407 r18850  
    2121 */
    2222
    23 #ifndef CSSInitialValue_H
    24 #define CSSInitialValue_H
     23#ifndef CSSInitialValue_h
     24#define CSSInitialValue_h
    2525
    2626#include "CSSValue.h"
     
    2828namespace WebCore {
    2929
    30 class CSSInitialValue : public CSSValue
    31 {
     30class CSSInitialValue : public CSSValue {
    3231public:
    3332    virtual unsigned short cssValueType() const;
     
    3534};
    3635
    37 } // namespace
     36} // namespace WebCore
    3837
    39 #endif
     38#endif // CSSInitialValue_h
  • trunk/WebCore/css/CSSMutableStyleDeclaration.cpp

    r18815 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSMutableStyleDeclaration.h"
     
    5758}
    5859
    59 CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const CSSProperty * const *properties, int numProperties)
     60CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const CSSProperty* const * properties, int numProperties)
    6061    : CSSStyleDeclaration(parent)
    6162    , m_node(0)
     
    6667}
    6768
    68 CSSMutableStyleDeclaration& CSSMutableStyleDeclaration::operator=(const CSSMutableStyleDeclaration& o)
     69CSSMutableStyleDeclaration& CSSMutableStyleDeclaration::operator=(const CSSMutableStyleDeclaration& other)
    6970{
    7071    // don't attach it to the same node, just leave the current m_node value
    71     m_values = o.m_values;
     72    m_values = other.m_values;
    7273    return *this;
    7374}
     
    8081
    8182    // Shorthand and 4-values properties
    82     switch ( propertyID ) {
    83     case CSS_PROP_BACKGROUND_POSITION:
    84     {
    85         // ## Is this correct? The code in cssparser.cpp is confusing
    86         const int properties[2] = { CSS_PROP_BACKGROUND_POSITION_X,
    87                                     CSS_PROP_BACKGROUND_POSITION_Y };
    88         return getShortHandValue( properties, 2 );
    89     }
    90     case CSS_PROP_BACKGROUND:
    91     {
    92         const int properties[5] = { CSS_PROP_BACKGROUND_IMAGE, CSS_PROP_BACKGROUND_REPEAT,
    93                                     CSS_PROP_BACKGROUND_ATTACHMENT, CSS_PROP_BACKGROUND_POSITION,
    94                                     CSS_PROP_BACKGROUND_COLOR };
    95         return getShortHandValue( properties, 5 );
    96     }
    97     case CSS_PROP_BORDER:
    98     {
    99         const int properties[3] = { CSS_PROP_BORDER_WIDTH, CSS_PROP_BORDER_STYLE,
    100                                     CSS_PROP_BORDER_COLOR };
    101         return getShortHandValue( properties, 3 );
    102     }
    103     case CSS_PROP_BORDER_TOP:
    104     {
    105         const int properties[3] = { CSS_PROP_BORDER_TOP_WIDTH, CSS_PROP_BORDER_TOP_STYLE,
    106                                     CSS_PROP_BORDER_TOP_COLOR};
    107         return getShortHandValue( properties, 3 );
    108     }
    109     case CSS_PROP_BORDER_RIGHT:
    110     {
    111         const int properties[3] = { CSS_PROP_BORDER_RIGHT_WIDTH, CSS_PROP_BORDER_RIGHT_STYLE,
    112                                     CSS_PROP_BORDER_RIGHT_COLOR};
    113         return getShortHandValue( properties, 3 );
    114     }
    115     case CSS_PROP_BORDER_BOTTOM:
    116     {
    117         const int properties[3] = { CSS_PROP_BORDER_BOTTOM_WIDTH, CSS_PROP_BORDER_BOTTOM_STYLE,
    118                                     CSS_PROP_BORDER_BOTTOM_COLOR};
    119         return getShortHandValue( properties, 3 );
    120     }
    121     case CSS_PROP_BORDER_LEFT:
    122     {
    123         const int properties[3] = { CSS_PROP_BORDER_LEFT_WIDTH, CSS_PROP_BORDER_LEFT_STYLE,
    124                                     CSS_PROP_BORDER_LEFT_COLOR};
    125         return getShortHandValue( properties, 3 );
    126     }
    127     case CSS_PROP_OUTLINE:
    128     {
    129         const int properties[3] = { CSS_PROP_OUTLINE_WIDTH, CSS_PROP_OUTLINE_STYLE,
    130                                     CSS_PROP_OUTLINE_COLOR };
    131         return getShortHandValue( properties, 3 );
    132     }
    133     case CSS_PROP_BORDER_COLOR:
    134     {
    135         const int properties[4] = { CSS_PROP_BORDER_TOP_COLOR, CSS_PROP_BORDER_RIGHT_COLOR,
    136                                     CSS_PROP_BORDER_BOTTOM_COLOR, CSS_PROP_BORDER_LEFT_COLOR };
    137         return get4Values( properties );
    138     }
    139     case CSS_PROP_BORDER_WIDTH:
    140     {
    141         const int properties[4] = { CSS_PROP_BORDER_TOP_WIDTH, CSS_PROP_BORDER_RIGHT_WIDTH,
    142                                     CSS_PROP_BORDER_BOTTOM_WIDTH, CSS_PROP_BORDER_LEFT_WIDTH };
    143         return get4Values( properties );
    144     }
    145     case CSS_PROP_BORDER_STYLE:
    146     {
    147         const int properties[4] = { CSS_PROP_BORDER_TOP_STYLE, CSS_PROP_BORDER_RIGHT_STYLE,
    148                                     CSS_PROP_BORDER_BOTTOM_STYLE, CSS_PROP_BORDER_LEFT_STYLE };
    149         return get4Values( properties );
    150     }
    151     case CSS_PROP_MARGIN:
    152     {
    153         const int properties[4] = { CSS_PROP_MARGIN_TOP, CSS_PROP_MARGIN_RIGHT,
    154                                     CSS_PROP_MARGIN_BOTTOM, CSS_PROP_MARGIN_LEFT };
    155         return get4Values( properties );
    156     }
    157     case CSS_PROP_PADDING:
    158     {
    159         const int properties[4] = { CSS_PROP_PADDING_TOP, CSS_PROP_PADDING_RIGHT,
    160                                     CSS_PROP_PADDING_BOTTOM, CSS_PROP_PADDING_LEFT };
    161         return get4Values( properties );
    162     }
    163     case CSS_PROP_LIST_STYLE:
    164     {
    165         const int properties[3] = { CSS_PROP_LIST_STYLE_TYPE, CSS_PROP_LIST_STYLE_POSITION,
    166                                     CSS_PROP_LIST_STYLE_IMAGE };
    167         return getShortHandValue( properties, 3 );
    168     }
     83    switch (propertyID) {
     84        case CSS_PROP_BACKGROUND_POSITION: {
     85            // FIXME: Is this correct? The code in cssparser.cpp is confusing
     86            const int properties[2] = { CSS_PROP_BACKGROUND_POSITION_X,
     87                                        CSS_PROP_BACKGROUND_POSITION_Y };
     88            return getShorthandValue(properties, 2);
     89        }
     90        case CSS_PROP_BACKGROUND: {
     91            const int properties[5] = { CSS_PROP_BACKGROUND_IMAGE, CSS_PROP_BACKGROUND_REPEAT,
     92                                        CSS_PROP_BACKGROUND_ATTACHMENT, CSS_PROP_BACKGROUND_POSITION,
     93                                        CSS_PROP_BACKGROUND_COLOR };
     94            return getShorthandValue(properties, 5);
     95        }
     96        case CSS_PROP_BORDER: {
     97            const int properties[3] = { CSS_PROP_BORDER_WIDTH, CSS_PROP_BORDER_STYLE,
     98                                        CSS_PROP_BORDER_COLOR };
     99            return getShorthandValue(properties, 3);
     100        }
     101        case CSS_PROP_BORDER_TOP: {
     102            const int properties[3] = { CSS_PROP_BORDER_TOP_WIDTH, CSS_PROP_BORDER_TOP_STYLE,
     103                                        CSS_PROP_BORDER_TOP_COLOR};
     104            return getShorthandValue(properties, 3);
     105        }
     106        case CSS_PROP_BORDER_RIGHT: {
     107            const int properties[3] = { CSS_PROP_BORDER_RIGHT_WIDTH, CSS_PROP_BORDER_RIGHT_STYLE,
     108                                        CSS_PROP_BORDER_RIGHT_COLOR};
     109            return getShorthandValue(properties, 3);
     110        }
     111        case CSS_PROP_BORDER_BOTTOM: {
     112            const int properties[3] = { CSS_PROP_BORDER_BOTTOM_WIDTH, CSS_PROP_BORDER_BOTTOM_STYLE,
     113                                        CSS_PROP_BORDER_BOTTOM_COLOR};
     114            return getShorthandValue(properties, 3);
     115        }
     116        case CSS_PROP_BORDER_LEFT: {
     117            const int properties[3] = { CSS_PROP_BORDER_LEFT_WIDTH, CSS_PROP_BORDER_LEFT_STYLE,
     118                                        CSS_PROP_BORDER_LEFT_COLOR};
     119            return getShorthandValue(properties, 3);
     120        }
     121        case CSS_PROP_OUTLINE: {
     122            const int properties[3] = { CSS_PROP_OUTLINE_WIDTH, CSS_PROP_OUTLINE_STYLE,
     123                                        CSS_PROP_OUTLINE_COLOR };
     124            return getShorthandValue(properties, 3);
     125        }
     126        case CSS_PROP_BORDER_COLOR: {
     127            const int properties[4] = { CSS_PROP_BORDER_TOP_COLOR, CSS_PROP_BORDER_RIGHT_COLOR,
     128                                        CSS_PROP_BORDER_BOTTOM_COLOR, CSS_PROP_BORDER_LEFT_COLOR };
     129            return get4Values(properties);
     130        }
     131        case CSS_PROP_BORDER_WIDTH: {
     132            const int properties[4] = { CSS_PROP_BORDER_TOP_WIDTH, CSS_PROP_BORDER_RIGHT_WIDTH,
     133                                        CSS_PROP_BORDER_BOTTOM_WIDTH, CSS_PROP_BORDER_LEFT_WIDTH };
     134            return get4Values(properties);
     135        }
     136        case CSS_PROP_BORDER_STYLE: {
     137            const int properties[4] = { CSS_PROP_BORDER_TOP_STYLE, CSS_PROP_BORDER_RIGHT_STYLE,
     138                                        CSS_PROP_BORDER_BOTTOM_STYLE, CSS_PROP_BORDER_LEFT_STYLE };
     139            return get4Values(properties);
     140        }
     141        case CSS_PROP_MARGIN: {
     142            const int properties[4] = { CSS_PROP_MARGIN_TOP, CSS_PROP_MARGIN_RIGHT,
     143                                        CSS_PROP_MARGIN_BOTTOM, CSS_PROP_MARGIN_LEFT };
     144            return get4Values(properties);
     145        }
     146        case CSS_PROP_PADDING: {
     147            const int properties[4] = { CSS_PROP_PADDING_TOP, CSS_PROP_PADDING_RIGHT,
     148                                        CSS_PROP_PADDING_BOTTOM, CSS_PROP_PADDING_LEFT };
     149            return get4Values(properties);
     150        }
     151        case CSS_PROP_LIST_STYLE: {
     152            const int properties[3] = { CSS_PROP_LIST_STYLE_TYPE, CSS_PROP_LIST_STYLE_POSITION,
     153                                        CSS_PROP_LIST_STYLE_IMAGE };
     154            return getShorthandValue(properties, 3);
     155        }
    169156    }
    170157    return String();
     
    177164        if (!isPropertyImplicit(properties[i])) {
    178165            RefPtr<CSSValue> value = getPropertyCSSValue(properties[i]);
    179             if (!value) // apparently all 4 properties must be specified.
     166
     167            // apparently all 4 properties must be specified.
     168            if (!value)
    180169                return String();
     170
    181171            if (!res.isNull())
    182172                res += " ";
     
    187177}
    188178
    189 String CSSMutableStyleDeclaration::getShortHandValue( const int* properties, int number ) const
     179String CSSMutableStyleDeclaration::getShorthandValue(const int* properties, int number) const
    190180{
    191181    String res;
     
    193183        if (!isPropertyImplicit(properties[i])) {
    194184            RefPtr<CSSValue> value = getPropertyCSSValue(properties[i]);
    195             if (value) { // TODO provide default value if !value
     185            // FIXME: provide default value if !value
     186            if (value) {
    196187                if (!res.isNull())
    197188                    res += " ";
     
    206197{
    207198    DeprecatedValueListConstIterator<CSSProperty> end;
    208     for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.fromLast(); it != end; --it)
     199    for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.fromLast(); it != end; --it) {
    209200        if (propertyID == (*it).m_id)
    210201            return (*it).value();
     202    }
    211203    return 0;
    212204}
     
    383375
    384376    DeprecatedValueListIterator<CSSProperty> end;
    385     for (DeprecatedValueListIterator<CSSProperty> it = m_values.fromLast(); it != end; --it)
     377    for (DeprecatedValueListIterator<CSSProperty> it = m_values.fromLast(); it != end; --it) {
    386378        if (propertyID == (*it).m_id) {
    387379            value = (*it).value()->cssText();
     
    391383            break;
    392384        }
     385    }
    393386
    394387    return value;
     
    413406    }
    414407
    415     // ### quick&dirty hack for KDE 3.0... make this MUCH better! (Dirk)
     408    // FIXME: quick&dirty hack for KDE 3.0... make this MUCH better! (Dirk)
    416409    StyleBase* root = this;
    417     while (StyleBase *parent = root->parent())
     410    while (StyleBase* parent = root->parent())
    418411        root = parent;
    419412    if (root->isCSSStyleSheet())
     
    424417{
    425418    DeprecatedValueListConstIterator<CSSProperty> end;
    426     for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.begin(); it != end; ++it)
     419    for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.begin(); it != end; ++it) {
    427420        if (propertyID == (*it).id())
    428421            return (*it).isImportant();
     422    }
    429423    return false;
    430424}
     
    433427{
    434428    DeprecatedValueListConstIterator<CSSProperty> end;
    435     for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.begin(); it != end; ++it)
     429    for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.begin(); it != end; ++it) {
    436430        if (propertyID == (*it).id())
    437431            return (*it).shorthandID();
     432    }
    438433    return false;
    439434}
     
    442437{
    443438    DeprecatedValueListConstIterator<CSSProperty> end;
    444     for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.begin(); it != end; ++it)
     439    for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.begin(); it != end; ++it) {
    445440        if (propertyID == (*it).id())
    446441            return (*it).isImplicit();
     442    }
    447443    return false;
    448444}
    449445
    450 void CSSMutableStyleDeclaration::setProperty(int propertyID, const String &value, bool important, ExceptionCode& ec)
     446void CSSMutableStyleDeclaration::setProperty(int propertyID, const String& value, bool important, ExceptionCode& ec)
    451447{
    452448    setProperty(propertyID, value, important, true, ec);
     
    458454}
    459455
    460 bool CSSMutableStyleDeclaration::setProperty(int propertyID, const String &value, bool important, bool notifyChanged, ExceptionCode& ec)
     456bool CSSMutableStyleDeclaration::setProperty(int propertyID, const String& value, bool important, bool notifyChanged, ExceptionCode& ec)
    461457{
    462458    ec = 0;
     
    498494}
    499495
    500 void CSSMutableStyleDeclaration::setImageProperty(int propertyId, const String &URL, bool important)
     496void CSSMutableStyleDeclaration::setImageProperty(int propertyId, const String& url, bool important)
    501497{
    502498    removeProperty(propertyId);
    503     m_values.append(CSSProperty(propertyId, new CSSImageValue(URL, this), important));
     499    m_values.append(CSSProperty(propertyId, new CSSImageValue(url, this), important));
    504500    setChanged();
    505501}
    506502
    507 void CSSMutableStyleDeclaration::parseDeclaration(const String &styleDeclaration)
     503void CSSMutableStyleDeclaration::parseDeclaration(const String& styleDeclaration)
    508504{
    509505    m_values.clear();
     
    513509}
    514510
    515 void CSSMutableStyleDeclaration::addParsedProperties(const CSSProperty * const *properties, int numProperties)
     511void CSSMutableStyleDeclaration::addParsedProperties(const CSSProperty * const * properties, int numProperties)
    516512{
    517513    for (int i = 0; i < numProperties; ++i) {
     
    523519}
    524520
    525 void CSSMutableStyleDeclaration::setLengthProperty(int id, const String &value, bool important, bool /* multiLength*/)
     521void CSSMutableStyleDeclaration::setLengthProperty(int propertyId, const String& value, bool important, bool /*multiLength*/)
    526522{
    527523    bool parseMode = useStrictParsing();
    528524    setStrictParsing(false);
    529     setProperty(id, value, important);
     525    setProperty(propertyId, value, important);
    530526    setStrictParsing(parseMode);
    531527}
     
    546542{
    547543    String result = "";
    548    
     544
    549545    DeprecatedValueListConstIterator<CSSProperty> end;
    550546    for (DeprecatedValueListConstIterator<CSSProperty> it = m_values.begin(); it != end; ++it)
     
    564560}
    565561
    566 void CSSMutableStyleDeclaration::merge(CSSMutableStyleDeclaration *other, bool argOverridesOnConflict)
     562void CSSMutableStyleDeclaration::merge(CSSMutableStyleDeclaration* other, bool argOverridesOnConflict)
    567563{
    568564    DeprecatedValueListConstIterator<CSSProperty> end;
    569565    for (DeprecatedValueListConstIterator<CSSProperty> it = other->valuesIterator(); it != end; ++it) {
    570         const CSSProperty &property = *it;
     566        const CSSProperty& property = *it;
    571567        RefPtr<CSSValue> value = getPropertyCSSValue(property.id());
    572568        if (value) {
     
    615611}
    616612
    617 void CSSMutableStyleDeclaration::removePropertiesInSet(const int *set, unsigned length, bool notifyChanged)
     613void CSSMutableStyleDeclaration::removePropertiesInSet(const int* set, unsigned length, bool notifyChanged)
    618614{
    619615    bool changed = false;
     
    639635}
    640636
    641 }
     637} // namespace WebCore
  • trunk/WebCore/css/CSSMutableStyleDeclaration.h

    r18753 r18850  
    2121 */
    2222
    23 #ifndef CSSMutableStyleDeclaration_H
    24 #define CSSMutableStyleDeclaration_H
     23#ifndef CSSMutableStyleDeclaration_h
     24#define CSSMutableStyleDeclaration_h
    2525
    2626#include "CSSStyleDeclaration.h"
    27 #include "CSSPrimitiveValue.h" // for CSSPrimitiveValue::UnitTypes
     27#include "CSSPrimitiveValue.h"
    2828#include "DeprecatedValueList.h"
    2929#include "PlatformString.h"
     
    3434class Node;
    3535
    36 class CSSMutableStyleDeclaration : public CSSStyleDeclaration
    37 {
     36class CSSMutableStyleDeclaration : public CSSStyleDeclaration {
    3837public:
    3938    CSSMutableStyleDeclaration();
    4039    CSSMutableStyleDeclaration(CSSRule* parentRule);
    4140    CSSMutableStyleDeclaration(CSSRule* parentRule, const DeprecatedValueList<CSSProperty>&);
    42     CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty * const *, int numProperties);
     41    CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty* const *, int numProperties);
    4342
    44     CSSMutableStyleDeclaration &operator=(const CSSMutableStyleDeclaration &);
     43    CSSMutableStyleDeclaration& operator=(const CSSMutableStyleDeclaration&);
    4544
    4645    void setNode(Node* node) { m_node = node; }
     
    6968    bool setProperty(int propertyID, const String& value, bool important, bool notifyChanged, ExceptionCode&);
    7069    bool setProperty(int propertyId, const String& value, bool important = false, bool notifyChanged = true)
    71         { ExceptionCode ec; return setProperty(propertyId, value, important, notifyChanged, ec); }
     70    {
     71        ExceptionCode ec;
     72        return setProperty(propertyId, value, important, notifyChanged, ec);
     73    }
    7274
    7375    String removeProperty(int propertyID, bool notifyChanged, ExceptionCode&);
    7476    String removeProperty(int propertyID, bool notifyChanged = true)
    75         { ExceptionCode ec; return removeProperty(propertyID, notifyChanged, ec); }
     77    {
     78        ExceptionCode ec;
     79        return removeProperty(propertyID, notifyChanged, ec);
     80    }
    7681
    7782    void clear();
     
    8287    void setLengthProperty(int propertyId, const String& value, bool important, bool multiLength = false);
    8388    void setStringProperty(int propertyId, const String& value, CSSPrimitiveValue::UnitTypes, bool important = false); // parsed string value
    84     void setImageProperty(int propertyId, const String& URL, bool important = false);
     89    void setImageProperty(int propertyId, const String& url, bool important = false);
    8590 
    8691    // The following parses an entire new style declaration.
     
    8994    // Besides adding the properties, this also removes any existing properties with these IDs.
    9095    // It does no notification since it's called by the parser.
    91     void addParsedProperties(const CSSProperty * const *, int numProperties);
     96    void addParsedProperties(const CSSProperty* const *, int numProperties);
    9297 
    9398    PassRefPtr<CSSMutableStyleDeclaration> copyBlockProperties() const;
     
    96101
    97102    void merge(CSSMutableStyleDeclaration*, bool argOverridesOnConflict = true);
    98  
     103
    99104private:
    100     String getShortHandValue(const int* properties, int number) const;
     105    String getShorthandValue(const int* properties, int number) const;
    101106    String get4Values(const int* properties) const;
    102107 
     
    105110};
    106111
    107 } // namespace
     112} // namespace WebCore
    108113
    109 #endif
     114#endif // CSSMutableStyleDeclaration_h
  • trunk/WebCore/css/CSSNamespace.h

    r14408 r18850  
    2222 */
    2323
    24 #ifndef CSSNamespace_H
    25 #define CSSNamespace_H
     24#ifndef CSSNamespace_h
     25#define CSSNamespace_h
    2626
    2727#include "AtomicString.h"
     
    3434        CSSNamespace* m_parent;
    3535
    36         CSSNamespace(const AtomicString& p, const AtomicString& u, CSSNamespace* parent)
    37             : m_prefix(p)
    38             , m_uri(u)
    39             , m_parent(parent) {}
     36        CSSNamespace(const AtomicString& prefix, const AtomicString& uri, CSSNamespace* parent)
     37            : m_prefix(prefix)
     38            , m_uri(uri)
     39            , m_parent(parent)
     40        {
     41        }
    4042        ~CSSNamespace() { delete m_parent; }
    41        
     43
    4244        const AtomicString& uri() { return m_uri; }
    4345        const AtomicString& prefix() { return m_prefix; }
    44        
     46
    4547        CSSNamespace* namespaceForPrefix(const AtomicString& prefix)
    4648        {
     
    5254        }
    5355    };
    54 }
    5556
    56 #endif
     57} // namespace WebCore
     58
     59#endif // CSSNamespace_h
  • trunk/WebCore/css/CSSPrimitiveValue.cpp

    r17405 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSPrimitiveValue.h"
    2425
     26#include "CSSValueKeywords.h"
    2527#include "Color.h"
    2628#include "Counter.h"
    27 #include "CSSValueKeywords.h"
    2829#include "DashboardRegion.h"
    2930#include "ExceptionCode.h"
    3031#include "Pair.h"
    3132#include "RenderStyle.h"
    32 
    3333#include <ctype.h>
    3434
     
    5151
    5252    // {nmchar}*
    53     for (; p != end; ++p)
     53    for (; p != end; ++p) {
    5454        if (!(p[0] == '_' || p[0] == '-' || isalnum(p[0]) || p[0] >= 128))
    5555            return false;
     56    }
    5657
    5758    return true;
     
    107108
    108109CSSPrimitiveValue::CSSPrimitiveValue()
    109 {
    110     m_type = 0;
     110    : m_type(0)
     111{
    111112}
    112113
    113114CSSPrimitiveValue::CSSPrimitiveValue(int ident)
     115    : m_type(CSS_IDENT)
    114116{
    115117    m_value.ident = ident;
    116     m_type = CSS_IDENT;
    117118}
    118119
    119120CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitTypes type)
     121    : m_type(type)
    120122{
    121123    m_value.num = num;
    122     m_type = type;
    123124}
    124125
    125126CSSPrimitiveValue::CSSPrimitiveValue(const String& str, UnitTypes type)
     127    : m_type(type)
    126128{
    127129    if ((m_value.string = str.impl()))
    128130        m_value.string->ref();
    129     m_type = type;
    130131}
    131132
    132133CSSPrimitiveValue::CSSPrimitiveValue(PassRefPtr<Counter> c)
     134    : m_type(CSS_COUNTER)
    133135{
    134136    m_value.counter = c.releaseRef();
    135     m_type = CSS_COUNTER;
    136137}
    137138
    138139CSSPrimitiveValue::CSSPrimitiveValue(PassRefPtr<RectImpl> r)
     140    : m_type(CSS_RECT)
    139141{
    140142    m_value.rect = r.releaseRef();
    141     m_type = CSS_RECT;
    142143}
    143144
    144145#if PLATFORM(MAC)
    145146CSSPrimitiveValue::CSSPrimitiveValue(PassRefPtr<DashboardRegion> r)
     147    : m_type(CSS_DASHBOARD_REGION)
    146148{
    147149    m_value.region = r.releaseRef();
    148     m_type = CSS_DASHBOARD_REGION;
    149150}
    150151#endif
    151152
    152153CSSPrimitiveValue::CSSPrimitiveValue(RGBA32 color)
     154    : m_type(CSS_RGBCOLOR)
    153155{
    154156    m_value.rgbcolor = color;
    155     m_type = CSS_RGBCOLOR;
    156157}
    157158
    158159CSSPrimitiveValue::CSSPrimitiveValue(PassRefPtr<Pair> p)
     160    : m_type(CSS_PAIR)
    159161{
    160162    m_value.pair = p.releaseRef();
    161     m_type = CSS_PAIR;
    162163}
    163164
     
    169170void CSSPrimitiveValue::cleanup()
    170171{
    171     switch(m_type) {
    172     case CSS_STRING:
    173     case CSS_URI:
    174     case CSS_ATTR:
    175         if (m_value.string)
    176             m_value.string->deref();
    177         break;
    178     case CSS_COUNTER:
    179         m_value.counter->deref();
    180         break;
    181     case CSS_RECT:
    182         m_value.rect->deref();
    183         break;
    184     case CSS_PAIR:
    185         m_value.pair->deref();
    186         break;
     172    switch (m_type) {
     173        case CSS_STRING:
     174        case CSS_URI:
     175        case CSS_ATTR:
     176            if (m_value.string)
     177                m_value.string->deref();
     178            break;
     179        case CSS_COUNTER:
     180            m_value.counter->deref();
     181            break;
     182        case CSS_RECT:
     183            m_value.rect->deref();
     184            break;
     185        case CSS_PAIR:
     186            m_value.pair->deref();
     187            break;
    187188#if PLATFORM(MAC)
    188     case CSS_DASHBOARD_REGION:
    189         if (m_value.region)
    190             m_value.region->deref();
    191         break;
     189        case CSS_DASHBOARD_REGION:
     190            if (m_value.region)
     191                m_value.region->deref();
     192            break;
    192193#endif
    193     default:
    194         break;
     194        default:
     195            break;
    195196    }
    196197
     
    198199}
    199200
    200 int CSSPrimitiveValue::computeLengthInt(RenderStyle *style)
     201int CSSPrimitiveValue::computeLengthInt(RenderStyle* style)
    201202{
    202203    double result = computeLengthFloat(style);
    203    
     204
    204205    // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
    205206    // need to go ahead and round if we're really close to the next integer value.
    206207    result += result < 0 ? -0.01 : +0.01;
    207    
     208
    208209    if (result > INT_MAX || result < INT_MIN)
    209210        return 0;
    210     return (int)result;   
    211 }
    212 
    213 int CSSPrimitiveValue::computeLengthInt(RenderStyle *style, double multiplier)
     211    return static_cast<int>(result);
     212}
     213
     214int CSSPrimitiveValue::computeLengthInt(RenderStyle* style, double multiplier)
    214215{
    215216    double result = multiplier * computeLengthFloat(style);
    216    
     217
    217218    // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
    218219    // need to go ahead and round if we're really close to the next integer value.
    219220    result += result < 0 ? -0.01 : +0.01;
    220    
     221
    221222    if (result > INT_MAX || result < INT_MIN)
    222223        return 0;
    223     return (int)result; 
     224    return static_cast<int>(result);
    224225}
    225226
    226227const int intMaxForLength = 0x7ffffff; // max value for a 28-bit int
    227 const int intMinForLength = (-0x7ffffff-1); // min value for a 28-bit int
     228const int intMinForLength = (-0x7ffffff - 1); // min value for a 28-bit int
    228229
    229230// Lengths expect an int that is only 28-bits, so we have to check for a different overflow.
    230 int CSSPrimitiveValue::computeLengthIntForLength(RenderStyle *style)
     231int CSSPrimitiveValue::computeLengthIntForLength(RenderStyle* style)
    231232{
    232233    double result = computeLengthFloat(style);
    233    
     234
    234235    // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
    235236    // need to go ahead and round if we're really close to the next integer value.
    236237    result += result < 0 ? -0.01 : +0.01;
    237    
     238
    238239    if (result > intMaxForLength || result < intMinForLength)
    239240        return 0;
    240     return (int)result;   
     241    return static_cast<int>(result);
    241242}
    242243
    243244// Lengths expect an int that is only 28-bits, so we have to check for a different overflow.
    244 int CSSPrimitiveValue::computeLengthIntForLength(RenderStyle *style, double multiplier)
     245int CSSPrimitiveValue::computeLengthIntForLength(RenderStyle* style, double multiplier)
    245246{
    246247    double result = multiplier * computeLengthFloat(style);
    247    
     248
    248249    // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
    249250    // need to go ahead and round if we're really close to the next integer value.
    250251    result += result < 0 ? -0.01 : +0.01;
    251    
     252
    252253    if (result > intMaxForLength || result < intMinForLength)
    253254        return 0;
    254     return (int)result; 
    255 }
    256 
    257 short CSSPrimitiveValue::computeLengthShort(RenderStyle *style)
     255    return static_cast<int>(result);
     256}
     257
     258short CSSPrimitiveValue::computeLengthShort(RenderStyle* style)
    258259{
    259260    double result = computeLengthFloat(style);
    260    
     261
    261262    // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
    262263    // need to go ahead and round if we're really close to the next integer value.
    263264    result += result < 0 ? -0.01 : +0.01;
    264    
     265
    265266    if (result > SHRT_MAX || result < SHRT_MIN)
    266267        return 0;
    267     return (short)result;   
    268 }
    269 
    270 short CSSPrimitiveValue::computeLengthShort(RenderStyle *style, double multiplier)
     268    return static_cast<short>(result);
     269}
     270
     271short CSSPrimitiveValue::computeLengthShort(RenderStyle* style, double multiplier)
    271272{
    272273    double result = multiplier * computeLengthFloat(style);
    273    
     274
    274275    // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
    275276    // need to go ahead and round if we're really close to the next integer value.
    276277    result += result < 0 ? -0.01 : +0.01;
    277    
     278
    278279    if (result > SHRT_MAX || result < SHRT_MIN)
    279280        return 0;
    280     return (short)result; 
    281 }
    282 
    283 double CSSPrimitiveValue::computeLengthFloat(RenderStyle *style, bool applyZoomFactor)
     281    return static_cast<short>(result);
     282}
     283
     284double CSSPrimitiveValue::computeLengthFloat(RenderStyle* style, bool applyZoomFactor)
    284285{
    285286    unsigned short type = primitiveType();
     
    288289    // At high DPI, we may scale a CSS pixel, but the ratio of the CSS pixel to the so-called
    289290    // "absolute" CSS length units like inch and pt is always fixed and never changes.
    290     double cssPixelsPerInch = 96.;
    291 
    292     double factor = 1.;
    293     switch(type) {
    294     case CSS_EMS:
    295         factor = applyZoomFactor ?
    296           style->fontDescription().computedSize() :
    297           style->fontDescription().specifiedSize();
    298         break;
    299     case CSS_EXS: {
    300         // FIXME: We have a bug right now where the zoom will be applied multiple times to EX units.
    301         // We really need to compute EX using fontMetrics for the original specifiedSize and not use
    302         // our actual constructed rendering font.
    303         factor = style->font().xHeight();
    304         break;
    305     }
    306     case CSS_PX:
    307         break;
    308     case CSS_CM:
    309         factor = cssPixelsPerInch/2.54; // (2.54 cm/in)
    310         break;
    311     case CSS_MM:
    312         factor = cssPixelsPerInch/25.4;
    313         break;
    314     case CSS_IN:
    315         factor = cssPixelsPerInch;
    316         break;
    317     case CSS_PT:
    318         factor = cssPixelsPerInch/72.;
    319         break;
    320     case CSS_PC:
    321         // 1 pc == 12 pt
    322         factor = cssPixelsPerInch*12./72.;
    323         break;
    324     default:
    325         return -1;
     291    const double cssPixelsPerInch = 96.0;
     292
     293    double factor = 1.0;
     294    switch (type) {
     295        case CSS_EMS:
     296            factor = applyZoomFactor ? style->fontDescription().computedSize() : style->fontDescription().specifiedSize();
     297            break;
     298        case CSS_EXS:
     299            // FIXME: We have a bug right now where the zoom will be applied multiple times to EX units.
     300            // We really need to compute EX using fontMetrics for the original specifiedSize and not use
     301            // our actual constructed rendering font.
     302            factor = style->font().xHeight();
     303            break;
     304        case CSS_PX:
     305            break;
     306        case CSS_CM:
     307            factor = cssPixelsPerInch / 2.54; // (2.54 cm/in)
     308            break;
     309        case CSS_MM:
     310            factor = cssPixelsPerInch / 25.4;
     311            break;
     312        case CSS_IN:
     313            factor = cssPixelsPerInch;
     314            break;
     315        case CSS_PT:
     316            factor = cssPixelsPerInch / 72.0;
     317            break;
     318        case CSS_PC:
     319            // 1 pc == 12 pt
     320            factor = cssPixelsPerInch * 12.0 / 72.0;
     321            break;
     322        default:
     323            return -1.0;
    326324    }
    327325
     
    329327}
    330328
    331 void CSSPrimitiveValue::setFloatValue( unsigned short unitType, double floatValue, ExceptionCode& ec)
     329void CSSPrimitiveValue::setFloatValue(unsigned short unitType, double floatValue, ExceptionCode& ec)
    332330{
    333331    ec = 0;
    334    
    335     // ### check if property supports this type
     332
     333    // FIXME: check if property supports this type
    336334    if (m_type > CSS_DIMENSION) {
    337335        ec = SYNTAX_ERR;
    338336        return;
    339337    }
    340    
     338
    341339    cleanup();
    342340
     
    348346double scaleFactorForConversion(unsigned short unitType)
    349347{
    350     double cssPixelsPerInch = 96.0;
     348    const double cssPixelsPerInch = 96.0;
     349
    351350    double factor = 1.0;
    352    
    353     switch(unitType) {
     351    switch (unitType) {
    354352        case CSSPrimitiveValue::CSS_PX:
    355353            break;
     
    372370            break;
    373371    }
    374    
     372
    375373    return factor;
    376374}
     
    380378    if (unitType == m_type || unitType < CSS_PX || unitType > CSS_PC)
    381379        return m_value.num;
    382    
     380
    383381    double convertedValue = m_value.num;
    384    
     382
    385383    // First convert the value from m_type into CSSPixels
    386384    double factor = scaleFactorForConversion(m_type);
    387385    convertedValue *= factor;
    388    
     386
    389387    // Now convert from CSSPixels to the specified unitType
    390388    factor = scaleFactorForConversion(unitType);
    391389    convertedValue /= factor;
    392    
     390
    393391    return convertedValue;
    394392}
    395393
    396 void CSSPrimitiveValue::setStringValue( unsigned short stringType, const String &stringValue, ExceptionCode& ec)
     394void CSSPrimitiveValue::setStringValue(unsigned short stringType, const String& stringValue, ExceptionCode& ec)
    397395{
    398396    ec = 0;
    399        
     397
    400398    //if(m_type < CSS_STRING) throw DOMException(INVALID_ACCESS_ERR);
    401399    //if(m_type > CSS_ATTR) throw DOMException(INVALID_ACCESS_ERR);
     
    404402        return;
    405403    }
    406    
     404
    407405    cleanup();
    408406
     
    412410        m_type = stringType;
    413411    }
    414     // ### parse ident
     412    // FIXME: parse ident
    415413}
    416414
     
    428426            break;
    429427    }
    430    
     428
    431429    return String();
    432430}
     
    437435}
    438436
    439 bool CSSPrimitiveValue::parseString( const String &/*string*/, bool )
    440 {
    441     // ###
     437bool CSSPrimitiveValue::parseString(const String& /*string*/, bool /*strict*/)
     438{
     439    // FIXME
    442440    return false;
    443441}
     
    445443int CSSPrimitiveValue::getIdent()
    446444{
    447     if(m_type != CSS_IDENT) return 0;
     445    if (m_type != CSS_IDENT)
     446        return 0;
    448447    return m_value.ident;
    449448}
     
    451450String CSSPrimitiveValue::cssText() const
    452451{
    453     // ### return the original value instead of a generated one (e.g. color
     452    // FIXME: return the original value instead of a generated one (e.g. color
    454453    // name if it was specified) - check what spec says about this
    455454    String text;
    456     switch ( m_type ) {
     455    switch (m_type) {
    457456        case CSS_UNKNOWN:
    458             // ###
     457            // FIXME
    459458            break;
    460459        case CSS_NUMBER:
     
    510509            break;
    511510        case CSS_DIMENSION:
    512             // ###
     511            // FIXME
    513512            break;
    514513        case CSS_STRING:
     
    522521            break;
    523522        case CSS_ATTR:
    524             // ###
     523            // FIXME
    525524            break;
    526525        case CSS_COUNTER:
     
    541540        case CSS_RGBCOLOR: {
    542541            Color color(m_value.rgbcolor);
    543             if (color.alpha() < 0xFF)
    544                 text = "rgba(";
    545             else
    546                 text = "rgb(";
     542            text = (color.alpha() < 0xFF) ? "rgba(" : "rgb(";
    547543            text += String::number(color.red()) + ", ";
    548544            text += String::number(color.green()) + ", ";
    549545            text += String::number(color.blue());
    550546            if (color.alpha() < 0xFF)
    551                 text += ", " + String::number((float)color.alpha() / 0xFF);
     547                text += ", " + String::number(static_cast<float>(color.alpha()) / 0xFF);
    552548            text += ")";
    553549            break;
     
    581577}
    582578
    583 }
     579} // namespace WebCore
  • trunk/WebCore/css/CSSPrimitiveValue.h

    r17405 r18850  
    2121 */
    2222
    23 #ifndef CSSPrimitiveValue_H
    24 #define CSSPrimitiveValue_H
     23#ifndef CSSPrimitiveValue_h
     24#define CSSPrimitiveValue_h
    2525
    2626#include "CSSValue.h"
     
    3838typedef int ExceptionCode;
    3939
    40 class CSSPrimitiveValue : public CSSValue
    41 {
     40class CSSPrimitiveValue : public CSSValue {
    4241public:
    4342    enum UnitTypes {
     
    118117    void setStringValue(unsigned short stringType, const String& stringValue, ExceptionCode&);
    119118    String getStringValue() const;
    120    
    121     Counter* getCounterValue () const {
    122         return m_type != CSS_COUNTER ? 0 : m_value.counter;
    123     }
    124119
    125     RectImpl* getRectValue () const {
    126         return m_type != CSS_RECT ? 0 : m_value.rect;
    127     }
    128 
    129     unsigned getRGBColorValue() const {
    130         return m_type != CSS_RGBCOLOR ? 0 : m_value.rgbcolor;
    131     }
    132 
    133     Pair* getPairValue() const {
    134         return m_type != CSS_PAIR ? 0 : m_value.pair;
    135     }
     120    Counter* getCounterValue () const { return m_type != CSS_COUNTER ? 0 : m_value.counter; }
     121    RectImpl* getRectValue () const { return m_type != CSS_RECT ? 0 : m_value.rect; }
     122    unsigned getRGBColorValue() const { return m_type != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; }
     123    Pair* getPairValue() const { return m_type != CSS_PAIR ? 0 : m_value.pair; }
    136124
    137125#if PLATFORM(MAC)
    138     DashboardRegion *getDashboardRegionValue () const {
    139         return m_type != CSS_DASHBOARD_REGION ? 0 : m_value.region;
    140     }
     126    DashboardRegion* getDashboardRegionValue () const { return m_type != CSS_DASHBOARD_REGION ? 0 : m_value.region; }
    141127#endif
    142128
    143129    virtual bool isPrimitiveValue() const { return true; }
     130
    144131    virtual unsigned short cssValueType() const;
    145132
     
    167154};
    168155
    169 } // namespace
     156} // namespace WebCore
    170157
    171 #endif
     158#endif // CSSPrimitiveValue_h
  • trunk/WebCore/css/CSSProperty.cpp

    r14408 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSProperty.h"
     25
    2426#include "PlatformString.h"
    2527
     
    3436}
    3537
    36 bool operator==(const CSSProperty &a, const CSSProperty &b)
     38bool operator==(const CSSProperty& a, const CSSProperty& b)
    3739{
    3840    return a.m_id == b.m_id && a.m_important == b.m_important && a.m_value == b.m_value;
    3941}
    4042
    41 }
     43} // namespace WebCore
  • trunk/WebCore/css/CSSProperty.h

    r14408 r18850  
    2121 */
    2222
    23 #ifndef CSSProperty_H
    24 #define CSSProperty_H
     23#ifndef CSSProperty_h
     24#define CSSProperty_h
    2525
    2626#include "CSSValue.h"
     
    4040    {
    4141    }
    42    
    43     CSSProperty &operator=(const CSSProperty& o)
     42
     43    CSSProperty& operator=(const CSSProperty& other)
    4444    {
    45         m_id = o.m_id;
    46         m_shorthandID = o.m_shorthandID;
    47         m_important = o.m_important;
    48         m_value = o.m_value;
     45        m_id = other.m_id;
     46        m_shorthandID = other.m_shorthandID;
     47        m_important = other.m_important;
     48        m_value = other.m_value;
    4949        return *this;
    5050    }
    51    
     51
    5252    int id() const { return m_id; }
    5353    int shorthandID() const { return m_shorthandID; }
    54    
     54
    5555    bool isImportant() const { return m_important; }
    5656    bool isImplicit() const { return m_implicit; }
     
    6060    String cssText() const;
    6161
     62    friend bool operator==(const CSSProperty&, const CSSProperty&);
     63
    6264    // make sure the following fits in 4 bytes.
    6365    int m_id;
     
    6668    bool m_implicit : 1; // Whether or not the property was set implicitly as the result of a shorthand.
    6769
    68     friend bool operator==(const CSSProperty &, const CSSProperty &);
    69 
    7070    RefPtr<CSSValue> m_value;
    7171};
    7272
    73 } // namespace
     73} // namespace WebCore
    7474
    75 #endif
     75#endif // CSSProperty_h
  • trunk/WebCore/css/CSSQuirkPrimitiveValue.h

    r14407 r18850  
    2121 */
    2222
    23 #ifndef CSSQuirkPrimitiveValue_H
    24 #define CSSQuirkPrimitiveValue_H
     23#ifndef CSSQuirkPrimitiveValue_h
     24#define CSSQuirkPrimitiveValue_h
    2525
    2626#include "CSSPrimitiveValue.h"
     
    3232// in a stylesheet.  When the quirky value is used, if you're in quirks mode, the margin will
    3333// collapse away inside a table cell.
    34 class CSSQuirkPrimitiveValue : public CSSPrimitiveValue
    35 {
     34class CSSQuirkPrimitiveValue : public CSSPrimitiveValue {
    3635public:
    3736    CSSQuirkPrimitiveValue(double num, UnitTypes type)
    38         : CSSPrimitiveValue(num, type) {}
     37        : CSSPrimitiveValue(num, type)
     38    {
     39    }
    3940
    4041    virtual bool isQuirkValue() { return true; }
    4142};
    4243
    43 } // namespace
     44} // namespace WebCore
    4445
    45 #endif
     46#endif // CSSQuirkPrimitiveValue_h
  • trunk/WebCore/css/CSSRuleList.cpp

    r16217 r18850  
    2121 * Boston, MA 02111-1307, USA.
    2222 */
     23
    2324#include "config.h"
    2425#include "CSSRuleList.h"
     
    3334}
    3435
    35 CSSRuleList::CSSRuleList(StyleList* lst, bool omitCharsetRules)
     36CSSRuleList::CSSRuleList(StyleList* list, bool omitCharsetRules)
    3637{
    37     if (lst) {
    38         unsigned len = lst->length();
     38    if (list) {
     39        unsigned len = list->length();
    3940        for (unsigned i = 0; i < len; ++i) {
    40             StyleBase* style = lst->item(i);
     41            StyleBase* style = list->item(i);
    4142            if (style->isRule() && !(omitCharsetRules && style->isCharsetRule()))
    4243                append(static_cast<CSSRule*>(style));
     
    5859        rule->deref();
    5960    else
    60         ; // ### Throw INDEX_SIZE_ERR exception here (TODO)
     61        ; // FIXME: Throw INDEX_SIZE_ERR exception here
    6162}
    6263
     
    7374    }
    7475
    75     // ### Should throw INDEX_SIZE_ERR exception instead! (TODO)
     76    // FIXME: Should throw INDEX_SIZE_ERR exception instead!
    7677    return 0;
    7778}
    7879
    79 }
     80} // namespace WebCore
  • trunk/WebCore/css/CSSRuleList.h

    r16217 r18850  
    2222 */
    2323
    24 #ifndef CSSRuleList_H
    25 #define CSSRuleList_H
     24#ifndef CSSRuleList_h
     25#define CSSRuleList_h
    2626
     27#include "DeprecatedPtrList.h"
    2728#include "Shared.h"
    28 #include "DeprecatedPtrList.h"
    2929
    3030namespace WebCore {
     
    3333class StyleList;
    3434
    35 class CSSRuleList : public Shared<CSSRuleList>
    36 {
     35class CSSRuleList : public Shared<CSSRuleList> {
    3736public:
    3837    CSSRuleList();
     
    4140
    4241    unsigned length() const { return m_lstCSSRules.count(); }
    43     CSSRule* item (unsigned index) { return m_lstCSSRules.at(index); }
     42    CSSRule* item(unsigned index) { return m_lstCSSRules.at(index); }
    4443
    4544    /* not part of the DOM */
    46     unsigned insertRule (CSSRule* rule, unsigned index);
    47     void deleteRule (unsigned index);
    48     void append(CSSRule* rule);
     45    unsigned insertRule(CSSRule*, unsigned index);
     46    void deleteRule(unsigned index);
     47    void append(CSSRule*);
    4948
    5049protected:
     
    5251};
    5352
    54 } // namespace
     53} // namespace WebCore
    5554
    56 #endif
     55#endif // CSSRuleList_h
  • trunk/WebCore/css/CSSSelector.cpp

    r18248 r18850  
    2323 * Boston, MA 02111-1307, USA.
    2424 */
     25
    2526#include "config.h"
    2627#include "CSSSelector.h"
     
    3031void CSSSelector::print()
    3132{
    32     if (tagHistory)
    33         tagHistory->print();
     33    if (m_tagHistory)
     34        m_tagHistory->print();
    3435}
    3536
     
    3839    // FIXME: Pseudo-elements and pseudo-classes do not have the same specificity. This function
    3940    // isn't quite correct.
    40     int s = (tag.localName() == starAtom ? 0 : 1);
    41     switch(match)
    42     {
    43     case Id:
    44         s += 0x10000;
    45         break;
    46     case Exact:
    47     case Class:
    48     case Set:
    49     case List:
    50     case Hyphen:
    51     case PseudoClass:
    52     case PseudoElement:
    53     case Contain:
    54     case Begin:
    55     case End:
    56         s += 0x100;
    57     case None:
    58         break;
     41    int s = (m_tag.localName() == starAtom ? 0 : 1);
     42    switch (m_match) {
     43        case Id:
     44            s += 0x10000;
     45            break;
     46        case Exact:
     47        case Class:
     48        case Set:
     49        case List:
     50        case Hyphen:
     51        case PseudoClass:
     52        case PseudoElement:
     53        case Contain:
     54        case Begin:
     55        case End:
     56            s += 0x100;
     57        case None:
     58            break;
    5959    }
    60     if (tagHistory)
    61         s += tagHistory->specificity();
     60
     61    if (m_tagHistory)
     62        s += m_tagHistory->specificity();
     63
    6264    // make sure it doesn't overflow
    6365    return s & 0xffffff;
     
    6668void CSSSelector::extractPseudoType() const
    6769{
    68     if (match != PseudoClass && match != PseudoElement)
     70    if (m_match != PseudoClass && m_match != PseudoElement)
    6971        return;
    70    
     72
    7173    static AtomicString active("active");
    7274    static AtomicString after("after");
     
    103105    static AtomicString target("target");
    104106    static AtomicString visited("visited");
    105     bool element = false;       // pseudo-element
    106     bool compat = false;        // single colon compatbility mode
    107    
    108     _pseudoType = PseudoOther;
    109     if (value == active)
    110         _pseudoType = PseudoActive;
    111     else if (value == after) {
    112         _pseudoType = PseudoAfter;
    113         element = compat = true;
    114     } else if (value == anyLink)
    115         _pseudoType = PseudoAnyLink;
    116     else if (value == autofill)
    117         _pseudoType = PseudoAutofill;
    118     else if (value == before) {
    119         _pseudoType = PseudoBefore;
    120         element = compat = true;
    121     } else if (value == checked)
    122         _pseudoType = PseudoChecked;
    123     else if (value == fileUploadButton) {
    124         _pseudoType = PseudoFileUploadButton;
    125         element = true;
    126     } else if (value == disabled)
    127         _pseudoType = PseudoDisabled;
    128     else if (value == drag)
    129         _pseudoType = PseudoDrag;
    130     else if (value == enabled)
    131         _pseudoType = PseudoEnabled;
    132     else if (value == empty)
    133         _pseudoType = PseudoEmpty;
    134     else if (value == firstChild)
    135         _pseudoType = PseudoFirstChild;
    136     else if (value == firstLetter) {
    137         _pseudoType = PseudoFirstLetter;
    138         element = compat = true;
    139     } else if (value == firstLine) {
    140         _pseudoType = PseudoFirstLine;
    141         element = compat = true;
    142     } else if (value == firstOfType)
    143         _pseudoType = PseudoFirstOfType;
    144     else if (value == focus)
    145         _pseudoType = PseudoFocus;
    146     else if (value == hover)
    147         _pseudoType = PseudoHover;
    148     else if (value == indeterminate)
    149         _pseudoType = PseudoIndeterminate;
    150     else if (value == link)
    151         _pseudoType = PseudoLink;
    152     else if (value == lang)
    153         _pseudoType = PseudoLang;
    154     else if (value == lastChild)
    155         _pseudoType = PseudoLastChild;
    156     else if (value == lastOfType)
    157         _pseudoType = PseudoLastOfType;
    158     else if (value == notStr)
    159         _pseudoType = PseudoNot;
    160     else if (value == onlyChild)
    161         _pseudoType = PseudoOnlyChild;
    162     else if (value == onlyOfType)
    163         _pseudoType = PseudoOnlyOfType;
    164     else if (value == root)
    165         _pseudoType = PseudoRoot;
    166     else if (value == searchCancelButton) {
    167         _pseudoType = PseudoSearchCancelButton;
    168         element = true;
    169     } else if (value == searchDecoration) {
    170         _pseudoType = PseudoSearchDecoration;
    171         element = true;
    172     } else if (value == searchResultsDecoration) {
    173         _pseudoType = PseudoSearchResultsDecoration;
    174         element = true;
    175     } else if (value == searchResultsButton) {
    176         _pseudoType = PseudoSearchResultsButton;
    177         element = true;
    178     }  else if (value == selection) {
    179         _pseudoType = PseudoSelection;
    180         element = true;
    181     } else if (value == sliderThumb) {
    182         _pseudoType = PseudoSliderThumb;
    183         element = true;
    184     } else if (value == target)
    185         _pseudoType = PseudoTarget;
    186     else if (value == visited)
    187         _pseudoType = PseudoVisited;
    188    
    189     if (match == PseudoClass && element)
     107
     108    bool element = false; // pseudo-element
     109    bool compat = false; // single colon compatbility mode
     110
     111    m_pseudoType = PseudoOther;
     112    if (m_value == active)
     113        m_pseudoType = PseudoActive;
     114    else if (m_value == after) {
     115        m_pseudoType = PseudoAfter;
     116        element = true;
     117        compat = true;
     118    } else if (m_value == anyLink)
     119        m_pseudoType = PseudoAnyLink;
     120    else if (m_value == autofill)
     121        m_pseudoType = PseudoAutofill;
     122    else if (m_value == before) {
     123        m_pseudoType = PseudoBefore;
     124        element = true;
     125        compat = true;
     126    } else if (m_value == checked)
     127        m_pseudoType = PseudoChecked;
     128    else if (m_value == fileUploadButton) {
     129        m_pseudoType = PseudoFileUploadButton;
     130        element = true;
     131    } else if (m_value == disabled)
     132        m_pseudoType = PseudoDisabled;
     133    else if (m_value == drag)
     134        m_pseudoType = PseudoDrag;
     135    else if (m_value == enabled)
     136        m_pseudoType = PseudoEnabled;
     137    else if (m_value == empty)
     138        m_pseudoType = PseudoEmpty;
     139    else if (m_value == firstChild)
     140        m_pseudoType = PseudoFirstChild;
     141    else if (m_value == firstLetter) {
     142        m_pseudoType = PseudoFirstLetter;
     143        element = true;
     144        compat = true;
     145    } else if (m_value == firstLine) {
     146        m_pseudoType = PseudoFirstLine;
     147        element = true;
     148        compat = true;
     149    } else if (m_value == firstOfType)
     150        m_pseudoType = PseudoFirstOfType;
     151    else if (m_value == focus)
     152        m_pseudoType = PseudoFocus;
     153    else if (m_value == hover)
     154        m_pseudoType = PseudoHover;
     155    else if (m_value == indeterminate)
     156        m_pseudoType = PseudoIndeterminate;
     157    else if (m_value == link)
     158        m_pseudoType = PseudoLink;
     159    else if (m_value == lang)
     160        m_pseudoType = PseudoLang;
     161    else if (m_value == lastChild)
     162        m_pseudoType = PseudoLastChild;
     163    else if (m_value == lastOfType)
     164        m_pseudoType = PseudoLastOfType;
     165    else if (m_value == notStr)
     166        m_pseudoType = PseudoNot;
     167    else if (m_value == onlyChild)
     168        m_pseudoType = PseudoOnlyChild;
     169    else if (m_value == onlyOfType)
     170        m_pseudoType = PseudoOnlyOfType;
     171    else if (m_value == root)
     172        m_pseudoType = PseudoRoot;
     173    else if (m_value == searchCancelButton) {
     174        m_pseudoType = PseudoSearchCancelButton;
     175        element = true;
     176    } else if (m_value == searchDecoration) {
     177        m_pseudoType = PseudoSearchDecoration;
     178        element = true;
     179    } else if (m_value == searchResultsDecoration) {
     180        m_pseudoType = PseudoSearchResultsDecoration;
     181        element = true;
     182    } else if (m_value == searchResultsButton) {
     183        m_pseudoType = PseudoSearchResultsButton;
     184        element = true;
     185    }  else if (m_value == selection) {
     186        m_pseudoType = PseudoSelection;
     187        element = true;
     188    } else if (m_value == sliderThumb) {
     189        m_pseudoType = PseudoSliderThumb;
     190        element = true;
     191    } else if (m_value == target)
     192        m_pseudoType = PseudoTarget;
     193    else if (m_value == visited)
     194        m_pseudoType = PseudoVisited;
     195
     196    if (m_match == PseudoClass && element) {
    190197        if (!compat)
    191             _pseudoType = PseudoOther;
     198            m_pseudoType = PseudoOther;
    192199        else
    193            match = PseudoElement;
    194     else if (match == PseudoElement && !element)
    195         _pseudoType = PseudoOther;
    196 }
    197 
    198 bool CSSSelector::operator == (const CSSSelector &other)
    199 {
    200     const CSSSelector *sel1 = this;
    201     const CSSSelector *sel2 = &other;
     200           m_match = PseudoElement;
     201    } else if (m_match == PseudoElement && !element)
     202        m_pseudoType = PseudoOther;
     203}
     204
     205bool CSSSelector::operator==(const CSSSelector& other)
     206{
     207    const CSSSelector* sel1 = this;
     208    const CSSSelector* sel2 = &other;
    202209
    203210    while (sel1 && sel2) {
    204         if (sel1->tag != sel2->tag || sel1->attr != sel2->attr ||
    205              sel1->relation() != sel2->relation() || sel1->match != sel2->match ||
    206              sel1->value != sel2->value ||
     211        if (sel1->m_tag != sel2->m_tag || sel1->m_attr != sel2->m_attr ||
     212             sel1->relation() != sel2->relation() || sel1->m_match != sel2->m_match ||
     213             sel1->m_value != sel2->m_value ||
    207214             sel1->pseudoType() != sel2->pseudoType() ||
    208              sel1->argument != sel2->argument)
     215             sel1->m_argument != sel2->m_argument)
    209216            return false;
    210         sel1 = sel1->tagHistory;
    211         sel2 = sel2->tagHistory;
     217        sel1 = sel1->m_tagHistory;
     218        sel2 = sel2->m_tagHistory;
    212219    }
     220
    213221    if (sel1 || sel2)
    214222        return false;
     223
    215224    return true;
    216225}
     
    221230    String str;
    222231    const CSSSelector* cs = this;
    223     const AtomicString& localName = cs->tag.localName();
    224     if (cs->match == CSSSelector::None || localName != starAtom)
     232    const AtomicString& localName = cs->m_tag.localName();
     233
     234    if (cs->m_match == CSSSelector::None || localName != starAtom)
    225235        str = localName;
     236
    226237    while (true) {
    227         if (cs->match == CSSSelector::Id) {
     238        if (cs->m_match == CSSSelector::Id) {
    228239            str += "#";
    229             str += cs->value;
    230         } else if (cs->match == CSSSelector::Class) {
     240            str += cs->m_value;
     241        } else if (cs->m_match == CSSSelector::Class) {
    231242            str += ".";
    232             str += cs->value;
    233         } else if (cs->match == CSSSelector::PseudoClass) {
     243            str += cs->m_value;
     244        } else if (cs->m_match == CSSSelector::PseudoClass) {
    234245            str += ":";
    235             str += cs->value;
    236         } else if (cs->match == CSSSelector::PseudoElement) {
     246            str += cs->m_value;
     247        } else if (cs->m_match == CSSSelector::PseudoElement) {
    237248            str += "::";
    238             str += cs->value;
     249            str += cs->m_value;
    239250        } else if (cs->hasAttribute()) {
    240251            // FIXME: Add support for dumping namespaces.
    241             String attrName = cs->attr.localName();
     252            String attrName = cs->m_attr.localName();
    242253            str += "[";
    243254            str += attrName;
    244             switch (cs->match) {
     255            switch (cs->m_match) {
    245256                case CSSSelector::Exact:
    246257                    str += "=";
     
    268279                    break;
    269280            }
    270             if (cs->match != CSSSelector::Set) {
     281            if (cs->m_match != CSSSelector::Set) {
    271282                str += "\"";
    272                 str += cs->value;
     283                str += cs->m_value;
    273284                str += "\"]";
    274285            }
    275286        }
    276         if (cs->relation() != CSSSelector::SubSelector || !cs->tagHistory)
     287        if (cs->relation() != CSSSelector::SubSelector || !cs->m_tagHistory)
    277288            break;
    278         cs = cs->tagHistory;
     289        cs = cs->m_tagHistory;
    279290    }
    280     if (cs->tagHistory) {
    281         String tagHistoryText = cs->tagHistory->selectorText();
     291
     292    if (cs->m_tagHistory) {
     293        String tagHistoryText = cs->m_tagHistory->selectorText();
    282294        if (cs->relation() == CSSSelector::DirectAdjacent)
    283295            str = tagHistoryText + " + " + str;
     
    286298        else if (cs->relation() == CSSSelector::Child)
    287299            str = tagHistoryText + " > " + str;
    288         else // Descendant
     300        else
     301            // Descendant
    289302            str = tagHistoryText + " " + str;
    290303    }
     304
    291305    return str;
    292306}
    293307
    294 }
     308} // namespace WebCore
  • trunk/WebCore/css/CSSSelector.h

    r18248 r18850  
    2222 */
    2323
    24 #ifndef CSSSelector_H
    25 #define CSSSelector_H
     24#ifndef CSSSelector_h
     25#define CSSSelector_h
    2626
    2727#include "QualifiedName.h"
     
    2929namespace WebCore {
    3030
    31 // this class represents a selector for a StyleRule
    32     class CSSSelector
    33     {
     31    // this class represents a selector for a StyleRule
     32    class CSSSelector {
    3433    public:
    3534        CSSSelector()
    36             : tagHistory(0)
    37             , simpleSelector(0)
    38             , nextSelector(0)
    39             , argument(nullAtom)
    40             , attr(anyQName())
    41             , tag(anyQName())
     35            : m_tagHistory(0)
     36            , m_simpleSelector(0)
     37            , m_nextSelector(0)
     38            , m_argument(nullAtom)
     39            , m_attr(anyQName())
     40            , m_tag(anyQName())
    4241            , m_relation(Descendant)
    43             , match(None)
    44             , pseudoId(0)
    45             , _pseudoType(PseudoNotParsed)
    46         {}
    47        
    48         CSSSelector(const QualifiedName& qName)
    49             : tagHistory(0)
    50             , simpleSelector(0)
    51             , nextSelector(0)
    52             , argument(nullAtom)
    53             , attr(anyQName())
    54             , tag(qName)
    55             , m_relation(Descendant)
    56             , match(None)
    57             , pseudoId(0)
    58             , _pseudoType(PseudoNotParsed)
    59         {}
    60 
    61         ~CSSSelector() {
    62             delete tagHistory;
    63             delete simpleSelector;
    64             delete nextSelector;
     42            , m_match(None)
     43            , m_pseudoType(PseudoNotParsed)
     44        {
    6545        }
    6646
    67         void append(CSSSelector* n) {
     47        CSSSelector(const QualifiedName& qName)
     48            : m_tagHistory(0)
     49            , m_simpleSelector(0)
     50            , m_nextSelector(0)
     51            , m_argument(nullAtom)
     52            , m_attr(anyQName())
     53            , m_tag(qName)
     54            , m_relation(Descendant)
     55            , m_match(None)
     56            , m_pseudoType(PseudoNotParsed)
     57        {
     58        }
     59
     60        ~CSSSelector()
     61        {
     62            delete m_tagHistory;
     63            delete m_simpleSelector;
     64            delete m_nextSelector;
     65        }
     66
     67        void append(CSSSelector* n)
     68        {
    6869            CSSSelector* end = this;
    69             while (end->nextSelector)
    70                 end = end->nextSelector;
    71             end->nextSelector = n;
     70            while (end->m_nextSelector)
     71                end = end->m_nextSelector;
     72            end->m_nextSelector = n;
    7273        }
    73         CSSSelector* next() { return nextSelector; }
     74
     75        CSSSelector* next() { return m_nextSelector; }
    7476
    7577        /**
     
    8486
    8587        // checks if the 2 selectors (including sub selectors) agree.
    86         bool operator ==(const CSSSelector&);
     88        bool operator==(const CSSSelector&);
    8789
    8890        // tag == -1 means apply to all elements (Selector = *)
     
    155157        PseudoType pseudoType() const
    156158        {
    157             if (_pseudoType == PseudoNotParsed)
     159            if (m_pseudoType == PseudoNotParsed)
    158160                extractPseudoType();
    159             return static_cast<PseudoType>(_pseudoType);
     161            return static_cast<PseudoType>(m_pseudoType);
    160162        }
    161163
    162         bool hasTag() const { return tag != anyQName(); }
    163         bool hasAttribute() const { return attr != anyQName(); }
     164        bool hasTag() const { return m_tag != anyQName(); }
     165        bool hasAttribute() const { return m_attr != anyQName(); }
    164166
    165         mutable AtomicString value;
    166         CSSSelector* tagHistory;
    167         CSSSelector* simpleSelector; // Used for :not.
    168         CSSSelector* nextSelector; // used for ,-chained selectors
    169         AtomicString argument; // Used for :contains, :lang and :nth-*
    170        
    171         QualifiedName attr;
    172         QualifiedName tag;
    173        
    174167        Relation relation() const { return static_cast<Relation>(m_relation); }
    175168
    176         unsigned m_relation          : 3; // enum Relation
    177         mutable unsigned match       : 4; // enum Match
    178         unsigned pseudoId            : 4;
    179         mutable unsigned _pseudoType : 6; // PseudoType
     169        mutable AtomicString m_value;
     170        CSSSelector* m_tagHistory;
     171        CSSSelector* m_simpleSelector; // Used for :not.
     172        CSSSelector* m_nextSelector; // used for ,-chained selectors
     173        AtomicString m_argument; // Used for :contains, :lang and :nth-*
     174
     175        QualifiedName m_attr;
     176        QualifiedName m_tag;
     177
     178        unsigned m_relation           : 3; // enum Relation
     179        mutable unsigned m_match      : 4; // enum Match
     180        mutable unsigned m_pseudoType : 6; // PseudoType
    180181
    181182    private:
    182183        void extractPseudoType() const;
    183184    };
    184 }
    185185
    186 #endif
     186} // namespace WebCore
     187
     188#endif // CSSSelector_h
  • trunk/WebCore/css/CSSStyleDeclaration.cpp

    r17818 r18850  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
     22
    2223#include "config.h"
    2324#include "CSSStyleDeclaration.h"
     
    5354    }
    5455
    55     int id = getPropertyID(buffer, len);
     56    int propID = getPropertyID(buffer, len);
    5657#ifdef SVG_SUPPORT
    57     if (id == 0)
    58         id = SVG::getSVGCSSPropertyID(buffer, len);
     58    if (!propID)
     59        propID = SVG::getSVGCSSPropertyID(buffer, len);
    5960#endif
    60     return id;
     61    return propID;
    6162}
    6263
     
    8788}
    8889
    89 String CSSStyleDeclaration::getPropertyPriority(const String &propertyName)
     90String CSSStyleDeclaration::getPropertyPriority(const String& propertyName)
    9091{
    9192    int propID = propertyID(propertyName);
     
    9596}
    9697
    97 String CSSStyleDeclaration::getPropertyShorthand(const String &propertyName)
     98String CSSStyleDeclaration::getPropertyShorthand(const String& propertyName)
    9899{
    99100    int propID = propertyID(propertyName);
     
    106107}
    107108
    108 bool CSSStyleDeclaration::isPropertyImplicit(const String &propertyName)
     109bool CSSStyleDeclaration::isPropertyImplicit(const String& propertyName)
    109110{
    110111    int propID = propertyID(propertyName);
     
    126127{
    127128    int propID = propertyID(propertyName);
    128     if (!propID) // set exception?
     129    if (!propID)
     130        // FIXME: set exception?
    129131        return;
    130132    bool important = priority.find("important", 0, false) != -1;
     
    140142}
    141143
    142 bool CSSStyleDeclaration::isPropertyName(const String &propertyName)
     144bool CSSStyleDeclaration::isPropertyName(const String& propertyName)
    143145{
    144146    return propertyID(propertyName);
    145147}
    146148
    147 CSSRule *CSSStyleDeclaration::parentRule() const
     149CSSRule* CSSStyleDeclaration::parentRule() const
    148150{
    149     return (parent() && parent()->isRule()) ? static_cast<CSSRule *>(parent()) : 0;
     151    return (parent() && parent()->isRule()) ? static_cast<CSSRule*>(parent()) : 0;
    150152}
    151153
    152 void CSSStyleDeclaration::diff(CSSMutableStyleDeclaration *style) const
     154void CSSStyleDeclaration::diff(CSSMutableStyleDeclaration* style) const
    153155{
    154156    if (!style)
     
    168170}
    169171
    170 PassRefPtr<CSSMutableStyleDeclaration> CSSStyleDeclaration::copyPropertiesInSet(const int *set, unsigned length) const
     172PassRefPtr<CSSMutableStyleDeclaration> CSSStyleDeclaration::copyPropertiesInSet(const int* set, unsigned length) const
    171173{
    172174    DeprecatedValueList<CSSProperty> list;
     
    179181}
    180182
    181 }
     183} // namespace WebCore
  • trunk/WebCore/css/CSSStyleDeclaration.h

    r14700 r18850  
    2121 */
    2222
    23 #ifndef CSSStyleDeclaration_H
    24 #define CSSStyleDeclaration_H
     23#ifndef CSSStyleDeclaration_h
     24#define CSSStyleDeclaration_h
    2525
    2626#include "StyleBase.h"
     
    8282};
    8383
    84 } // namespace
     84} // namespace WebCore
    8585
    86 #endif
     86#endif // CSSStyleDeclaration_h
  • trunk/WebCore/css/Counter.h

    r18637 r18850  
    2121 */
    2222
    23 #ifndef Counter_H
    24 #define Counter_H
     23#ifndef Counter_h
     24#define Counter_h
    2525
    2626#include "CSSPrimitiveValue.h"
     
    3333class Counter : public Shared<Counter> {
    3434public:
    35     Counter(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle,
    36         PassRefPtr<CSSPrimitiveValue> separator)
    37         : m_identifier(identifier), m_listStyle(listStyle), m_separator(separator) { }
     35    Counter(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator)
     36        : m_identifier(identifier)
     37        , m_listStyle(listStyle)
     38        , m_separator(separator)
     39    {
     40    }
    3841
    3942    String identifier() const { return m_identifier ? m_identifier->getStringValue() : String(); }
     
    4144    String separator() const { return m_separator ? m_separator->getStringValue() : String(); }
    4245
    43     int listStyleNumber() const { return m_listStyle ? (int) m_listStyle->getFloatValue() : 0; }
    44    
     46    int listStyleNumber() const { return m_listStyle ? static_cast<int>(m_listStyle->getFloatValue()) : 0; }
     47
    4548    void setIdentifier(PassRefPtr<CSSPrimitiveValue> identifier) { m_identifier = identifier; }
    4649    void setListStyle(PassRefPtr<CSSPrimitiveValue> listStyle) { m_listStyle = listStyle; }
    4750    void setSeparator(PassRefPtr<CSSPrimitiveValue> separator) { m_separator = separator; }
    48  
     51
    4952protected:
    5053    RefPtr<CSSPrimitiveValue> m_identifier; // String
    5154    RefPtr<CSSPrimitiveValue> m_listStyle;  // int
    5255    RefPtr<CSSPrimitiveValue> m_separator;  // String
    53  };
     56};
    5457
    55 } //namespace
     58} // namespace WebCore
    5659
    57 #endif
     60#endif // Counter_h
  • trunk/WebCore/css/csshelper.cpp

    r14273 r18850  
    4343        --l;
    4444    }
    45     while (l > 0 && (*i)[o+l-1] <= ' ')
     45    while (l > 0 && (*i)[o + l - 1] <= ' ')
    4646        --l;
    4747
     
    6060        --l;
    6161    }
    62     while (l > 0 && (*i)[o+l-1] <= ' ')
     62    while (l > 0 && (*i)[o + l - 1] <= ' ')
    6363        --l;
    6464
    65     if (l >= 2 && (*i)[o] == (*i)[o+l-1] && ((*i)[o] == '\'' || (*i)[o] == '\"')) {
     65    if (l >= 2 && (*i)[o] == (*i)[o + l - 1] && ((*i)[o] == '\'' || (*i)[o] == '\"')) {
    6666        o++;
    6767        l -= 2;
     
    7272        --l;
    7373    }
    74     while (l > 0 && (*i)[o+l-1] <= ' ')
     74    while (l > 0 && (*i)[o + l - 1] <= ' ')
    7575        --l;
    7676
     
    8787}
    8888
    89 }
     89} // namespace WebCore
  • trunk/WebCore/css/csshelper.h

    r12953 r18850  
    2121 */
    2222
    23 #ifndef css_helper_h
    24 #define css_helper_h
     23#ifndef csshelper_h
     24#define csshelper_h
    2525
    2626namespace WebCore {
     
    3131     * mostly just removes the url("...") brace
    3232     */
    33     String parseURL(const String &url);
     33    String parseURL(const String& url);
    3434
    35 }
     35} // namespace WebCore
    3636
    37 #endif
     37#endif // csshelper_h
  • trunk/WebCore/css/cssparser.h

    r18722 r18850  
    2121 */
    2222
    23 #ifndef CSS_cssparser_h_
    24 #define CSS_cssparser_h_
     23#ifndef cssparser_h
     24#define cssparser_h
    2525
    2626#include "AtomicString.h"
    2727#include "Color.h"
     28#include "MediaQuery.h"
    2829#include <wtf/HashSet.h>
    2930#include <wtf/Vector.h>
    30 #include "MediaQuery.h"
    3131
    3232namespace WebCore {
     
    4343    class Document;
    4444    class MediaList;
     45    class MediaList;
     46    class MediaQueryExp;
    4547    class StyleBase;
    4648    class StyleList;
    47     class MediaList;
    48     class MediaQueryExp;
    49 
     49    struct Function;
    5050
    5151    struct ParseString {
    5252        UChar* characters;
    5353        int length;
    54        
     54
    5555        void lower();
    5656    };
    5757
    58     struct Function;
    59    
    6058    struct Value {
    6159        int id;
     
    7674
    7775    DeprecatedString deprecatedString(const ParseString&);
    78     static inline String domString(const ParseString& ps) {
     76
     77    static inline String domString(const ParseString& ps)
     78    {
    7979        return String(ps.characters, ps.length);
    8080    }
    81     static inline AtomicString atomicString(const ParseString& ps) {
     81
     82    static inline AtomicString atomicString(const ParseString& ps)
     83    {
    8284        return AtomicString(ps.characters, ps.length);
    8385    }
     
    8789        ValueList() : m_current(0) { }
    8890        ~ValueList();
     91
    8992        void addValue(const Value& v) { m_values.append(v); }
    9093        unsigned size() const { return m_values.size(); }
    9194        Value* current() { return m_current < m_values.size() ? &m_values[m_current] : 0; }
    9295        Value* next() { ++m_current; return current(); }
     96
    9397    private:
    9498        Vector<Value, 16> m_values;
     
    102106        ~Function() { delete args; }
    103107    };
    104    
    105     class CSSParser
    106     {
     108
     109    class CSSParser {
    107110    public:
    108111        CSSParser(bool strictParsing = true);
     
    111114        void parseSheet(CSSStyleSheet*, const String&);
    112115        PassRefPtr<CSSRule> parseRule(CSSStyleSheet*, const String&);
    113         bool parseValue(CSSMutableStyleDeclaration*, int id, const String&, bool important);
     116        bool parseValue(CSSMutableStyleDeclaration*, int propId, const String&, bool important);
    114117        static RGBA32 parseColor(const String&, bool strict = false);
    115118        bool parseColor(CSSMutableStyleDeclaration*, const String&);
     
    133136        CSSValue* parseBackgroundImage();
    134137        CSSValue* parseBackgroundPositionXY(bool& xFound, bool& yFound);
    135         void parseBackgroundPosition(CSSValue*& value1, CSSValue*& value2);
     138        void parseBackgroundPosition(CSSValue*&, CSSValue*&);
    136139        CSSValue* parseBackgroundSize();
    137140       
    138         bool parseBackgroundProperty(int propId, int& propId1, int& propId2, CSSValue*& retValue1, CSSValue*& retValue2);
     141        bool parseBackgroundProperty(int propId, int& propId1, int& propId2, CSSValue*&, CSSValue*&);
    139142        bool parseBackgroundShorthand(bool important);
    140143
    141144        void addBackgroundValue(CSSValue*& lval, CSSValue* rval);
    142      
     145
    143146#if PLATFORM(MAC)
    144147        bool parseDashboardRegions(int propId, bool important);
     
    146149
    147150        bool parseShape(int propId, bool important);
     151
    148152        bool parseFont(bool important);
     153        CSSValueList* parseFontFamily();
     154
    149155        bool parseCounter(int propId, int defaultValue, bool important);
    150         CSSValueList* parseFontFamily();
     156        PassRefPtr<CSSValue> parseCounterContent(ValueList* args, bool counters);
     157
    151158        bool parseColorParameters(Value*, int* colorValues, bool parseAlpha);
    152159        bool parseHSLParameters(Value*, double* colorValues, bool parseAlpha);
    153160        CSSPrimitiveValue* parseColor(Value* = 0);
    154161        bool parseColorFromValue(Value*, RGBA32&, bool = false);
    155         PassRefPtr<CSSValue> parseCounterContent(ValueList* args, bool counters);
    156        
     162
     163        static bool parseColor(const String&, RGBA32& rgb, bool strict);
     164
    157165#ifdef SVG_SUPPORT
    158166        bool parseSVGValue(int propId, bool important);
     
    161169        CSSValue* parseSVGStrokeDasharray();
    162170#endif
    163 
    164         static bool parseColor(const String&, RGBA32& rgb, bool strict);
    165171
    166172        // CSS3 Parsing Routines (for properties specific to CSS3)
     
    206212        int numParsedProperties;
    207213        int maxParsedProperties;
    208        
     214
    209215        int m_inParseShorthand;
    210216        int m_currentShorthand;
     
    264270
    265271        friend inline Units operator|(Units a, Units b)
    266             { return static_cast<Units>(static_cast<unsigned>(a) | static_cast<unsigned>(b)); }
     272        {
     273            return static_cast<Units>(static_cast<unsigned>(a) | static_cast<unsigned>(b));
     274        }
    267275
    268276        static bool validUnit(Value*, Units, bool strict);
    269277    };
    270278
    271 } // namespace
    272 
    273 #endif
     279} // namespace WebCore
     280
     281#endif // cssparser_h
  • trunk/WebCore/css/cssstyleselector.cpp

    r18838 r18850  
    432432        CSSStyleRule* rule = d->rule();
    433433        const AtomicString& localName = element->localName();
    434         const AtomicString& selectorLocalName = d->selector()->tag.localName();
     434        const AtomicString& selectorLocalName = d->selector()->m_tag.localName();
    435435        if ((localName == selectorLocalName || selectorLocalName == starAtom) && checkSelector(d->selector(), element)) {
    436436            // If the rule has no properties to apply, then ignore it.
     
    12171217    // to apply the rules only to links.
    12181218    bool onlyHoverActive = (!sel->hasTag() &&
    1219                             (sel->match == CSSSelector::PseudoClass &&
     1219                            (sel->m_match == CSSSelector::PseudoClass &&
    12201220                              (sel->pseudoType() == CSSSelector::PseudoHover ||
    12211221                               sel->pseudoType() == CSSSelector::PseudoActive)));
     
    12301230    // check the subselectors
    12311231    CSSSelector::Relation relation = sel->relation();
    1232     while((sel = sel->tagHistory)) {
     1232    while((sel = sel->m_tagHistory)) {
    12331233        if (!n->isElementNode())
    12341234            return false;
     
    12851285       {
    12861286            if (onlyHoverActive)
    1287                 onlyHoverActive = (sel->match == CSSSelector::PseudoClass &&
     1287                onlyHoverActive = (sel->m_match == CSSSelector::PseudoClass &&
    12881288                                   (sel->pseudoType() == CSSSelector::PseudoHover ||
    12891289                                    sel->pseudoType() == CSSSelector::PseudoActive));
     
    13291329        const AtomicString& localName = e->localName();
    13301330        const AtomicString& ns = e->namespaceURI();
    1331         const AtomicString& selLocalName = sel->tag.localName();
    1332         const AtomicString& selNS = sel->tag.namespaceURI();
     1331        const AtomicString& selLocalName = sel->m_tag.localName();
     1332        const AtomicString& selNS = sel->m_tag.namespaceURI();
    13331333   
    13341334        if ((selLocalName != starAtom && localName != selLocalName) ||
     
    13381338
    13391339    if (sel->hasAttribute()) {
    1340         if (sel->match == CSSSelector::Class) {
     1340        if (sel->m_match == CSSSelector::Class) {
    13411341            if (!e->hasClass())
    13421342                return false;
    13431343            for (const AtomicStringList* c = e->getClassList(); c; c = c->next())
    1344                 if (c->string() == sel->value)
     1344                if (c->string() == sel->m_value)
    13451345                    return true;
    13461346            return false;
    13471347        }
    1348         else if (sel->match == CSSSelector::Id)
    1349             return e->hasID() && e->getIDAttribute() == sel->value;
    1350         else if (style && (e != element || !styledElement || (!styledElement->isMappedAttribute(sel->attr) && sel->attr != typeAttr && sel->attr != readonlyAttr))) {
     1348        else if (sel->m_match == CSSSelector::Id)
     1349            return e->hasID() && e->getIDAttribute() == sel->m_value;
     1350        else if (style && (e != element || !styledElement || (!styledElement->isMappedAttribute(sel->m_attr) && sel->m_attr != typeAttr && sel->m_attr != readonlyAttr))) {
    13511351            style->setAffectedByAttributeSelectors(); // Special-case the "type" and "readonly" attributes so input form controls can share style.
    1352             m_selectorAttrs.add(sel->attr.localName().impl());
    1353         }
    1354 
    1355         const AtomicString& value = e->getAttribute(sel->attr);
     1352            m_selectorAttrs.add(sel->m_attr.localName().impl());
     1353        }
     1354
     1355        const AtomicString& value = e->getAttribute(sel->m_attr);
    13561356        if (value.isNull())
    13571357            return false; // attribute is not set
    13581358
    1359         switch(sel->match) {
     1359        switch(sel->m_match) {
    13601360        case CSSSelector::Exact:
    1361             if ((isXMLDoc && sel->value != value) || (!isXMLDoc && !equalIgnoringCase(sel->value, value)))
     1361            if ((isXMLDoc && sel->m_value != value) || (!isXMLDoc && !equalIgnoringCase(sel->m_value, value)))
    13621362                return false;
    13631363            break;
     
    13651365        {
    13661366            // The selector's value can't contain a space, or it's totally bogus.
    1367             if (sel->value.contains(' '))
     1367            if (sel->m_value.contains(' '))
    13681368                return false;
    13691369
    13701370            int startSearchAt = 0;
    13711371            while (true) {
    1372                 int foundPos = value.find(sel->value, startSearchAt, isXMLDoc);
     1372                int foundPos = value.find(sel->m_value, startSearchAt, isXMLDoc);
    13731373                if (foundPos == -1)
    13741374                    return false;
    13751375                if (foundPos == 0 || value[foundPos-1] == ' ') {
    1376                     unsigned endStr = foundPos + sel->value.length();
     1376                    unsigned endStr = foundPos + sel->m_value.length();
    13771377                    if (endStr == value.length() || value[endStr] == ' ')
    13781378                        break; // We found a match.
     
    13851385        }
    13861386        case CSSSelector::Contain:
    1387             if (!value.contains(sel->value, isXMLDoc))
     1387            if (!value.contains(sel->m_value, isXMLDoc))
    13881388                return false;
    13891389            break;
    13901390        case CSSSelector::Begin:
    1391             if (!value.startsWith(sel->value, isXMLDoc))
     1391            if (!value.startsWith(sel->m_value, isXMLDoc))
    13921392                return false;
    13931393            break;
    13941394        case CSSSelector::End:
    1395             if (!value.endsWith(sel->value, isXMLDoc))
     1395            if (!value.endsWith(sel->m_value, isXMLDoc))
    13961396                return false;
    13971397            break;
    13981398        case CSSSelector::Hyphen:
    1399             if (value.length() < sel->value.length())
     1399            if (value.length() < sel->m_value.length())
    14001400                return false;
    1401             if (!value.startsWith(sel->value, isXMLDoc))
     1401            if (!value.startsWith(sel->m_value, isXMLDoc))
    14021402                return false;
    14031403            // It they start the same, check for exact match or following '-':
    1404             if (value.length() != sel->value.length() && value[sel->value.length()] != '-')
     1404            if (value.length() != sel->m_value.length() && value[sel->m_value.length()] != '-')
    14051405                return false;
    14061406            break;
     
    14111411        }
    14121412    }
    1413     if(sel->match == CSSSelector::PseudoClass || sel->match == CSSSelector::PseudoElement)
     1413    if(sel->m_match == CSSSelector::PseudoClass || sel->m_match == CSSSelector::PseudoElement)
    14141414    {
    14151415        // Pseudo elements. We need to check first child here. No dynamic pseudo
     
    16011601            case CSSSelector::PseudoLang: {
    16021602                const AtomicString& value = e->getAttribute(langAttr);
    1603                 if (value.isEmpty() || !value.startsWith(sel->argument, false))
     1603                if (value.isEmpty() || !value.startsWith(sel->m_argument, false))
    16041604                    break;
    1605                 if (value.length() != sel->argument.length() && value[sel->argument.length()] != '-')
     1605                if (value.length() != sel->m_argument.length() && value[sel->m_argument.length()] != '-')
    16061606                    break;
    16071607                return true;
     
    16091609            case CSSSelector::PseudoNot: {
    16101610                // check the simple selector
    1611                 for (CSSSelector* subSel = sel->simpleSelector; subSel; subSel = subSel->tagHistory) {
     1611                for (CSSSelector* subSel = sel->m_simpleSelector; subSel; subSel = subSel->m_tagHistory) {
    16121612                    // :not cannot nest. I don't really know why this is a
    16131613                    // restriction in CSS3, but it is, so let's honour it.
    1614                     if (subSel->simpleSelector)
     1614                    if (subSel->m_simpleSelector)
    16151615                        break;
    16161616                    if (!checkOneSelector(subSel, e))
     
    17041704void CSSRuleSet::addRule(CSSStyleRule* rule, CSSSelector* sel)
    17051705{
    1706     if (sel->match == CSSSelector::Id) {
    1707         addToRuleSet(sel->value.impl(), m_idRules, rule, sel);
    1708         return;
    1709     }
    1710     if (sel->match == CSSSelector::Class) {
    1711         addToRuleSet(sel->value.impl(), m_classRules, rule, sel);
     1706    if (sel->m_match == CSSSelector::Id) {
     1707        addToRuleSet(sel->m_value.impl(), m_idRules, rule, sel);
     1708        return;
     1709    }
     1710    if (sel->m_match == CSSSelector::Class) {
     1711        addToRuleSet(sel->m_value.impl(), m_classRules, rule, sel);
    17121712        return;
    17131713    }
    17141714     
    1715     const AtomicString& localName = sel->tag.localName();
     1715    const AtomicString& localName = sel->m_tag.localName();
    17161716    if (localName != starAtom) {
    17171717        addToRuleSet(localName.impl(), m_tagRules, rule, sel);
Note: See TracChangeset for help on using the changeset viewer.