WebCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 04:04:52 +0000 (04:04 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 04:04:52 +0000 (04:04 +0000)
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: https://svn.webkit.org/repository/webkit/trunk@162907 268f45cc-cd09-0410-ab3c-d52691b4dbfc

45 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/text/WTFString.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/Base.xcconfig
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSSelector.cpp
Source/WebCore/css/SVGCSSParser.cpp
Source/WebCore/css/StyleProperties.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleSheetContents.cpp
Source/WebCore/css/makeprop.pl [changed mode: 0644->0755]
Source/WebCore/css/makevalues.pl [changed mode: 0644->0755]
Source/WebCore/dom/Node.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/page/EventSource.cpp
Source/WebCore/platform/ColorData.gperf
Source/WebCore/platform/DateComponents.cpp
Source/WebCore/platform/Decimal.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/win/FullScreenController.cpp
Source/WebCore/platform/text/BidiResolver.h
Source/WebCore/platform/text/win/LocaleWin.cpp
Source/WebCore/rendering/AutoTableLayout.cpp
Source/WebCore/rendering/PointerEventsHitRules.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderQuote.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/SVGMarkerData.h
Source/WebCore/svg/SVGPathParser.cpp
Source/WebCore/svg/SVGTransformDistance.cpp

index 7523733..ed864b7 100644 (file)
@@ -1,3 +1,13 @@
+2014-01-27  Joseph Pecoraro  <pecoraro@apple.com>
+
+        WebCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
+        https://bugs.webkit.org/show_bug.cgi?id=127671
+
+        Reviewed by Ryosuke Niwa.
+
+        * wtf/text/WTFString.h:
+        (WTF::appendNumber):
+
 2014-01-27  Jer Noble  <jer.noble@apple.com>
 
         [WK2] callOnMainThread() from main thread sometimes results in ASSERTs.
index cf5a3b5..5c8a0af 100644 (file)
@@ -602,10 +602,12 @@ inline void appendNumber(Vector<CharacterType>& vector, unsigned char number)
     case 3:
         vector[vectorSize + 2] = number % 10 + '0';
         number /= 10;
+        FALLTHROUGH;
 
     case 2:
         vector[vectorSize + 1] = number % 10 + '0';
         number /= 10;
+        FALLTHROUGH;
 
     case 1:
         vector[vectorSize] = number % 10 + '0';
index 461c3e3..f6721e8 100644 (file)
@@ -1,3 +1,125 @@
+2014-01-27  Joseph Pecoraro  <pecoraro@apple.com>
+
+        WebCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
+        https://bugs.webkit.org/show_bug.cgi?id=127671
+
+        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;
+
 2014-01-27  Andreas Kling  <akling@apple.com>
 
         Allow mmap encoded data replacement for WOFF fonts.
index 9c0c5d4..ac8e0d6 100644 (file)
@@ -74,7 +74,7 @@ GCC_WARN_UNUSED_FUNCTION = YES;
 GCC_WARN_UNUSED_VARIABLE = YES;
 LINKER_DISPLAYS_MANGLED_NAMES = YES;
 PREBINDING = NO;
-WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare;
+WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough;
 
 TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
 
index 1b1239d..df3ab87 100644 (file)
@@ -401,6 +401,7 @@ bool AccessibilityNodeObject::canHaveChildren() const
     case LegendRole:
         if (Element* element = this->element())
             return !ancestorsOfType<HTMLFieldSetElement>(*element).first();
+        FALLTHROUGH;
     default:
         return true;
     }
@@ -1337,6 +1338,7 @@ void AccessibilityNodeObject::visibleText(Vector<AccessibilityText>& textOrder)
         // Native popup buttons should not use their button children's text as a title. That value is retrieved through stringValue().
         if (node->hasTagName(selectTag))
             break;
+        FALLTHROUGH;
     case ButtonRole:
     case ToggleButtonRole:
     case CheckBoxRole:
@@ -1712,6 +1714,7 @@ String AccessibilityNodeObject::title() const
         // Native popup buttons should not use their button children's text as a title. That value is retrieved through stringValue().
         if (node->hasTagName(selectTag))
             return String();
+        FALLTHROUGH;
     case ButtonRole:
     case ToggleButtonRole:
     case CheckBoxRole:
index 6db24c7..817e953 100644 (file)
@@ -201,6 +201,7 @@ static NSArray *convertMathPairsToNSArray(const AccessibilityObject::Accessibili
         case ChildrenText:
         case LabelByElementText:
             visibleTextAvailable = true;
+            break;
         default:
             break;
         }
