Make 'TypeName' parameter unnecessary in CSSPropertyNames.in
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2015 20:11:44 +0000 (20:11 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2015 20:11:44 +0000 (20:11 +0000)
commit3324ab272a5459c4c654cd50d1bcb6dc7502d2d6
treedce68265869871d08f25487afc770f0d02f9199d
parentc47d304f242cd9b37870a3333ea466bd14605f18
Make 'TypeName' parameter unnecessary in CSSPropertyNames.in
https://bugs.webkit.org/show_bug.cgi?id=140347

Reviewed by Darin Adler.

Source/WebCore:

Make 'TypeName' parameter unnecessary in CSSPropertyNames.in by:
- Removing the static_cast to the destination type in the generated
  StyleBuilder code and let compiler implicitly convert the
  CSSPrimitiveValue to the setter's argument type.
- Updating conditional converters to return a WTF::Optional<>
  instead of returning a boolean and having an output argument
  passed by reference. This way, we can use "auto" in the generated
  StyleBuilder code to deduce the return type.

* css/CSSPropertyNames.in:
Drop TypeName parameter from all properties as it is no longer needed.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridTrackSize):
(WebCore::StyleBuilderConverter::convertGridPosition):
(WebCore::StyleBuilderConverter::convertWordSpacing):
(WebCore::StyleBuilderConverter::convertPerspective):
(WebCore::StyleBuilderConverter::convertMarqueeIncrement):
(WebCore::StyleBuilderConverter::convertFilterOperations):
(WebCore::StyleBuilderConverter::convertMaskImageOperations):
Update conditional converters to return an Optional<>.

* css/makeprop.pl:
(generateValueSetter):
Drop support for TypeName, stop using static_cast to destination
type and update the generated code now that the conditional
converters return an Optional.

* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::systemFont):
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::setIsItalic):
(WebCore::FontDescription::setIsSmallCaps):
(WebCore::FontDescription::setItalic): Deleted.
(WebCore::FontDescription::setSmallCaps): Deleted.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemFont):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemFont):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemFont):
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::systemFont):
* rendering/RenderThemeWin.cpp:
(WebCore::fillFontDescription):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::updateStyle):
Now that we call the RenderStyle setters with a CSSPrimitiveValue
and let it be implicitly converted to the right type, instead of
doing an explicit static_cast, two setters on FontDescription
were ambiguous: setItalic() / setSmallCaps(). Rename the overloads
taking a boolean in argument to setIsItalic() / setIsSmallCaps()
to resolve the ambiguity.

Source/WebKit/mac:

Call FontDescription::setIsItalic() instead of setItalic() as the
call site passes a boolean.

* WebView/WebHTMLView.mm:
(fontNameForDescription):

Source/WebKit/win:

Call FontDescription::setIsItalic() instead of setItalic() as the
call site passes a boolean.

* WebKitGraphics.cpp:
(makeFont):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/makeprop.pl
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/rendering/RenderThemeGtk.cpp
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebKitGraphics.cpp