[Part 2] We should use CSSPropertyID rather than integers when manipulating CSS prope...
authoralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 14:18:19 +0000 (14:18 +0000)
committeralexis.menard@openbossa.org <alexis.menard@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 14:18:19 +0000 (14:18 +0000)
commit51f64bf5bffc77c3ab7018845f0dd6d92a5c7869
tree93106008c68ba8a05f2e7f3a9da170fd243f2cfd
parentd3ef593385ac095f1d22ee1aef0019c6c612bde8
[Part 2] We should use CSSPropertyID rather than integers when manipulating CSS property ids.
https://bugs.webkit.org/show_bug.cgi?id=82977

Reviewed by Andreas Kling.

Source/WebCore:

CSSPropertyID enum holds all the CSS property ids but many parts of WebKit treat the ids
as integers. While it's not incorrect it is nicer to use the enum as a parameter of
functions manipulating property ids, as we ensure that the value passed will be an
existing value. Almost everything has been changed with the exception of the Animation related
classes which can be done in a following patch.

No new tests : There should be no behavior change in this patch.

* WebCore.exp.in:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::cssText):
(WebCore::CSSComputedStyleDeclaration::valueForShadow):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::logUnimplementedPropertyID):
(WebCore::CSSComputedStyleDeclaration::getPropertyValue):
(WebCore::CSSComputedStyleDeclaration::item):
* css/CSSComputedStyleDeclaration.h:
(CSSComputedStyleDeclaration):
* css/CSSGrammar.y:
* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::isColorPropertyID):
(WebCore::parseColorValue):
(WebCore::isSimpleLengthPropertyID):
(WebCore::parseSimpleLengthValue):
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::parseKeywordValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::addProperty):
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseShorthand):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parsePage):
(WebCore::CSSParser::parseSize):
(WebCore::CSSParser::parseQuotes):
(WebCore::CSSParser::parseContent):
(WebCore::CSSParser::parseFillSize):
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::parseAnimationProperty):
(WebCore::CSSParser::parseGridTrackList):
(WebCore::CSSParser::parseDashboardRegions):
(WebCore::CSSParser::parseClipShape):
(WebCore::CSSParser::parseShadow):
(WebCore::CSSParser::parseReflect):
(WebCore::BorderImageParseContext::commitBorderImageProperty):
(WebCore::CSSParser::parseBorderImage):
(WebCore::CSSParser::parseBorderImageSlice):
(WebCore::CSSParser::parseBorderRadius):
(WebCore::CSSParser::parseCounter):
(WebCore::CSSParser::parseFlowThread):
(WebCore::CSSParser::parseRegionThread):
(WebCore::CSSParser::parseTransformOrigin):
(WebCore::CSSParser::parsePerspectiveOrigin):
* css/CSSParser.h:
(CSSParser):
(WebCore::ShorthandScope::ShorthandScope):
* css/CSSProperty.cpp:
(WebCore::resolveToPhysicalProperty):
(WebCore::CSSProperty::resolveDirectionAwareProperty):
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSProperty.h:
(WebCore::CSSProperty::CSSProperty):
(CSSProperty):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):
* css/CSSStyleSelector.h:
(CSSStyleSelector):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::removeProperty):
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue):
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* css/SVGCSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applySVGProperty):
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::getPropertyCSSValue):
(WebCore::StylePropertySet::removeShorthandProperty):
(WebCore::StylePropertySet::removeProperty):
(WebCore::StylePropertySet::setProperty):
(WebCore::StylePropertySet::asText):
(WebCore::StylePropertySet::findPropertyWithId):
(WebCore::StylePropertySet::removeEquivalentProperties):
* css/StylePropertySet.h:
(StylePropertySet):
* css/StylePropertyShorthand.cpp:
(WebCore::shorthandForProperty):
* css/StylePropertyShorthand.h:
(WebCore):
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::removeInlineStyleProperty):
(WebCore::StyledElement::addPropertyToAttributeStyle):
* dom/StyledElement.h:
(StyledElement):
(WebCore::StyledElement::addPropertyToAttributeStyle):
* editing/EditingStyle.cpp:
(HTMLElementEquivalent):
(WebCore::EditingStyle::EditingStyle):
(WebCore::EditingStyle::setProperty):
* editing/EditingStyle.h:
(WebCore::EditingStyle::create):
(EditingStyle):
* editing/Editor.cpp:
(WebCore::Editor::selectionStartHasStyle):
(WebCore::Editor::selectionHasStyle):
* editing/Editor.h:
(Editor):
* editing/EditorCommand.cpp:
(WebCore::executeApplyStyle):
(WebCore::executeToggleStyleInList):
(WebCore::executeToggleStyle):
(WebCore::executeApplyParagraphStyle):
(WebCore::stateStyle):
* editing/markup.cpp:
(WebCore):
(WebCore::propertyMissingOrEqualToNone):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::addHTMLLengthToStyle):
(WebCore::HTMLElement::addHTMLColorToStyle):
* html/HTMLElement.h:
(HTMLElement):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties):
* page/animation/AnimationBase.cpp:
(WebCore::addShorthandProperties):
* svg/SVGFontFaceElement.cpp:
(WebCore::cssPropertyIdForSVGAttributeName):
(WebCore::SVGFontFaceElement::parseAttribute):
* svg/SVGStyledElement.cpp:
(WebCore::mapAttributeToCSSProperty):
(WebCore::SVGStyledElement::cssPropertyIdForSVGAttributeName):
(WebCore::SVGStyledElement::collectStyleForAttribute):
(WebCore::SVGStyledElement::svgAttributeChanged):
(WebCore::SVGStyledElement::getPresentationAttribute):
* svg/SVGStyledElement.h:
(WebCore):
(SVGStyledElement):

Source/WebKit/qt:

Update the code to use CSSPropertyID rather than an integer.

* Api/qwebelement.cpp:
(QWebElement::setStyleProperty):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
36 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.h
Source/WebCore/css/CSSGrammar.y
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSProperty.h
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSStyleSelector.h
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
Source/WebCore/css/SVGCSSParser.cpp
Source/WebCore/css/SVGCSSStyleSelector.cpp
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StylePropertySet.h
Source/WebCore/css/StylePropertyShorthand.cpp
Source/WebCore/css/StylePropertyShorthand.h
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditingStyle.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/svg/SVGFontFaceElement.cpp
Source/WebCore/svg/SVGStyledElement.cpp
Source/WebCore/svg/SVGStyledElement.h
Source/WebKit/qt/Api/qwebelement.cpp
Source/WebKit/qt/ChangeLog