@@ -230,6 +231,7 @@ static NSArray *convertMathPairsToNSArray(const AccessibilityObject::Accessibili
         case ChildrenText:
         case LabelByElementText:
             descriptiveTextAvailable = true;
+            break;
         default:
             break;
         }
index 6968a29..ee48a4e 100644 (file)
@@ -1182,9 +1182,9 @@ SerializationReturnCode CloneSerializer::serialize(JSValue in)
                 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 @@ SerializationReturnCode CloneSerializer::serialize(JSValue in)
                 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 @@ SerializationReturnCode CloneSerializer::serialize(JSValue in)
                 }
                 if (terminalCode != SuccessfullyCompleted)
                     return terminalCode;
-                // fallthrough
+                FALLTHROUGH;
             }
             case ObjectEndVisitMember: {
                 if (shouldTerminate())
@@ -2317,9 +2317,9 @@ DeserializationResult CloneDeserializer::deserialize()
             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 @@ DeserializationResult CloneDeserializer::deserialize()
             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;
index 1cce4f2..d2e0554 100644 (file)
@@ -2297,7 +2297,9 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert
                 return cssValuePool().createValue(style->textEmphasisCustomMark(), CSSPrimitiveValue::CSS_STRING);
             case TextEmphasisMarkAuto:
                 ASSERT_NOT_REACHED();
-                // Fall through
+#if ASSERT_DISABLED
+                FALLTHROUGH;
+#endif
             case TextEmphasisMarkDot:
             case TextEmphasisMarkCircle:
             case TextEmphasisMarkDoubleCircle:
index bbe86f3..3724a42 100644 (file)
@@ -1909,7 +1909,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
             validPrimitive = true;
             break;
         }
-        /* nobreak */
+        FALLTHROUGH;
     case CSSPropertyBackgroundColor: // <color> | inherit
     case CSSPropertyBorderTopColor: // <color> | inherit
     case CSSPropertyBorderRightColor:
@@ -3690,6 +3690,7 @@ bool CSSParser::parseContent(CSSPropertyID propId, bool important)
             case CSSValueNone:
             case CSSValueNormal:
                 parsedValue = cssValuePool().createIdentifierValue(val->id);
+                break;
             default:
                 break;
             }
@@ -10930,13 +10931,14 @@ restartAfterComment:
 
     switch ((m_token <= 127) ? typesOfASCIICharacters[m_token] : CharacterIdentifierStart) {
     case CharacterCaselessU:
-        if (UNLIKELY(*currentCharacter<SrcCharacterType>() == '+'))
+        if (UNLIKELY(*currentCharacter<SrcCharacterType>() == '+')) {
             if (parseUnicodeRange<SrcCharacterType>()) {
                 m_token = UNICODERANGE;
                 yylval->string.init(tokenStart<SrcCharacterType>(), currentCharacter<SrcCharacterType>() - tokenStart<SrcCharacterType>());
                 break;
             }
-        // Fall through to CharacterIdentifierStart.
+        }
+        FALLTHROUGH; // To CharacterIdentifierStart.
 
     case CharacterIdentifierStart:
         --currentCharacter<SrcCharacterType>();
@@ -11011,7 +11013,7 @@ restartAfterComment:
     case CharacterDot:
         if (!isASCIIDigit(currentCharacter<SrcCharacterType>()[0]))
             break;
-        // Fall through to CharacterNumber.
+        FALLTHROUGH; // To CharacterNumber.
 
     case CharacterNumber: {
         bool dotSeen = (m_token == '.');
index 10a886d..3e645ca 100644 (file)
@@ -400,6 +400,7 @@ void CSSSelector::extractPseudoType() const
     case PseudoFirstLetter:
     case PseudoFirstLine:
         compat = true;
+        FALLTHROUGH;
 #if ENABLE(SHADOW_DOM)
     case PseudoDistributed:
 #endif
@@ -642,6 +643,9 @@ String CSSSelector::selectorText(const String& rightSide) const
             return tagHistory->selectorText(" ~ " + str.toString() + rightSide);
         case CSSSelector::SubSelector:
             ASSERT_NOT_REACHED();
+#if ASSERT_DISABLED
+            FALLTHROUGH;
+#endif
         case CSSSelector::ShadowDescendant:
             return tagHistory->selectorText(str.toString() + rightSide);
         }
index 9e52e9c..74f9fb6 100644 (file)
@@ -165,7 +165,8 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
             valid_primitive = true;
             break;
         }
