WebCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
https://bugs.webkit.org/show_bug.cgi?id=127671

Source/WebCore:

Reviewed by Ryosuke Niwa.

* Configurations/Base.xcconfig:
Enable the warning.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
Caught a bug. CSSPropertyWebkitAlt could fall through to CSSPropertyQuotes.

* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
Caught a bug. CSSPropertyWebkitSvgShadow could fall through to CSSPropertyMaskType.

* platform/Decimal.cpp:
(WebCore::Decimal::fromString):
Possible bug. Implementation doesn't seem to match its documentation.
Filed an issue to follow-up on this unclear function.

* css/makeprop.pl:
* css/makevalues.pl:
* platform/ColorData.gperf:
Ignore implicit fallthrough warnings in generated code. gperf outputs
a "/*FALLTHROUGH*/" comment, but is not easily customizable to change
this output. Easiest to just ignore the warning for now.

* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
(WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
(WebCore::AutoTableLayout::layout):
There has been a "fall through" comment immediately followed by a break
since its introduction in 2003. Removing the inaccurate comment.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canHaveChildren):
(WebCore::AccessibilityNodeObject::visibleText):
(WebCore::AccessibilityNodeObject::title):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase accessibilityDescription]):
(-[WebAccessibilityObjectWrapperBase accessibilityHelpText]):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneDeserializer::deserialize):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseContent):
(WebCore::CSSParser::realLex):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::extractPseudoType):
(WebCore::CSSSelector::selectorText):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText):
* css/StyleSheetContents.cpp:
(WebCore::childRulesHaveFailedOrCanceledSubresources):
* dom/Node.cpp:
(WebCore::appendTextContent):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
(WebCore::HTMLTreeBuilder::processEndOfFile):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/EventSource.cpp:
(WebCore::EventSource::parseEventStream):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::platformInit):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::totalBytes):
* platform/graphics/win/FullScreenController.cpp:
(FullScreenController::Private::fullscreenClientWndProc):
* platform/text/BidiResolver.h:
(WebCore::Run>::updateStatusLastFromCurrentDirection):
(WebCore::Run>::createBidiRunsForLine):
* platform/text/win/LocaleWin.cpp:
(WebCore::LocaleWin::initializeLocaleData):
* rendering/PointerEventsHitRules.cpp:
(WebCore::PointerEventsHitRules::PointerEventsHitRules):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::newLine):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateFillTileSize):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::drawLineForBoxSide):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::originalText):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::replacedContentRect):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setWordSpacing):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/SVGMarkerData.h:
(WebCore::SVGMarkerData::updateMarkerDataForPathElement):
* svg/SVGPathParser.cpp:
(WebCore::SVGPathParser::parsePathDataFromSource):
* svg/SVGTransformDistance.cpp:
(WebCore::SVGTransformDistance::SVGTransformDistance):
(WebCore::SVGTransformDistance::scaledDistance):
(WebCore::SVGTransformDistance::addSVGTransforms):
(WebCore::SVGTransformDistance::addToSVGTransform):
(WebCore::SVGTransformDistance::distance):
Add annotation or break before falling into a default:break;

Source/WTF:

Reviewed by Ryosuke Niwa.

* wtf/text/WTFString.h:
(WTF::appendNumber):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index 6968a29..ee48a4e 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -1182,9 +1182,9 @@
                 inputObjectStack.append(inArray);
                 indexStack.append(0);
                 lengthStack.append(length);
-                // fallthrough
             }
             arrayStartVisitMember:
+            FALLTHROUGH;
             case ArrayStartVisitMember: {
                 JSObject* array = inputObjectStack.last();
                 uint32_t index = indexStack.last();
@@ -1244,9 +1244,9 @@
                 indexStack.append(0);
                 propertyStack.append(PropertyNameArray(m_exec));
                 inObject->methodTable()->getOwnPropertyNames(inObject, m_exec, propertyStack.last(), ExcludeDontEnumProperties);
-                // fallthrough
             }
             objectStartVisitMember:
+            FALLTHROUGH;
             case ObjectStartVisitMember: {
                 JSObject* object = inputObjectStack.last();
                 uint32_t index = indexStack.last();
@@ -1279,7 +1279,7 @@
                 }
                 if (terminalCode != SuccessfullyCompleted)
                     return terminalCode;
-                // fallthrough
+                FALLTHROUGH;
             }
             case ObjectEndVisitMember: {
                 if (shouldTerminate())
@@ -2317,9 +2317,9 @@
             JSArray* outArray = constructEmptyArray(m_exec, 0, m_globalObject, length);
             m_gcBuffer.append(outArray);
             outputObjectStack.append(outArray);
-            // fallthrough
         }
         arrayStartVisitMember:
+        FALLTHROUGH;
         case ArrayStartVisitMember: {
             uint32_t index;
             if (!read(index)) {
@@ -2358,9 +2358,9 @@
             JSObject* outObject = constructEmptyObject(m_exec, m_globalObject->objectPrototype());
             m_gcBuffer.append(outObject);
             outputObjectStack.append(outObject);
-            // fallthrough
         }
         objectStartVisitMember:
+        FALLTHROUGH;
         case ObjectStartVisitMember: {
             CachedStringRef cachedString;
             bool wasTerminator = false;