Make sure to use CSSValueID and CSSPropertyID rather than integers
authoralexis@webkit.org <alexis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jun 2013 22:07:23 +0000 (22:07 +0000)
committeralexis@webkit.org <alexis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jun 2013 22:07:23 +0000 (22:07 +0000)
commitb6160f8d40e0358b81d43fce2c77dceb6c14cc41
treeab26f73190127ad67b8c7a607cbc8f77cee9a4be
parent11b202d29d1898ee858150c323647b70dbdcb433
Make sure to use CSSValueID and CSSPropertyID rather than integers
https://bugs.webkit.org/show_bug.cgi?id=117481

Reviewed by Benjamin Poulain.

This will ensure that types are enforced when passing arguments in various
css functions. Having a compile time check make sure that no mistakes
will be done over the type.

The parser was also patched to directly use CSSValueID over integers.
This patch also fixes various call sites abusing the usage of integers.
This is part 1 of 2.

No new tests : existing ones should cover.

* WebCore.xcodeproj/project.pbxproj: copy CSSValueKeywords.h as it could be used in WebKit/ for example.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForRepeatRule):
(WebCore::cssIdentifierForFontSizeKeyword):
(WebCore::identifierForFamily):
(WebCore::valueForFamily):
* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::parseKeywordValue):
(WebCore::CSSParser::parseValidPrimitive):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseContent):
(WebCore::CSSParser::parseBackgroundColor):
(WebCore::CSSParser::parseFillPositionComponent):
(WebCore::CSSParser::parse3ValuesFillPosition):
(WebCore::CSSParser::parseFillRepeat):
(WebCore::CSSParser::parseAnimationProperty):
(WebCore::CSSParser::parseCounterContent):
(WebCore::CSSParser::parseLineHeight):
(WebCore::CSSParser::parseFontSize):
(WebCore::CSSParser::createFontWeightValueKeyword):
(WebCore::CSSParser::parseFontWeight):
(WebCore::parseDeprecatedGradientColorStop):
(WebCore::parseGradientColorOrKeyword):
(WebCore::CSSParser::parseDeprecatedRadialGradient):
(WebCore::CSSParser::rewriteSpecifiers):
* css/CSSParser.h:
* css/CSSParserValues.h:
* css/CSSPrimitiveValue.h:
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createIdentifierValue):
* css/CSSValuePool.h:
* css/StylePropertySet.cpp:
(WebCore::MutableStylePropertySet::setProperty):
* css/StylePropertySet.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
* dom/StyledElement.h:
* editing/EditingStyle.cpp:
(WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue):
(WebCore::EditingStyle::prepareToApplyAt):
* editing/EditorCommand.cpp:
(WebCore::executeApplyStyle):
(WebCore::executeFontSize):
* html/HTMLElement.cpp:
(WebCore::unicodeBidiAttributeForDirAuto):
(WebCore::HTMLElement::applyAlignmentAttributeToStyle):
* html/HTMLFontElement.cpp:
(WebCore::HTMLFontElement::cssValueFromFontSizeNumber):
(WebCore::HTMLFontElement::collectStyleForPresentationAttribute):
* html/HTMLFontElement.h:
* html/HTMLTableElement.cpp:
(WebCore::leakBorderStyle):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::getCSSWritingDirection):
(WebCore::TextTrackCue::getCSSWritingMode):
* html/track/TextTrackCue.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSGrammar.y.in
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSParserValues.h
Source/WebCore/css/CSSValuePool.cpp
Source/WebCore/css/CSSValuePool.h
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StylePropertySet.h
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLFontElement.cpp
Source/WebCore/html/HTMLFontElement.h
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/track/TextTrackCue.cpp
Source/WebCore/html/track/TextTrackCue.h