-    /* fallthrough intentional */
+        FALLTHROUGH;
+
     case CSSPropertyGlyphOrientationHorizontal: // <angle> (restricted to _deg_ per SVG 1.1 spec) | inherit
         if (value->unit == CSSPrimitiveValue::CSS_DEG || value->unit == CSSPrimitiveValue::CSS_NUMBER) {
             parsedValue = CSSPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_DEG);
@@ -270,6 +271,7 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
             }
             return false;
         }
+        break;
 
     case CSSPropertyMaskType: // luminance | alpha | inherit
         if (id == CSSValueLuminance || id == CSSValueAlpha)
index 9c14e0d..7245fab 100644 (file)
@@ -810,12 +810,14 @@ String StyleProperties::asText() const
         case CSSPropertyBorderLeftWidth:
             if (!borderFallbackShorthandProperty)
                 borderFallbackShorthandProperty = CSSPropertyBorderWidth;
+            FALLTHROUGH;
         case CSSPropertyBorderTopStyle:
         case CSSPropertyBorderRightStyle:
         case CSSPropertyBorderBottomStyle:
         case CSSPropertyBorderLeftStyle:
             if (!borderFallbackShorthandProperty)
                 borderFallbackShorthandProperty = CSSPropertyBorderStyle;
+            FALLTHROUGH;
         case CSSPropertyBorderTopColor:
         case CSSPropertyBorderRightColor:
         case CSSPropertyBorderBottomColor:
index 13563ee..ccf7c67 100644 (file)
@@ -2225,7 +2225,9 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
             }
             if (!didSet)
                 state.style()->setContentAltText(emptyAtom);
+            return;
         }
+        
     case CSSPropertyQuotes:
         if (isInherit) {
             state.style()->setQuotes(state.parentStyle()->quotes());
index 9a3849c..5f5a0d1 100644 (file)
@@ -456,6 +456,9 @@ static bool childRulesHaveFailedOrCanceledSubresources(const Vector<RefPtr<Style
 #endif
         case StyleRuleBase::Import:
             ASSERT_NOT_REACHED();
+#if ASSERT_DISABLED
+            FALLTHROUGH;
+#endif
         case StyleRuleBase::Page:
         case StyleRuleBase::Keyframes:
         case StyleRuleBase::Unknown:
old mode 100644 (file)
new mode 100755 (executable)
index 059ccfc..726a194
@@ -102,6 +102,7 @@ print GPERF << "EOF";
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored \"-Wunknown-pragmas\"
 #pragma clang diagnostic ignored \"-Wdeprecated-register\"
+#pragma clang diagnostic ignored \"-Wimplicit-fallthrough\"
 #endif
 
 namespace WebCore {
old mode 100644 (file)
new mode 100755 (executable)
index 680718b..98ca601
@@ -70,6 +70,7 @@ print GPERF << "EOF";
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored \"-Wunknown-pragmas\"
 #pragma clang diagnostic ignored \"-Wdeprecated-register\"
+#pragma clang diagnostic ignored \"-Wimplicit-fallthrough\"
 #endif
 
 namespace WebCore {
index d9c51fa..0db540b 100644 (file)
@@ -1303,7 +1303,7 @@ static void appendTextContent(const Node* node, bool convertBRsToNewlines, bool&
             content.append('\n');
             break;
         }
-    // Fall through.
+        FALLTHROUGH;
     case Node::ATTRIBUTE_NODE:
     case Node::ENTITY_NODE:
     case Node::ENTITY_REFERENCE_NODE:
index 75273f3..ce850b7 100644 (file)
@@ -1099,7 +1099,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
     case InsertionMode::Initial:
         ASSERT(insertionMode() == InsertionMode::Initial);
         defaultForInitial();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::BeforeHTML:
         ASSERT(insertionMode() == InsertionMode::BeforeHTML);
         if (token->name() == htmlTag) {
@@ -1108,7 +1108,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
             return;
         }
         defaultForBeforeHTML();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::BeforeHead:
         ASSERT(insertionMode() == InsertionMode::BeforeHead);
         if (token->name() == htmlTag) {
@@ -1121,13 +1121,13 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
             return;
         }
         defaultForBeforeHead();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::InHead:
         ASSERT(insertionMode() == InsertionMode::InHead);
         if (processStartTagForInHead(token))
             return;
         defaultForInHead();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::AfterHead:
         ASSERT(insertionMode() == InsertionMode::AfterHead);
         if (token->name() == htmlTag) {
@@ -1169,7 +1169,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
             return;
         }
         defaultForAfterHead();
-        // Fall through
+        FALLTHROUGH;
     case InsertionMode::InBody:
         ASSERT(insertionMode() == InsertionMode::InBody);
         processStartTagForInBody(token);
@@ -1371,7 +1371,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
             processStartTag(token);
             return;
         }
-        // Fall through
+        FALLTHROUGH;
     case InsertionMode::InSelect:
         ASSERT(insertionMode() == InsertionMode::InSelect || insertionMode() == InsertionMode::InSelectInTable);
         if (token->name() == htmlTag) {
@@ -2049,7 +2049,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
     case InsertionMode::Initial:
         ASSERT(insertionMode() == InsertionMode::Initial);
         defaultForInitial();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::BeforeHTML:
         ASSERT(insertionMode() == InsertionMode::BeforeHTML);
         if (token->name() != headTag && token->name() != bodyTag && token->name() != htmlTag && token->name() != brTag) {
@@ -2057,7 +2057,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
             return;
         }
         defaultForBeforeHTML();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::BeforeHead:
         ASSERT(insertionMode() == InsertionMode::BeforeHead);
         if (token->name() != headTag && token->name() != bodyTag && token->name() != htmlTag && token->name() != brTag) {
@@ -2065,7 +2065,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
             return;
         }
         defaultForBeforeHead();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::InHead:
         ASSERT(insertionMode() == InsertionMode::InHead);
         // FIXME: This case should be broken out into processEndTagForInHead,
@@ -2087,7 +2087,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
             return;
         }
         defaultForInHead();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::AfterHead:
         ASSERT(insertionMode() == InsertionMode::AfterHead);
         if (token->name() != bodyTag && token->name() != htmlTag && token->name() != brTag) {
@@ -2095,7 +2095,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
             return;
         }
         defaultForAfterHead();
-        // Fall through
+        FALLTHROUGH;
     case InsertionMode::InBody:
         ASSERT(insertionMode() == InsertionMode::InBody);
         processEndTagForInBody(token);
@@ -2175,7 +2175,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
             setInsertionMode(InsertionMode::AfterAfterBody);
             return;
         }
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::AfterAfterBody:
         ASSERT(insertionMode() == InsertionMode::AfterBody || insertionMode() == InsertionMode::AfterAfterBody);
         parseError(token);
@@ -2250,7 +2250,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
             setInsertionMode(InsertionMode::AfterAfterFrameset);
             return;
         }
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::AfterAfterFrameset:
         ASSERT(insertionMode() == InsertionMode::AfterFrameset || insertionMode() == InsertionMode::AfterAfterFrameset);
         parseError(token);
@@ -2270,7 +2270,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
             }
             return;
         }
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::InSelect:
         ASSERT(insertionMode() == InsertionMode::InSelect || insertionMode() == InsertionMode::InSelectInTable);
         if (token->name() == optgroupTag) {
@@ -2475,7 +2475,7 @@ ReprocessBuffer:
         if (buffer.isEmpty())
             return;
         defaultForInitial();
-        // Fall through.
+        FALLTHROUGH;
     }
     case InsertionMode::BeforeHTML: {
         ASSERT(insertionMode() == InsertionMode::BeforeHTML);
@@ -2483,7 +2483,7 @@ ReprocessBuffer:
         if (buffer.isEmpty())
             return;
         defaultForBeforeHTML();
-        // Fall through.
+        FALLTHROUGH;
     }
     case InsertionMode::BeforeHead: {
         ASSERT(insertionMode() == InsertionMode::BeforeHead);
@@ -2491,7 +2491,7 @@ ReprocessBuffer:
         if (buffer.isEmpty())
             return;
         defaultForBeforeHead();
-        // Fall through.
+        FALLTHROUGH;
     }
     case InsertionMode::InHead: {
         ASSERT(insertionMode() == InsertionMode::InHead);
@@ -2501,7 +2501,7 @@ ReprocessBuffer:
         if (buffer.isEmpty())
             return;
         defaultForInHead();
-        // Fall through.
+        FALLTHROUGH;
     }
     case InsertionMode::AfterHead: {
         ASSERT(insertionMode() == InsertionMode::AfterHead);
@@ -2511,7 +2511,7 @@ ReprocessBuffer:
         if (buffer.isEmpty())
             return;
         defaultForAfterHead();
-        // Fall through.
+        FALLTHROUGH;
     }
     case InsertionMode::InBody:
     case InsertionMode::InCaption:
@@ -2545,7 +2545,7 @@ ReprocessBuffer:
             processCharacterBufferForInBody(buffer);
             break;
         }
-        // Fall through.
+        FALLTHROUGH;
     }
     case InsertionMode::InTableText: {
         buffer.giveRemainingTo(m_pendingTableCharacters);
@@ -2644,23 +2644,23 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken* token)
     case InsertionMode::Initial:
         ASSERT(insertionMode() == InsertionMode::Initial);
         defaultForInitial();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::BeforeHTML:
         ASSERT(insertionMode() == InsertionMode::BeforeHTML);
         defaultForBeforeHTML();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::BeforeHead:
         ASSERT(insertionMode() == InsertionMode::BeforeHead);
         defaultForBeforeHead();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::InHead:
         ASSERT(insertionMode() == InsertionMode::InHead);
         defaultForInHead();
-        // Fall through.
+        FALLTHROUGH;
     case InsertionMode::AfterHead:
         ASSERT(insertionMode() == InsertionMode::AfterHead);
         defaultForAfterHead();
-        // Fall through
+        FALLTHROUGH;
     case InsertionMode::InBody:
     case InsertionMode::InCell:
     case InsertionMode::InCaption:
@@ -2702,7 +2702,7 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken* token)
         ASSERT(m_tree.currentNode()->hasTagName(colgroupTag));
 #endif
         processColgroupEndTagForInColumnGroup();
-        // Fall through
+        FALLTHROUGH;
     case InsertionMode::InFrameset:
     case InsertionMode::InTable:
     case InsertionMode::InTableBody:
index 1405509..efbdbe5 100644 (file)
@@ -443,7 +443,7 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::requestResource(Cache
     switch (policy) {
     case Reload:
         memoryCache()->remove(resource.get());
-        // Fall through
+        FALLTHROUGH;
     case Load:
         resource = loadResource(type, request, request.charset());
         break;
index 68c0e6e..4ccfbe3 100644 (file)
@@ -336,6 +336,7 @@ void EventSource::parseEventStream()
                 break;
             case '\r':
                 m_discardTrailingNewline = true;
+                FALLTHROUGH;
             case '\n':
                 lineLength = i - bufPos;
                 break;
index e38547d..141b28b 100644 (file)
@@ -6,6 +6,7 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunknown-pragmas"
 #pragma clang diagnostic ignored "-Wdeprecated-register"
+#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
 #endif
 
 namespace WebCore {
index b092f88..db70788 100644 (file)
@@ -689,7 +689,9 @@ String DateComponents::toStringForTime(SecondFormat format) const
     switch (effectiveFormat) {
     default:
         ASSERT_NOT_REACHED();
-        // Fallback to None.
+#if ASSERT_DISABLED
+        FALLTHROUGH; // To None.
+#endif
     case None:
         return String::format("%02d:%02d", m_hour, m_minute);
     case Second:
index 624c3c5..ee20db5 100644 (file)
@@ -753,6 +753,8 @@ Decimal Decimal::fromString(const String& str)
                 state = StateDotDigit;
                 break;
             }
+            // FIXME: <http://webkit.org/b/127667> Decimal::fromString's EBNF documentation does not match implementation
+            FALLTHROUGH;
 
         case StateDotDigit:
             if (ch >= '0' && ch <= '9') {
index c407d0e..d0720c5 100644 (file)
@@ -538,6 +538,7 @@ void MediaPlayerPrivateAVFoundation::updateStates()
                 // If the readyState is already HaveEnoughData, don't go lower because of this state change.
                 if (m_readyState == MediaPlayer::HaveEnoughData)
                     break;
+                FALLTHROUGH;
 
             case MediaPlayerAVPlayerItemStatusPlaybackBufferEmpty:
                 if (maxTimeLoaded() > currentTime())
index f11db6e..b857899 100644 (file)
@@ -1752,6 +1752,7 @@ void GraphicsContext::setPlatformCompositeOperation(CompositeOperator mode, Blen
             break;
         case BlendModeLuminosity:
             target = kCGBlendModeLuminosity;
+            break;
         default:
             break;
         }
index c4a0fd8..14c558f 100644 (file)
@@ -1257,7 +1257,7 @@ unsigned MediaPlayerPrivateGStreamer::totalBytes() const
             gst_iterator_resync(iter);
             break;
         case GST_ITERATOR_ERROR:
-            // Fall through.
+            FALLTHROUGH;
         case GST_ITERATOR_DONE:
             done = true;
             break;
index a3adeae..e849007 100644 (file)
@@ -94,7 +94,7 @@ LRESULT FullScreenController::Private::fullscreenClientWndProc(HWND hwnd, UINT m
             m_controller->exitFullScreen();
             break;
         }
-        // Fall through.
+        FALLTHROUGH;
     default:
         lResult = ::DefWindowProc(hwnd, msg, wParam, lParam);
     }
index db8fd0a..c8841a6 100644 (file)
@@ -514,7 +514,7 @@ inline void BidiResolver<Iterator, Run>::updateStatusLastFromCurrentDirection(UC
         // ignore these
         break;
     case U_EUROPEAN_NUMBER:
-        // fall through
+        FALLTHROUGH;
     default:
         m_status.last = dirCurrent;
     }
@@ -687,6 +687,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                         }
                         appendRun();
                     }
+                    break;
                 default:
                     break;
             }
@@ -702,6 +703,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                 case U_EUROPEAN_NUMBER:
                 case U_ARABIC_NUMBER:
                     appendRun();
+                    FALLTHROUGH;
                 case U_RIGHT_TO_LEFT:
                 case U_RIGHT_TO_LEFT_ARABIC:
                     break;
@@ -724,6 +726,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                             m_eor = m_last;
                         appendRun();
                     }
+                    break;
                 default:
                     break;
             }
@@ -753,6 +756,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                     case U_COMMON_NUMBER_SEPARATOR:
                         if (m_status.eor == U_EUROPEAN_NUMBER)
                             break;
+                        FALLTHROUGH;
                     case U_EUROPEAN_NUMBER_TERMINATOR:
                     case U_BOUNDARY_NEUTRAL:
                     case U_BLOCK_SEPARATOR:
@@ -790,6 +794,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                             // Begin a new EN run.
                             m_direction = U_EUROPEAN_NUMBER;
                         }
+                        break;
                     default:
                         break;
                 }
@@ -799,6 +804,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                     m_direction = U_LEFT_TO_RIGHT;
                 break;
             }
+            FALLTHROUGH;
         case U_ARABIC_NUMBER:
             dirCurrent = U_ARABIC_NUMBER;
             switch (m_status.last) {
@@ -817,6 +823,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                 case U_COMMON_NUMBER_SEPARATOR:
                     if (m_status.eor == U_ARABIC_NUMBER)
                         break;
+                    FALLTHROUGH;
                 case U_EUROPEAN_NUMBER_SEPARATOR:
                 case U_EUROPEAN_NUMBER_TERMINATOR:
                 case U_BOUNDARY_NEUTRAL:
@@ -835,6 +842,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
                         m_direction = m_status.lastStrong == U_LEFT_TO_RIGHT ? U_LEFT_TO_RIGHT : U_RIGHT_TO_LEFT;
                     m_eor = m_last;
                     appendRun();
+                    break;
                 default:
                     break;
             }
index 54fc5ff..707a553 100644 (file)
@@ -523,7 +523,8 @@ void LocaleWin::initializeLocaleData()
     case NegativeFormatSpaceSignSuffix:
         negativeSuffix = " " + negativeSign;
         break;
-    case NegativeFormatSignPrefix: // Fall through.
+    case NegativeFormatSignPrefix:
+        FALLTHROUGH;
     default:
         negativePrefix = negativeSign;
         break;
index b20078a..4cd8f87 100644 (file)
@@ -116,6 +116,7 @@ void AutoTableLayout::recalcColumn(unsigned effCol)
                         // which are not necessarily of the same type.
                         if (cellLogicalWidth.value() > columnLayout.logicalWidth.value())
                             columnLayout.logicalWidth = cellLogicalWidth;
+                        break;
                     default:
                         break;
                     }
@@ -309,10 +310,10 @@ int AutoTableLayout::calcEffectiveLogicalWidth()
                     // legacy behaviour anyway. mozilla doesn't do this so I decided we don't neither.
                     break;
                 }
-                // fall through
+                FALLTHROUGH;
             case Auto:
                 haveAuto = true;
-                // fall through
+                FALLTHROUGH;
             default:
                 // If the column is a percentage width, do not let the spanning cell overwrite the
                 // width value.  This caused a mis-rendering on amazon.com.
@@ -520,7 +521,6 @@ void AutoTableLayout::layout()
         case Fixed:
             numFixed++;
             totalFixed += m_layoutStruct[i].effectiveMaxLogicalWidth;
-            // fall through
             break;
         case Auto:
             if (m_layoutStruct[i].emptyCellsOnly)
index cc5aae4..45fa8d1 100644 (file)
@@ -39,6 +39,7 @@ PointerEventsHitRules::PointerEventsHitRules(EHitTesting hitTesting, const HitTe
             case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content
                 requireFill = true;
                 requireStroke = true;
+                FALLTHROUGH;
             case PE_VISIBLE:
                 requireVisible = true;
                 canHitFill = true;
@@ -55,6 +56,7 @@ PointerEventsHitRules::PointerEventsHitRules(EHitTesting hitTesting, const HitTe
             case PE_PAINTED:
                 requireFill = true;
                 requireStroke = true;
+                FALLTHROUGH;
             case PE_ALL:
                 canHitFill = true;
                 canHitStroke = true;
index a8f1847..9e9c962 100644 (file)
@@ -2370,6 +2370,7 @@ void RenderBlockFlow::newLine(EClear clear)
         break;
     case CBOTH:
         newY = lowestFloatLogicalBottom();
+        break;
     default:
         break;
     }
index 622624c..e469408 100644 (file)
@@ -602,7 +602,7 @@ void RenderBlockFlow::updateLogicalWidthForAlignment(const ETextAlign& textAlign
             }
             break;
         }
-        // Fall through
+        FALLTHROUGH;
     case TASTART:
         if (style().isLeftToRightDirection())
             updateLogicalWidthForLeftAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
index 68af416..76ee6a0 100644 (file)
@@ -2860,7 +2860,7 @@ LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(Length logicalWidth) cons
             if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercent())))
                 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw));
         }
-        // fall through
+        FALLTHROUGH;
         case Intrinsic:
         case MinIntrinsic:
         case Auto:
index 087803f..767fa91 100644 (file)
@@ -979,6 +979,7 @@ IntSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer,
             // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for ‘contain’.
             type = Contain;
         }
+        FALLTHROUGH;
         case Contain:
         case Cover: {
             float horizontalScaleFactor = imageIntrinsicSize.width()
index d1fc65a..c30b525 100644 (file)
@@ -908,11 +908,11 @@ void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, int x1,
             // https://bugs.webkit.org/show_bug.cgi?id=58608
             if (side == BSTop || side == BSLeft)
                 color = color.dark();
-            // fall through
+            FALLTHROUGH;
         case OUTSET:
             if (borderStyle == OUTSET && (side == BSBottom || side == BSRight))
                 color = color.dark();
-            // fall through
+            FALLTHROUGH;
         case SOLID: {
             StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
             graphicsContext->setStrokeStyle(NoStroke);
index 8c1fdad..52fa63c 100644 (file)
@@ -347,7 +347,7 @@ String RenderQuote::originalText() const
         return emptyString();
     case OPEN_QUOTE:
         isOpenQuote = true;
-        // fall through
+        FALLTHROUGH;
     case CLOSE_QUOTE:
         if (const QuotesData* quotes = style().quotes())
             return isOpenQuote ? quotes->openQuote(m_depth).impl() : quotes->closeQuote(m_depth).impl();
index d81b6cb..8481bd8 100644 (file)
@@ -329,7 +329,7 @@ LayoutRect RenderReplaced::replacedContentRect(const LayoutSize& intrinsicSize)
         finalRect.setSize(finalRect.size().fitToAspectRatio(intrinsicSize, objectFit == ObjectFitCover ? AspectRatioFitGrow : AspectRatioFitShrink));
         if (objectFit != ObjectFitScaleDown || finalRect.width() <= intrinsicSize.width())
             break;
-        // fall through
+        FALLTHROUGH;
     case ObjectFitNone:
         finalRect.setSize(intrinsicSize);
         break;
index 981eb40..59b843f 100644 (file)
@@ -159,7 +159,7 @@ void RenderTable::addChild(RenderObject* child, RenderObject* beforeChild)
                     wrapInAnonymousSection = false;
                     break;
                 }
-                // Fall through.
+                FALLTHROUGH;
             case TABLE_ROW_GROUP:
                 resetSectionPointerIfNotBefore(m_firstBody, beforeChild);
                 if (!m_firstBody)
index 598c5fe..8595c32 100644 (file)
@@ -181,6 +181,7 @@ void RenderTheme::adjustStyle(StyleResolver& styleResolver, RenderStyle& style,
                 style.font().update(0);
         }
     }
+    break;
     default:
         break;
     }
index 7f6fa5e..f171803 100644 (file)
@@ -1456,6 +1456,7 @@ void RenderStyle::setWordSpacing(Length v)
     switch (v.type()) {
     case Auto:
         fontWordSpacing = 0;
+        FALLTHROUGH;
     case Percent:
         fontWordSpacing = v.getFloatValue() * font().spaceWidth() / 100;
         break;
index 0b4e59d..d9e1d83 100644 (file)
@@ -85,6 +85,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
     case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR:
     case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR:
         color = applyToFill ? svgStyle.fillPaintColor() : svgStyle.strokePaintColor();
+        break;
     default:
         break;
     }
index 6c70f42..5d5a86d 100644 (file)
@@ -127,6 +127,7 @@ private:
             break;
         case PathElementMoveToPoint:
             m_subpathStart = points[0];
+            FALLTHROUGH;
         case PathElementAddLineToPoint:
             updateInslope(points[0]);
             m_origin = points[0];
index 0fcb9f9..9f465ee 100644 (file)
@@ -314,24 +314,28 @@ bool SVGPathParser::parsePathDataFromSource(PathParsingMode pathParsingMode, boo
         switch (command) {
         case PathSegMoveToRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegMoveToAbs:
             if (!parseMoveToSegment())
                 return false;
             break;
         case PathSegLineToRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegLineToAbs:
             if (!parseLineToSegment())
                 return false;
             break;
         case PathSegLineToHorizontalRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegLineToHorizontalAbs:
             if (!parseLineToHorizontalSegment())
                 return false;
             break;
         case PathSegLineToVerticalRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegLineToVerticalAbs:
             if (!parseLineToVerticalSegment())
                 return false;
@@ -341,30 +345,35 @@ bool SVGPathParser::parsePathDataFromSource(PathParsingMode pathParsingMode, boo
             break;
         case PathSegCurveToCubicRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegCurveToCubicAbs:
             if (!parseCurveToCubicSegment())
                 return false;
             break;
         case PathSegCurveToCubicSmoothRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegCurveToCubicSmoothAbs:
             if (!parseCurveToCubicSmoothSegment())
                 return false;
             break;
         case PathSegCurveToQuadraticRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegCurveToQuadraticAbs:
             if (!parseCurveToQuadraticSegment())
                 return false;
             break;
         case PathSegCurveToQuadraticSmoothRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegCurveToQuadraticSmoothAbs:
             if (!parseCurveToQuadraticSmoothSegment())
                 return false;
             break;
         case PathSegArcRel:
             m_mode = RelativeCoordinates;
+            FALLTHROUGH;
         case PathSegArcAbs:
             if (!parseArcToSegment())
                 return false;
index 80abee3..85b3a27 100644 (file)
@@ -58,6 +58,9 @@ SVGTransformDistance::SVGTransformDistance(const SVGTransform& fromSVGTransform,
     switch (m_type) {
     case SVGTransform::SVG_TRANSFORM_MATRIX:
         ASSERT_NOT_REACHED();
+#if ASSERT_DISABLED
+        FALLTHROUGH;
+#endif
     case SVGTransform::SVG_TRANSFORM_UNKNOWN:
         break;
     case SVGTransform::SVG_TRANSFORM_ROTATE: {
@@ -90,6 +93,9 @@ SVGTransformDistance SVGTransformDistance::scaledDistance(float scaleFactor) con
     switch (m_type) {
     case SVGTransform::SVG_TRANSFORM_MATRIX:
         ASSERT_NOT_REACHED();
+#if ASSERT_DISABLED
+        FALLTHROUGH;
+#endif
     case SVGTransform::SVG_TRANSFORM_UNKNOWN:
         return SVGTransformDistance();
     case SVGTransform::SVG_TRANSFORM_ROTATE:
@@ -120,6 +126,9 @@ SVGTransform SVGTransformDistance::addSVGTransforms(const SVGTransform& first, c
     switch (first.type()) {
     case SVGTransform::SVG_TRANSFORM_MATRIX:
         ASSERT_NOT_REACHED();
+#if ASSERT_DISABLED
+        FALLTHROUGH;
+#endif
     case SVGTransform::SVG_TRANSFORM_UNKNOWN:
         return SVGTransform();
     case SVGTransform::SVG_TRANSFORM_ROTATE: {
@@ -159,6 +168,9 @@ SVGTransform SVGTransformDistance::addToSVGTransform(const SVGTransform& transfo
     switch (m_type) {
     case SVGTransform::SVG_TRANSFORM_MATRIX:
         ASSERT_NOT_REACHED();
+#if ASSERT_DISABLED
+        FALLTHROUGH;
+#endif
     case SVGTransform::SVG_TRANSFORM_UNKNOWN:
         return SVGTransform();
     case SVGTransform::SVG_TRANSFORM_TRANSLATE: {
@@ -200,6 +212,9 @@ float SVGTransformDistance::distance() const
     switch (m_type) {
     case SVGTransform::SVG_TRANSFORM_MATRIX:
         ASSERT_NOT_REACHED();
+#if ASSERT_DISABLED
+        FALLTHROUGH;
+#endif
     case SVGTransform::SVG_TRANSFORM_UNKNOWN:
         return 0;
     case SVGTransform::SVG_TRANSFORM_ROTATE: