Bug 1424548 - Part 11: Regenerate HTML parser code with MOZ_FALLTHROUGH annotations. r=hsivonen
authorChris Peterson <cpeterson@mozilla.com>
Fri, 01 Dec 2017 01:05:26 -0800
changeset 397348 7ea2b1f67e085452228710d80ecda4f15f5b0ff3
parent 397347 091d01097937d8a543f5bf1242533e4ac42e1c64
child 397349 1fcbcdfba8e5e316278dff808f996eb70ab0daa1
push id33133
push usershindli@mozilla.com
push dateFri, 22 Dec 2017 21:42:06 +0000
treeherdermozilla-central@10aa75f277af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs1424548
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1424548 - Part 11: Regenerate HTML parser code with MOZ_FALLTHROUGH annotations. r=hsivonen And stop suppressing -Wimplicit-fallthrough warnings. We no longer need to suppress these clang warnings because the generated parser code now includes MOZ_FALLTHROUGH annotations.
parser/html/javasrc/MetaScanner.java
parser/html/javasrc/Tokenizer.java
parser/html/javasrc/TreeBuilder.java
parser/html/moz.build
parser/html/nsHtml5MetaScanner.cpp
parser/html/nsHtml5Tokenizer.cpp
parser/html/nsHtml5TreeBuilder.cpp
--- a/parser/html/javasrc/MetaScanner.java
+++ b/parser/html/javasrc/MetaScanner.java
@@ -227,17 +227,17 @@ public abstract class MetaScanner {
                             case '<':
                                 state = MetaScanner.TAG_OPEN;
                                 break dataloop; // FALL THROUGH continue
                             // stateloop;
                             default:
                                 continue;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case TAG_OPEN:
                     tagopenloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case 'm':
                             case 'M':
@@ -262,17 +262,17 @@ public abstract class MetaScanner {
                                     break tagopenloop;
                                     // continue stateloop;
                                 }
                                 state = MetaScanner.DATA;
                                 reconsume = true;
                                 continue stateloop;
                         }
                     }
-                    // FALL THROUGH DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case TAG_NAME:
                     tagnameloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case ' ':
                             case '\t':
@@ -311,17 +311,17 @@ public abstract class MetaScanner {
                                     metaState = NO;
                                 }
                                 continue;
                             default:
                                 metaState = NO;
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BEFORE_ATTRIBUTE_NAME:
                     beforeattributenameloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             c = read();
                         }
                         /*
@@ -365,17 +365,17 @@ public abstract class MetaScanner {
                                 charsetIndex = Integer.MAX_VALUE;
                                 httpEquivIndex = Integer.MAX_VALUE;
                                 contentTypeIndex = Integer.MAX_VALUE;
                                 state = MetaScanner.ATTRIBUTE_NAME;
                                 break beforeattributenameloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case ATTRIBUTE_NAME:
                     attributenameloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case ' ':
                             case '\t':
@@ -417,17 +417,17 @@ public abstract class MetaScanner {
                                         ++httpEquivIndex;
                                     } else {
                                         httpEquivIndex = Integer.MAX_VALUE;
                                     }
                                 }
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BEFORE_ATTRIBUTE_VALUE:
                     beforeattributevalueloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case ' ':
                             case '\t':
@@ -448,17 +448,17 @@ public abstract class MetaScanner {
                                 state = MetaScanner.DATA;
                                 continue stateloop;
                             default:
                                 handleCharInAttributeValue(c);
                                 state = MetaScanner.ATTRIBUTE_VALUE_UNQUOTED;
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case ATTRIBUTE_VALUE_DOUBLE_QUOTED:
                     attributevaluedoublequotedloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             c = read();
                         }
                         switch (c) {
@@ -469,17 +469,17 @@ public abstract class MetaScanner {
                                 state = MetaScanner.AFTER_ATTRIBUTE_VALUE_QUOTED;
                                 break attributevaluedoublequotedloop;
                             // continue stateloop;
                             default:
                                 handleCharInAttributeValue(c);
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case AFTER_ATTRIBUTE_VALUE_QUOTED:
                     afterattributevaluequotedloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case ' ':
                             case '\t':
@@ -498,34 +498,33 @@ public abstract class MetaScanner {
                                 state = MetaScanner.DATA;
                                 continue stateloop;
                             default:
                                 state = MetaScanner.BEFORE_ATTRIBUTE_NAME;
                                 reconsume = true;
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SELF_CLOSING_START_TAG:
                     c = read();
                     switch (c) {
                         case -1:
                             break stateloop;
                         case '>':
                             if (handleTag()) {
                                 break stateloop;
                             }
                             state = MetaScanner.DATA;
                             continue stateloop;
                         default:
                             state = MetaScanner.BEFORE_ATTRIBUTE_NAME;
                             reconsume = true;
                             continue stateloop;
                     }
-                    // XXX reorder point
                 case ATTRIBUTE_VALUE_UNQUOTED:
                     for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             c = read();
                         }
                         switch (c) {
@@ -546,17 +545,16 @@ public abstract class MetaScanner {
                                 }
                                 state = MetaScanner.DATA;
                                 continue stateloop;
                             default:
                                 handleCharInAttributeValue(c);
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case AFTER_ATTRIBUTE_NAME:
                     for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case ' ':
                             case '\t':
@@ -587,51 +585,50 @@ public abstract class MetaScanner {
                                 continue stateloop;
                             default:
                                 contentIndex = Integer.MAX_VALUE;
                                 charsetIndex = Integer.MAX_VALUE;
                                 state = MetaScanner.ATTRIBUTE_NAME;
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case MARKUP_DECLARATION_OPEN:
                     markupdeclarationopenloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case '-':
                                 state = MetaScanner.MARKUP_DECLARATION_HYPHEN;
                                 break markupdeclarationopenloop;
                             // continue stateloop;
                             default:
                                 state = MetaScanner.SCAN_UNTIL_GT;
                                 reconsume = true;
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case MARKUP_DECLARATION_HYPHEN:
                     markupdeclarationhyphenloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case '-':
                                 state = MetaScanner.COMMENT_START;
                                 break markupdeclarationhyphenloop;
                             // continue stateloop;
                             default:
                                 state = MetaScanner.SCAN_UNTIL_GT;
                                 reconsume = true;
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT_START:
                     commentstartloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case '-':
                                 state = MetaScanner.COMMENT_START_DASH;
@@ -640,81 +637,79 @@ public abstract class MetaScanner {
                                 state = MetaScanner.DATA;
                                 continue stateloop;
                             default:
                                 state = MetaScanner.COMMENT;
                                 break commentstartloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT:
                     commentloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case '-':
                                 state = MetaScanner.COMMENT_END_DASH;
                                 break commentloop;
                             // continue stateloop;
                             default:
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT_END_DASH:
                     commentenddashloop: for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case '-':
                                 state = MetaScanner.COMMENT_END;
                                 break commentenddashloop;
                             // continue stateloop;
                             default:
                                 state = MetaScanner.COMMENT;
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT_END:
                     for (;;) {
                         c = read();
                         switch (c) {
                             case -1:
                                 break stateloop;
                             case '>':
                                 state = MetaScanner.DATA;
                                 continue stateloop;
                             case '-':
                                 continue;
                             default:
                                 state = MetaScanner.COMMENT;
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case COMMENT_START_DASH:
                     c = read();
                     switch (c) {
                         case -1:
                             break stateloop;
                         case '-':
                             state = MetaScanner.COMMENT_END;
                             continue stateloop;
                         case '>':
                             state = MetaScanner.DATA;
                             continue stateloop;
                         default:
                             state = MetaScanner.COMMENT;
                             continue stateloop;
                     }
-                    // XXX reorder point
                 case ATTRIBUTE_VALUE_SINGLE_QUOTED:
                     for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             c = read();
                         }
                         switch (c) {
@@ -724,17 +719,16 @@ public abstract class MetaScanner {
                                 handleAttributeValue();
                                 state = MetaScanner.AFTER_ATTRIBUTE_VALUE_QUOTED;
                                 continue stateloop;
                             default:
                                 handleCharInAttributeValue(c);
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case SCAN_UNTIL_GT:
                     for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             c = read();
                         }
                         switch (c) {
--- a/parser/html/javasrc/Tokenizer.java
+++ b/parser/html/javasrc/Tokenizer.java
@@ -927,17 +927,17 @@ public class Tokenizer implements Locato
         }
     }
 
     @Inline private void appendSecondHyphenToBogusComment() throws SAXException {
         // [NOCPP[
         switch (commentPolicy) {
             case ALTER_INFOSET:
                 appendStrBuf(' ');
-                // FALLTHROUGH
+                // CPPONLY: MOZ_FALLTHROUGH;
             case ALLOW:
                 warn("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment.");
                 // ]NOCPP]
                 appendStrBuf('-');
                 // [NOCPP[
                 break;
             case FATAL:
                 fatal("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment.");
@@ -946,17 +946,17 @@ public class Tokenizer implements Locato
         // ]NOCPP]
     }
 
     // [NOCPP[
     private void maybeAppendSpaceToBogusComment() throws SAXException {
         switch (commentPolicy) {
             case ALTER_INFOSET:
                 appendStrBuf(' ');
-                // FALLTHROUGH
+                // CPPONLY: MOZ_FALLTHROUGH;
             case ALLOW:
                 warn("The document is not mappable to XML 1.0 due to a trailing hyphen in a comment.");
                 break;
             case FATAL:
                 fatal("The document is not mappable to XML 1.0 due to a trailing hyphen in a comment.");
                 break;
         }
     }
@@ -969,17 +969,17 @@ public class Tokenizer implements Locato
         // [NOCPP[
         switch (commentPolicy) {
             case ALTER_INFOSET:
                 strBufLen--;
                 // WARNING!!! This expands the worst case of the buffer length
                 // given the length of input!
                 appendStrBuf(' ');
                 appendStrBuf('-');
-                // FALLTHROUGH
+                // CPPONLY: MOZ_FALLTHROUGH;
             case ALLOW:
                 warn("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment.");
                 // ]NOCPP]
                 appendStrBuf(c);
                 // [NOCPP[
                 break;
             case FATAL:
                 fatal("The document is not mappable to XML 1.0 due to two consecutive hyphens in a comment.");
@@ -1544,27 +1544,28 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the input character as a
                                  * character token.
                                  *
                                  * Stay in the data state.
                                  */
                                 continue;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case TAG_OPEN:
                     tagopenloop: for (;;) {
                         /*
                          * The behavior of this state depends on the content
                          * model flag.
                          */
                         if (++pos == endPos) {
                             break stateloop;
@@ -1682,17 +1683,17 @@ public class Tokenizer implements Locato
                                  * the data state.
                                  */
                                 cstart = pos;
                                 reconsume = true;
                                 state = transition(state, Tokenizer.DATA, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALL THROUGH DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case TAG_NAME:
                     tagnameloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -1700,16 +1701,17 @@ public class Tokenizer implements Locato
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 strBufToElementNameString();
                                 state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the before attribute name state.
                                  */
@@ -1736,17 +1738,17 @@ public class Tokenizer implements Locato
                                     break stateloop;
                                 }
                                 /*
                                  * Switch to the data state.
                                  */
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 if (c >= 'A' && c <= 'Z') {
                                     /*
                                      * U+0041 LATIN CAPITAL LETTER A through to
                                      * U+005A LATIN CAPITAL LETTER Z Append the
                                      * lowercase version of the current input
                                      * character (add 0x0020 to the character's
                                      * code point) to the current tag token's
@@ -1763,17 +1765,17 @@ public class Tokenizer implements Locato
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the tag name state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BEFORE_ATTRIBUTE_NAME:
                     beforeattributenameloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -1783,17 +1785,17 @@ public class Tokenizer implements Locato
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the before attribute name state.
                                  */
@@ -1815,31 +1817,32 @@ public class Tokenizer implements Locato
                                     break stateloop;
                                 }
                                 /*
                                  * Switch to the data state.
                                  */
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case '\"':
                             case '\'':
                             case '<':
                             case '=':
                                 /*
                                  * U+0022 QUOTATION MARK (") U+0027 APOSTROPHE
                                  * (') U+003C LESS-THAN SIGN (<) U+003D EQUALS
                                  * SIGN (=) Parse error.
                                  */
                                 errBadCharBeforeAttributeNameOrNull(c);
                                 /*
                                  * Treat it as per the "anything else" entry
                                  * below.
                                  */
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Start a new attribute in the
                                  * current tag token.
                                  */
                                 if (c >= 'A' && c <= 'Z') {
                                     /*
                                      * U+0041 LATIN CAPITAL LETTER A through to
@@ -1864,17 +1867,17 @@ public class Tokenizer implements Locato
                                 /*
                                  * Switch to the attribute name state.
                                  */
                                 state = transition(state, Tokenizer.ATTRIBUTE_NAME, reconsume, pos);
                                 break beforeattributenameloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case ATTRIBUTE_NAME:
                     attributenameloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -1882,17 +1885,17 @@ public class Tokenizer implements Locato
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 attributeNameComplete();
                                 state = transition(state, Tokenizer.AFTER_ATTRIBUTE_NAME, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the after attribute name state.
                                  */
@@ -1929,29 +1932,30 @@ public class Tokenizer implements Locato
                                     break stateloop;
                                 }
                                 /*
                                  * Switch to the data state.
                                  */
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case '\"':
                             case '\'':
                             case '<':
                                 /*
                                  * U+0022 QUOTATION MARK (") U+0027 APOSTROPHE
                                  * (') U+003C LESS-THAN SIGN (<) Parse error.
                                  */
                                 errQuoteOrLtInAttributeNameOrNull(c);
                                 /*
                                  * Treat it as per the "anything else" entry
                                  * below.
                                  */
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 if (c >= 'A' && c <= 'Z') {
                                     /*
                                      * U+0041 LATIN CAPITAL LETTER A through to
                                      * U+005A LATIN CAPITAL LETTER Z Append the
                                      * lowercase version of the current input
                                      * character (add 0x0020 to the character's
                                      * code point) to the current attribute's
@@ -1965,33 +1969,33 @@ public class Tokenizer implements Locato
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the attribute name state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BEFORE_ATTRIBUTE_VALUE:
                     beforeattributevalueloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the before attribute value state.
                                  */
@@ -2041,29 +2045,30 @@ public class Tokenizer implements Locato
                                     break stateloop;
                                 }
                                 /*
                                  * Switch to the data state.
                                  */
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case '<':
                             case '=':
                             case '`':
                                 /*
                                  * U+003C LESS-THAN SIGN (<) U+003D EQUALS SIGN
                                  * (=) U+0060 GRAVE ACCENT (`)
                                  */
                                 errLtOrEqualsOrGraveInUnquotedAttributeOrNull(c);
                                 /*
                                  * Treat it as per the "anything else" entry
                                  * below.
                                  */
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 // [NOCPP[
                                 errHtml4NonNameInUnquotedAttribute(c);
                                 // ]NOCPP]
                                 /*
                                  * Anything else Append the current input
                                  * character to the current attribute's value.
                                  */
@@ -2075,17 +2080,17 @@ public class Tokenizer implements Locato
                                  * state.
                                  */
 
                                 state = transition(state, Tokenizer.ATTRIBUTE_VALUE_UNQUOTED, reconsume, pos);
                                 noteUnquotedAttributeValue();
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case ATTRIBUTE_VALUE_DOUBLE_QUOTED:
                     attributevaluedoublequotedloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -2121,48 +2126,48 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the current input
                                  * character to the current attribute's value.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the attribute value (double-quoted)
                                  * state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case AFTER_ATTRIBUTE_VALUE_QUOTED:
                     afterattributevaluequotedloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the before attribute name state.
                                  */
@@ -2198,17 +2203,17 @@ public class Tokenizer implements Locato
                                  * Reconsume the character in the before
                                  * attribute name state.
                                  */
                                 reconsume = true;
                                 state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SELF_CLOSING_START_TAG:
                     if (++pos == endPos) {
                         break stateloop;
                     }
                     c = checkChar(buf, pos);
                     /*
                      * Consume the next input character:
                      */
@@ -2236,17 +2241,16 @@ public class Tokenizer implements Locato
                             /*
                              * Reconsume the character in the before attribute
                              * name state.
                              */
                             reconsume = true;
                             state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos);
                             continue stateloop;
                     }
-                    // XXX reorder point
                 case ATTRIBUTE_VALUE_UNQUOTED:
                     for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -2258,17 +2262,17 @@ public class Tokenizer implements Locato
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 addAttributeWithValue();
                                 state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the before attribute name state.
                                  */
@@ -2299,65 +2303,64 @@ public class Tokenizer implements Locato
                                     break stateloop;
                                 }
                                 /*
                                  * Switch to the data state.
                                  */
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case '<':
                             case '\"':
                             case '\'':
                             case '=':
                             case '`':
                                 /*
                                  * U+0022 QUOTATION MARK (") U+0027 APOSTROPHE
                                  * (') U+003C LESS-THAN SIGN (<) U+003D EQUALS
                                  * SIGN (=) U+0060 GRAVE ACCENT (`) Parse error.
                                  */
                                 errUnquotedAttributeValOrNull(c);
                                 /*
                                  * Treat it as per the "anything else" entry
                                  * below.
                                  */
-                                // fall through
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 // [NOCPP]
                                 errHtml4NonNameInUnquotedAttribute(c);
                                 // ]NOCPP]
                                 /*
                                  * Anything else Append the current input
                                  * character to the current attribute's value.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the attribute value (unquoted) state.
                                  */
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case AFTER_ATTRIBUTE_NAME:
                     for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the after attribute name state.
                                  */
@@ -2388,25 +2391,26 @@ public class Tokenizer implements Locato
                                     break stateloop;
                                 }
                                 /*
                                  * Switch to the data state.
                                  */
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case '\"':
                             case '\'':
                             case '<':
                                 errQuoteOrLtInAttributeNameOrNull(c);
                                 /*
                                  * Treat it as per the "anything else" entry
                                  * below.
                                  */
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 addAttributeWithoutValue();
                                 /*
                                  * Anything else Start a new attribute in the
                                  * current tag token.
                                  */
                                 if (c >= 'A' && c <= 'Z') {
                                     /*
@@ -2430,17 +2434,16 @@ public class Tokenizer implements Locato
                                 // Will do later.
                                 /*
                                  * Switch to the attribute name state.
                                  */
                                 state = transition(state, Tokenizer.ATTRIBUTE_NAME, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case MARKUP_DECLARATION_OPEN:
                     markupdeclarationopenloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * If the next two characters are both U+002D
@@ -2484,26 +2487,26 @@ public class Tokenizer implements Locato
                             case '[':
                                 if (tokenHandler.cdataSectionAllowed()) {
                                     clearStrBufBeforeUse();
                                     appendStrBuf(c);
                                     index = 0;
                                     state = transition(state, Tokenizer.CDATA_START, reconsume, pos);
                                     continue stateloop;
                                 }
-                                // else fall through
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 errBogusComment();
                                 clearStrBufBeforeUse();
                                 reconsume = true;
                                 state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case MARKUP_DECLARATION_HYPHEN:
                     markupdeclarationhyphenloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         switch (c) {
                             case '\u0000':
@@ -2515,17 +2518,17 @@ public class Tokenizer implements Locato
                             // continue stateloop;
                             default:
                                 errBogusComment();
                                 reconsume = true;
                                 state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT_START:
                     commentstartloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Comment start state
@@ -2559,32 +2562,32 @@ public class Tokenizer implements Locato
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 break commentstartloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the input character to
                                  * the comment token's data.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Switch to the comment state.
                                  */
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 break commentstartloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT:
                     commentloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Comment state Consume the next input character:
@@ -2602,30 +2605,30 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the input character to
                                  * the comment token's data.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the comment state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT_END_DASH:
                     commentenddashloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Comment end dash state Consume the next input
@@ -2646,32 +2649,32 @@ public class Tokenizer implements Locato
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append a U+002D HYPHEN-MINUS
                                  * (-) character and the input character to the
                                  * comment token's data.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Switch to the comment state.
                                  */
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case COMMENT_END:
                     commentendloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Comment end dash state Consume the next input
@@ -2710,32 +2713,31 @@ public class Tokenizer implements Locato
                                 continue stateloop;
                             case '!':
                                 errHyphenHyphenBang();
                                 appendStrBuf(c);
                                 state = transition(state, Tokenizer.COMMENT_END_BANG, reconsume, pos);
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Append two U+002D HYPHEN-MINUS (-) characters
                                  * and the input character to the comment
                                  * token's data.
                                  */
                                 adjustDoubleHyphenAndAppendToStrBufAndErr(c);
                                 /*
                                  * Switch to the comment state.
                                  */
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case COMMENT_END_BANG:
                     for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Comment end bang state
@@ -2769,34 +2771,33 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append two U+002D HYPHEN-MINUS
                                  * (-) characters, a U+0021 EXCLAMATION MARK (!)
                                  * character, and the input character to the
                                  * comment token's data. Switch to the comment
                                  * state.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Switch to the comment state.
                                  */
                                 state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case COMMENT_START_DASH:
                     if (++pos == endPos) {
                         break stateloop;
                     }
                     c = checkChar(buf, pos);
                     /*
                      * Comment start dash state
                      *
@@ -2825,31 +2826,30 @@ public class Tokenizer implements Locato
                             state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                             break stateloop;
                         case '\n':
                             appendStrBufLineFeed();
                             state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                             continue stateloop;
                         case '\u0000':
                             c = '\uFFFD';
-                            // fall thru
+                            // CPPONLY: MOZ_FALLTHROUGH;
                         default:
                             /*
                              * Append a U+002D HYPHEN-MINUS character (-) and
                              * the current input character to the comment
                              * token's data.
                              */
                             appendStrBuf(c);
                             /*
                              * Switch to the comment state.
                              */
                             state = transition(state, Tokenizer.COMMENT, reconsume, pos);
                             continue stateloop;
                     }
-                    // XXX reorder point
                 case CDATA_START:
                     for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         if (index < 6) { // CDATA_LSQB.length
                             if (c == Tokenizer.CDATA_LSQB[index]) {
@@ -2865,17 +2865,17 @@ public class Tokenizer implements Locato
                         } else {
                             clearStrBufAfterUse();
                             cstart = pos; // start coalescing
                             reconsume = true;
                             state = transition(state, Tokenizer.CDATA_SECTION, reconsume, pos);
                             break; // FALL THROUGH continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case CDATA_SECTION:
                     cdatasectionloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -2889,22 +2889,22 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 continue;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case CDATA_RSQB:
                     cdatarsqb: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         switch (c) {
                             case ']':
@@ -2914,17 +2914,17 @@ public class Tokenizer implements Locato
                                 tokenHandler.characters(Tokenizer.RSQB_RSQB, 0,
                                         1);
                                 cstart = pos;
                                 reconsume = true;
                                 state = transition(state, Tokenizer.CDATA_SECTION, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case CDATA_RSQB_RSQB:
                     cdatarsqbrsqb: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         switch (c) {
                             case ']':
@@ -2941,17 +2941,16 @@ public class Tokenizer implements Locato
                             default:
                                 tokenHandler.characters(Tokenizer.RSQB_RSQB, 0, 2);
                                 cstart = pos;
                                 reconsume = true;
                                 state = transition(state, Tokenizer.CDATA_SECTION, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case ATTRIBUTE_VALUE_SINGLE_QUOTED:
                     attributevaluesinglequotedloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -2987,31 +2986,31 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the current input
                                  * character to the current attribute's value.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the attribute value (double-quoted)
                                  * state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case CONSUME_CHARACTER_REFERENCE:
                     if (++pos == endPos) {
                         break stateloop;
                     }
                     c = checkChar(buf, pos);
                     if (c == '\u0000') {
                         break stateloop;
                     }
@@ -3081,17 +3080,17 @@ public class Tokenizer implements Locato
                                 state = transition(state, returnState, reconsume, pos);
                                 continue stateloop;
                             }
                             // Didn't fail yet
                             appendCharRefBuf(c);
                             state = transition(state, Tokenizer.CHARACTER_REFERENCE_HILO_LOOKUP, reconsume, pos);
                             // FALL THROUGH continue stateloop;
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case CHARACTER_REFERENCE_HILO_LOOKUP:
                     {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         if (c == '\u0000') {
                             break stateloop;
@@ -3160,16 +3159,17 @@ public class Tokenizer implements Locato
                         lo = hilo & 0xFFFF;
                         hi = hilo >> 16;
                         entCol = -1;
                         candidate = -1;
                         charRefBufMark = 0;
                         state = transition(state, Tokenizer.CHARACTER_REFERENCE_TAIL, reconsume, pos);
                         // FALL THROUGH continue stateloop;
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case CHARACTER_REFERENCE_TAIL:
                     outer: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         if (c == '\u0000') {
                             break stateloop;
@@ -3345,17 +3345,16 @@ public class Tokenizer implements Locato
                         /*
                          * If the markup contains I'm &notit; I tell you, the
                          * entity is parsed as "not", as in, I'm ¬it; I tell
                          * you. But if the markup was I'm &notin; I tell you,
                          * the entity would be parsed as "notin;", resulting in
                          * I'm ∉ I tell you.
                          */
                     }
-                    // XXX reorder point
                 case CONSUME_NCR:
                     if (++pos == endPos) {
                         break stateloop;
                     }
                     c = checkChar(buf, pos);
                     value = 0;
                     seenDigits = false;
                     /*
@@ -3391,17 +3390,17 @@ public class Tokenizer implements Locato
                              *
                              * When it comes to interpreting the number,
                              * interpret it as a decimal number.
                              */
                             reconsume = true;
                             state = transition(state, Tokenizer.DECIMAL_NRC_LOOP, reconsume, pos);
                             // FALL THROUGH continue stateloop;
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case DECIMAL_NRC_LOOP:
                     decimalloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -3466,26 +3465,25 @@ public class Tokenizer implements Locato
                                 }
                                 reconsume = true;
                                 state = transition(state, Tokenizer.HANDLE_NCR_VALUE, reconsume, pos);
                                 // FALL THROUGH continue stateloop;
                                 break decimalloop;
                             }
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case HANDLE_NCR_VALUE:
                     // WARNING previous state sets reconsume
                     // We are not going to emit the contents of charRefBuf.
                     charRefBufLen = 0;
                     // XXX inline this case if the method size can take it
                     handleNcrValue(returnState);
                     state = transition(state, returnState, reconsume, pos);
                     continue stateloop;
-                    // XXX reorder point
                 case HEX_NCR_LOOP:
                     for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume as many characters as match the range of
@@ -3560,17 +3558,16 @@ public class Tokenizer implements Locato
                                     cstart = pos;
                                 }
                                 reconsume = true;
                                 state = transition(state, Tokenizer.HANDLE_NCR_VALUE, reconsume, pos);
                                 continue stateloop;
                             }
                         }
                     }
-                    // XXX reorder point
                 case PLAINTEXT:
                     plaintextloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -3580,26 +3577,26 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitPlaintextReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Stay in the
                                  * RAWTEXT state.
                                  */
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case CLOSE_TAG_OPEN:
                     if (++pos == endPos) {
                         break stateloop;
                     }
                     c = checkChar(buf, pos);
                     /*
                      * Otherwise, if the content model flag is set to the PCDATA
                      * state, or if the next few characters do match that tag
@@ -3634,17 +3631,17 @@ public class Tokenizer implements Locato
                              * Switch to the bogus comment state.
                              */
                             clearStrBufBeforeUse();
                             appendStrBuf(c);
                             state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos);
                             continue stateloop;
                         case '\u0000':
                             c = '\uFFFD';
-                            // fall thru
+                            // CPPONLY: MOZ_FALLTHROUGH;
                         default:
                             if (c >= 'A' && c <= 'Z') {
                                 c += 0x20;
                             }
                             if (c >= 'a' && c <= 'z') {
                                 /*
                                  * U+0061 LATIN SMALL LETTER A through to U+007A
                                  * LATIN SMALL LETTER Z Create a new end tag
@@ -3671,17 +3668,16 @@ public class Tokenizer implements Locato
                                  * Switch to the bogus comment state.
                                  */
                                 clearStrBufBeforeUse();
                                 appendStrBuf(c);
                                 state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos);
                                 continue stateloop;
                             }
                     }
-                    // XXX reorder point
                 case RCDATA:
                     rcdataloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -3713,25 +3709,25 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Emit the current input character as a
                                  * character token. Stay in the RCDATA state.
                                  */
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case RAWTEXT:
                     rawtextloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -3752,25 +3748,26 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Emit the current input character as a
                                  * character token. Stay in the RAWTEXT state.
                                  */
                                 continue;
                         }
                     }
-                    // XXX fallthru don't reorder
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case RAWTEXT_RCDATA_LESS_THAN_SIGN:
                     rawtextrcdatalessthansignloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         switch (c) {
                             case '/':
@@ -3795,17 +3792,17 @@ public class Tokenizer implements Locato
                                  * the data state.
                                  */
                                 cstart = pos;
                                 reconsume = true;
                                 state = transition(state, returnState, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // XXX fall thru. don't reorder.
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case NON_DATA_END_TAG_NAME:
                     for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * ASSERT! when entering this state, set index to 0 and
@@ -3842,17 +3839,17 @@ public class Tokenizer implements Locato
                             switch (c) {
                                 case '\r':
                                     silentCarriageReturn();
                                     clearStrBufAfterUse(); // strBuf not used
                                     state = transition(state, Tokenizer.BEFORE_ATTRIBUTE_NAME, reconsume, pos);
                                     break stateloop;
                                 case '\n':
                                     silentLineFeed();
-                                    // fall thru
+                                    // CPPONLY: MOZ_FALLTHROUGH;
                                 case ' ':
                                 case '\t':
                                 case '\u000C':
                                     /*
                                      * U+0009 CHARACTER TABULATION U+000A LINE
                                      * FEED (LF) U+000C FORM FEED (FF) U+0020
                                      * SPACE If the current end tag token is an
                                      * appropriate end tag token, then switch to
@@ -3906,17 +3903,16 @@ public class Tokenizer implements Locato
                                         cstart = pos; // don't drop the
                                         // character
                                     }
                                     state = transition(state, returnState, reconsume, pos);
                                     continue stateloop;
                             }
                         }
                     }
-                    // XXX reorder point
                     // BEGIN HOTSPOT WORKAROUND
                 case BOGUS_COMMENT:
                     boguscommentloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
@@ -3953,23 +3949,23 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 appendStrBuf(c);
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BOGUS_COMMENT_HYPHEN:
                     boguscommenthyphenloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         switch (c) {
                             case '>':
@@ -3987,24 +3983,23 @@ public class Tokenizer implements Locato
                                 state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos);
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 appendStrBuf(c);
                                 state = transition(state, Tokenizer.BOGUS_COMMENT, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case SCRIPT_DATA:
                     scriptdataloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -4024,26 +4019,27 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Stay in the
                                  * script data state.
                                  */
                                 continue;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_LESS_THAN_SIGN:
                     scriptdatalessthansignloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         switch (c) {
                             case '/':
@@ -4074,17 +4070,17 @@ public class Tokenizer implements Locato
                                  * the data state.
                                  */
                                 cstart = pos;
                                 reconsume = true;
                                 state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_ESCAPE_START:
                     scriptdataescapestartloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4105,17 +4101,17 @@ public class Tokenizer implements Locato
                                  * Anything else Reconsume the current input
                                  * character in the script data state.
                                  */
                                 reconsume = true;
                                 state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_ESCAPE_START_DASH:
                     scriptdataescapestartdashloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4135,17 +4131,17 @@ public class Tokenizer implements Locato
                                  * Anything else Reconsume the current input
                                  * character in the script data state.
                                  */
                                 reconsume = true;
                                 state = transition(state, Tokenizer.SCRIPT_DATA, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_ESCAPED_DASH_DASH:
                     scriptdataescapeddashdashloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4179,28 +4175,29 @@ public class Tokenizer implements Locato
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 break scriptdataescapeddashdashloop;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Switch to the
                                  * script data escaped state.
                                  */
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 break scriptdataescapeddashdashloop;
                             // continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_ESCAPED:
                     scriptdataescapedloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -4231,26 +4228,27 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Stay in the
                                  * script data escaped state.
                                  */
                                 continue;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_ESCAPED_DASH:
                     scriptdataescapeddashloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4278,27 +4276,28 @@ public class Tokenizer implements Locato
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 continue stateloop;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Switch to the
                                  * script data escaped state.
                                  */
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:
                     scriptdataescapedlessthanloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4346,17 +4345,17 @@ public class Tokenizer implements Locato
                                  */
                                 tokenHandler.characters(Tokenizer.LT_GT, 0, 1);
                                 cstart = pos;
                                 reconsume = true;
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_DOUBLE_ESCAPE_START:
                     scriptdatadoubleescapestartloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         assert index > 0;
                         if (index < 6) { // SCRIPT_ARR.length
@@ -4374,16 +4373,17 @@ public class Tokenizer implements Locato
                         }
                         switch (c) {
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                             case '/':
                             case '>':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
@@ -4401,17 +4401,17 @@ public class Tokenizer implements Locato
                                  * Anything else Reconsume the current input
                                  * character in the script data escaped state.
                                  */
                                 reconsume = true;
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_DOUBLE_ESCAPED:
                     scriptdatadoubleescapedloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -4443,26 +4443,27 @@ public class Tokenizer implements Locato
                             case '\u0000':
                                 emitReplacementCharacter(buf, pos);
                                 continue;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Stay in the
                                  * script data double escaped state.
                                  */
                                 continue;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_DOUBLE_ESCAPED_DASH:
                     scriptdatadoubleescapeddashloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4491,27 +4492,28 @@ public class Tokenizer implements Locato
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 continue stateloop;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Switch to the
                                  * script data double escaped state.
                                  */
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:
                     scriptdatadoubleescapeddashdashloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4546,27 +4548,28 @@ public class Tokenizer implements Locato
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 continue stateloop;
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Emit the current input
                                  * character as a character token. Switch to the
                                  * script data double escaped state.
                                  */
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:
                     scriptdatadoubleescapedlessthanloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4588,17 +4591,17 @@ public class Tokenizer implements Locato
                                  * character in the script data double escaped
                                  * state.
                                  */
                                 reconsume = true;
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // WARNING FALLTHRU CASE TRANSITION: DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case SCRIPT_DATA_DOUBLE_ESCAPE_END:
                     scriptdatadoubleescapeendloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         if (index < 6) { // SCRIPT_ARR.length
                             char folded = c;
@@ -4615,16 +4618,17 @@ public class Tokenizer implements Locato
                         }
                         switch (c) {
                             case '\r':
                                 emitCarriageReturn(buf, pos);
                                 state = transition(state, Tokenizer.SCRIPT_DATA_ESCAPED, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                             case '/':
                             case '>':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
@@ -4641,17 +4645,16 @@ public class Tokenizer implements Locato
                                  * Reconsume the current input character in the
                                  * script data double escaped state.
                                  */
                                 reconsume = true;
                                 state = transition(state, Tokenizer.SCRIPT_DATA_DOUBLE_ESCAPED, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // XXX reorder point
                 case MARKUP_DECLARATION_OCTYPE:
                     markupdeclarationdoctypeloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         if (index < 6) { // OCTYPE.length
                             char folded = c;
@@ -4670,17 +4673,17 @@ public class Tokenizer implements Locato
                             continue;
                         } else {
                             reconsume = true;
                             state = transition(state, Tokenizer.DOCTYPE, reconsume, pos);
                             break markupdeclarationdoctypeloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case DOCTYPE:
                     doctypeloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -4692,17 +4695,17 @@ public class Tokenizer implements Locato
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 state = transition(state, Tokenizer.BEFORE_DOCTYPE_NAME, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the before DOCTYPE name state.
                                  */
@@ -4719,17 +4722,17 @@ public class Tokenizer implements Locato
                                  * DOCTYPE name state.
                                  */
                                 reconsume = true;
                                 state = transition(state, Tokenizer.BEFORE_DOCTYPE_NAME, reconsume, pos);
                                 break doctypeloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BEFORE_DOCTYPE_NAME:
                     beforedoctypenameloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -4739,17 +4742,17 @@ public class Tokenizer implements Locato
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the before DOCTYPE name state.
                                  */
@@ -4770,17 +4773,17 @@ public class Tokenizer implements Locato
                                 emitDoctypeToken(pos);
                                 /*
                                  * Switch to the data state.
                                  */
                                 state = transition(state, Tokenizer.DATA, reconsume, pos);
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 if (c >= 'A' && c <= 'Z') {
                                     /*
                                      * U+0041 LATIN CAPITAL LETTER A through to
                                      * U+005A LATIN CAPITAL LETTER Z Create a
                                      * new DOCTYPE token. Set the token's name
                                      * to the lowercase version of the input
                                      * character (add 0x0020 to the character's
@@ -4798,17 +4801,17 @@ public class Tokenizer implements Locato
                                 /*
                                  * Switch to the DOCTYPE name state.
                                  */
                                 state = transition(state, Tokenizer.DOCTYPE_NAME, reconsume, pos);
                                 break beforedoctypenameloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case DOCTYPE_NAME:
                     doctypenameloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -4816,17 +4819,17 @@ public class Tokenizer implements Locato
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 strBufToDoctypeName();
                                 state = transition(state, Tokenizer.AFTER_DOCTYPE_NAME, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the after DOCTYPE name state.
                                  */
@@ -4843,17 +4846,17 @@ public class Tokenizer implements Locato
                                 emitDoctypeToken(pos);
                                 /*
                                  * Switch to the data state.
                                  */
                                 state = transition(state, Tokenizer.DATA, reconsume, pos);
                                 continue stateloop;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * U+0041 LATIN CAPITAL LETTER A through to
                                  * U+005A LATIN CAPITAL LETTER Z Append the
                                  * lowercase version of the input character (add
                                  * 0x0020 to the character's code point) to the
                                  * current DOCTYPE token's name.
                                  */
@@ -4867,33 +4870,33 @@ public class Tokenizer implements Locato
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the DOCTYPE name state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case AFTER_DOCTYPE_NAME:
                     afterdoctypenameloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the after DOCTYPE name state.
                                  */
@@ -4933,17 +4936,17 @@ public class Tokenizer implements Locato
                                 // done by bogusDoctype();
                                 /*
                                  * Switch to the bogus DOCTYPE state.
                                  */
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case DOCTYPE_UBLIC:
                     doctypeublicloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * If the six characters starting from the current input
@@ -4967,17 +4970,17 @@ public class Tokenizer implements Locato
                             continue;
                         } else {
                             reconsume = true;
                             state = transition(state, Tokenizer.AFTER_DOCTYPE_PUBLIC_KEYWORD, reconsume, pos);
                             break doctypeublicloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case AFTER_DOCTYPE_PUBLIC_KEYWORD:
                     afterdoctypepublickeywordloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -4988,17 +4991,17 @@ public class Tokenizer implements Locato
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 state = transition(state, Tokenizer.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the before DOCTYPE public
                                  * identifier state.
@@ -5064,33 +5067,33 @@ public class Tokenizer implements Locato
                                 // done by bogusDoctype();
                                 /*
                                  * Switch to the bogus DOCTYPE state.
                                  */
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:
                     beforedoctypepublicidentifierloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the before DOCTYPE public identifier
                                  * state.
@@ -5149,17 +5152,17 @@ public class Tokenizer implements Locato
                                 // done by bogusDoctype();
                                 /*
                                  * Switch to the bogus DOCTYPE state.
                                  */
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:
                     doctypepublicidentifierdoublequotedloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -5197,49 +5200,49 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the current input
                                  * character to the current DOCTYPE token's
                                  * public identifier.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the DOCTYPE public identifier
                                  * (double-quoted) state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case AFTER_DOCTYPE_PUBLIC_IDENTIFIER:
                     afterdoctypepublicidentifierloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 state = transition(state, Tokenizer.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the between DOCTYPE public and
                                  * system identifiers state.
@@ -5299,33 +5302,33 @@ public class Tokenizer implements Locato
                                 // done by bogusDoctype();
                                 /*
                                  * Switch to the bogus DOCTYPE state.
                                  */
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:
                     betweendoctypepublicandsystemidentifiersloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the between DOCTYPE public and system
                                  * identifiers state.
@@ -5378,17 +5381,17 @@ public class Tokenizer implements Locato
                                 // done by bogusDoctype();
                                 /*
                                  * Switch to the bogus DOCTYPE state.
                                  */
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:
                     doctypesystemidentifierdoublequotedloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -5425,48 +5428,47 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the current input
                                  * character to the current DOCTYPE token's
                                  * system identifier.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the DOCTYPE system identifier
                                  * (double-quoted) state.
                                  */
                                 continue;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
                 case AFTER_DOCTYPE_SYSTEM_IDENTIFIER:
                     afterdoctypesystemidentifierloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the after DOCTYPE system identifier state.
                                  */
@@ -5489,17 +5491,17 @@ public class Tokenizer implements Locato
                                  * to on.)
                                  */
                                 bogusDoctypeWithoutQuirks();
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 break afterdoctypesystemidentifierloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BOGUS_DOCTYPE:
                     for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -5520,26 +5522,25 @@ public class Tokenizer implements Locato
                                  */
                                 state = transition(state, Tokenizer.DATA, reconsume, pos);
                                 continue stateloop;
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Stay in the bogus DOCTYPE
                                  * state.
                                  */
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case DOCTYPE_YSTEM:
                     doctypeystemloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Otherwise, if the six characters starting from the
@@ -5563,17 +5564,17 @@ public class Tokenizer implements Locato
                             continue stateloop;
                         } else {
                             reconsume = true;
                             state = transition(state, Tokenizer.AFTER_DOCTYPE_SYSTEM_KEYWORD, reconsume, pos);
                             break doctypeystemloop;
                             // continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case AFTER_DOCTYPE_SYSTEM_KEYWORD:
                     afterdoctypesystemkeywordloop: for (;;) {
                         if (reconsume) {
                             reconsume = false;
                         } else {
                             if (++pos == endPos) {
                                 break stateloop;
                             }
@@ -5584,17 +5585,17 @@ public class Tokenizer implements Locato
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 state = transition(state, Tokenizer.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER, reconsume, pos);
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE
                                  * Switch to the before DOCTYPE public
                                  * identifier state.
@@ -5660,33 +5661,33 @@ public class Tokenizer implements Locato
                                 // done by bogusDoctype();
                                 /*
                                  * Switch to the bogus DOCTYPE state.
                                  */
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:
                     beforedoctypesystemidentifierloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
                          */
                         switch (c) {
                             case '\r':
                                 silentCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 silentLineFeed();
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case ' ':
                             case '\t':
                             case '\u000C':
                                 /*
                                  * U+0009 CHARACTER TABULATION U+000A LINE FEED
                                  * (LF) U+000C FORM FEED (FF) U+0020 SPACE Stay
                                  * in the before DOCTYPE system identifier
                                  * state.
@@ -5745,17 +5746,17 @@ public class Tokenizer implements Locato
                                 // done by bogusDoctype();
                                 /*
                                  * Switch to the bogus DOCTYPE state.
                                  */
                                 state = transition(state, Tokenizer.BOGUS_DOCTYPE, reconsume, pos);
                                 continue stateloop;
                         }
                     }
-                    // FALLTHRU DON'T REORDER
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:
                     for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -5789,32 +5790,31 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the current input
                                  * character to the current DOCTYPE token's
                                  * system identifier.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the DOCTYPE system identifier
                                  * (double-quoted) state.
                                  */
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:
                     for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         /*
                          * Consume the next input character:
@@ -5848,32 +5848,31 @@ public class Tokenizer implements Locato
                             case '\r':
                                 appendStrBufCarriageReturn();
                                 break stateloop;
                             case '\n':
                                 appendStrBufLineFeed();
                                 continue;
                             case '\u0000':
                                 c = '\uFFFD';
-                                // fall thru
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             default:
                                 /*
                                  * Anything else Append the current input
                                  * character to the current DOCTYPE token's
                                  * public identifier.
                                  */
                                 appendStrBuf(c);
                                 /*
                                  * Stay in the DOCTYPE public identifier
                                  * (single-quoted) state.
                                  */
                                 continue;
                         }
                     }
-                    // XXX reorder point
                 case PROCESSING_INSTRUCTION:
                     processinginstructionloop: for (;;) {
                         if (++pos == endPos) {
                             break stateloop;
                         }
                         c = checkChar(buf, pos);
                         switch (c) {
                             case '?':
@@ -5882,16 +5881,17 @@ public class Tokenizer implements Locato
                                         Tokenizer.PROCESSING_INSTRUCTION_QUESTION_MARK,
                                         reconsume, pos);
                                 break processinginstructionloop;
                             // continue stateloop;
                             default:
                                 continue;
                         }
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case PROCESSING_INSTRUCTION_QUESTION_MARK:
                     if (++pos == endPos) {
                         break stateloop;
                     }
                     c = checkChar(buf, pos);
                     switch (c) {
                         case '>':
                             state = transition(state, Tokenizer.DATA,
--- a/parser/html/javasrc/TreeBuilder.java
+++ b/parser/html/javasrc/TreeBuilder.java
@@ -1067,17 +1067,17 @@ public abstract class TreeBuilder<T> imp
         // optimize the most common case
         switch (mode) {
             case IN_BODY:
             case IN_CELL:
             case IN_CAPTION:
                 if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) {
                     reconstructTheActiveFormattingElements();
                 }
-                // fall through
+                // CPPONLY: MOZ_FALLTHROUGH;
             case TEXT:
                 accumulateCharacters(buf, start, length);
                 return;
             case IN_TABLE:
             case IN_TABLE_BODY:
             case IN_ROW:
                 accumulateCharactersForced(buf, start, length);
                 return;
@@ -1568,16 +1568,17 @@ public abstract class TreeBuilder<T> imp
                     }
                     // ]NOCPP]
 
                     if (isTemplateModeStackEmpty()) {
                         break eofloop;
                     }
 
                     // fall through to IN_TEMPLATE
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_TEMPLATE:
                     int eltPos = findLast("template");
                     if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) {
                         assert fragment;
                         break eofloop;
                     }
                     if (errorHandler != null) {
                         errUnclosedElements(eltPos, "template");
@@ -1733,17 +1734,17 @@ public abstract class TreeBuilder<T> imp
                                 errHtmlStartTagInForeignContext(name);
                                 if (!fragment) {
                                     while (!isSpecialParentInForeign(stack[currentPtr])) {
                                         pop();
                                     }
                                     continue starttagloop;
                                 } // else fall thru
                             }
-                            // else fall thru
+                            // CPPONLY: MOZ_FALLTHROUGH;
                         default:
                             if ("http://www.w3.org/2000/svg" == currNs) {
                                 attributes.adjustForSvg();
                                 if (selfClosing) {
                                     appendVoidElementToCurrentMayFosterSVG(
                                             elementName, attributes);
                                     selfClosing = false;
                                 } else {
@@ -1861,16 +1862,17 @@ public abstract class TreeBuilder<T> imp
                             }
                             clearStackBackTo(eltPos);
                             pop();
                             mode = IN_TABLE_BODY;
                             continue;
                         default:
                             // fall through to IN_TABLE
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_TABLE_BODY:
                     switch (group) {
                         case TR:
                             clearStackBackTo(findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
                             appendToCurrentNodeAndPushElement(
                                     elementName,
                                     attributes);
                             mode = IN_ROW;
@@ -1897,16 +1899,17 @@ public abstract class TreeBuilder<T> imp
                                 clearStackBackTo(eltPos);
                                 pop();
                                 mode = IN_TABLE;
                                 continue;
                             }
                         default:
                             // fall through to IN_TABLE
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_TABLE:
                     intableloop: for (;;) {
                         switch (group) {
                             case CAPTION:
                                 clearStackBackTo(findLastOrRoot(TreeBuilder.TABLE));
                                 insertMarker();
                                 appendToCurrentNodeAndPushElement(
                                         elementName,
@@ -2012,16 +2015,17 @@ public abstract class TreeBuilder<T> imp
                                     break starttagloop;
                                 }
                             default:
                                 errStartTagInTable(name);
                                 // fall through to IN_BODY
                                 break intableloop;
                         }
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_CAPTION:
                     switch (group) {
                         case CAPTION:
                         case COL:
                         case COLGROUP:
                         case TBODY_OR_THEAD_OR_TFOOT:
                         case TR:
                         case TD_OR_TH:
@@ -2038,16 +2042,17 @@ public abstract class TreeBuilder<T> imp
                                 pop();
                             }
                             clearTheListOfActiveFormattingElementsUpToTheLastMarker();
                             mode = IN_TABLE;
                             continue;
                         default:
                             // fall through to IN_BODY
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_CELL:
                     switch (group) {
                         case CAPTION:
                         case COL:
                         case COLGROUP:
                         case TBODY_OR_THEAD_OR_TFOOT:
                         case TR:
                         case TD_OR_TH:
@@ -2057,16 +2062,17 @@ public abstract class TreeBuilder<T> imp
                                 break starttagloop;
                             } else {
                                 closeTheCell(eltPos);
                                 continue;
                             }
                         default:
                             // fall through to IN_BODY
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case FRAMESET_OK:
                     switch (group) {
                         case FRAMESET:
                             if (mode == FRAMESET_OK) {
                                 if (currentPtr == 0 || stack[1].getGroup() != BODY) {
                                     assert fragment || isTemplateContents();
                                     errStrayStartTag(name);
                                     break starttagloop;
@@ -2108,20 +2114,21 @@ public abstract class TreeBuilder<T> imp
                         case SELECT:
                             if (mode == FRAMESET_OK
                                     && !(group == INPUT && Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString(
                                             "hidden",
                                             attributes.getValue(AttributeName.TYPE)))) {
                                 framesetOk = false;
                                 mode = IN_BODY;
                             }
-                            // fall through to IN_BODY
+                            // CPPONLY: MOZ_FALLTHROUGH;
                         default:
                             // fall through to IN_BODY
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_BODY:
                     inbodyloop: for (;;) {
                         switch (group) {
                             case HTML:
                                 errStrayStartTag(name);
                                 if (!fragment && !isTemplateContents()) {
                                     addAttributesToHtml(attributes);
                                     attributes = null; // CPP
@@ -2328,16 +2335,17 @@ public abstract class TreeBuilder<T> imp
                                 mode = IN_TABLE;
                                 attributes = null; // CPP
                                 break starttagloop;
                             case BR:
                             case EMBED:
                             case AREA_OR_WBR:
                                 reconstructTheActiveFormattingElements();
                                 // FALL THROUGH to PARAM_OR_SOURCE_OR_TRACK
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             // CPPONLY: case MENUITEM:
                             case PARAM_OR_SOURCE_OR_TRACK:
                                 appendVoidElementToCurrentMayFoster(
                                         elementName,
                                         attributes);
                                 selfClosing = false;
                                 attributes = null; // CPP
                                 break starttagloop;
@@ -2389,19 +2397,18 @@ public abstract class TreeBuilder<T> imp
                             case NOSCRIPT:
                                 if (!scriptingEnabled) {
                                     reconstructTheActiveFormattingElements();
                                     appendToCurrentNodeAndPushElementMayFoster(
                                             elementName,
                                             attributes);
                                     attributes = null; // CPP
                                     break starttagloop;
-                                } else {
-                                    // fall through
                                 }
+                                // CPPONLY: MOZ_FALLTHROUGH;
                             case NOFRAMES:
                             case IFRAME:
                             case NOEMBED:
                                 startTagGenericRawText(elementName, attributes);
                                 attributes = null; // CPP
                                 break starttagloop;
                             case SELECT:
                                 reconstructTheActiveFormattingElements();
@@ -2519,16 +2526,17 @@ public abstract class TreeBuilder<T> imp
                                 reconstructTheActiveFormattingElements();
                                 appendToCurrentNodeAndPushElementMayFoster(
                                         elementName,
                                         attributes);
                                 attributes = null; // CPP
                                 break starttagloop;
                         }
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_HEAD:
                     inheadloop: for (;;) {
                         switch (group) {
                             case HTML:
                                 errStrayStartTag(name);
                                 if (!fragment && !isTemplateContents()) {
                                     addAttributesToHtml(attributes);
                                     attributes = null; // CPP
@@ -2585,16 +2593,17 @@ public abstract class TreeBuilder<T> imp
                                 attributes = null; // CPP
                                 break starttagloop;
                             default:
                                 pop();
                                 mode = AFTER_HEAD;
                                 continue starttagloop;
                         }
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_HEAD_NOSCRIPT:
                     switch (group) {
                         case HTML:
                             // XXX did Hixie really mean to omit "base"
                             // here?
                             errStrayStartTag(name);
                             if (!fragment && !isTemplateContents()) {
                                 addAttributesToHtml(attributes);
@@ -2685,16 +2694,17 @@ public abstract class TreeBuilder<T> imp
                             while (currentPtr >= eltPos) {
                                 pop();
                             }
                             resetTheInsertionMode();
                             continue;
                         default:
                             // fall through to IN_SELECT
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_SELECT:
                     switch (group) {
                         case HTML:
                             errStrayStartTag(name);
                             if (!fragment) {
                                 addAttributesToHtml(attributes);
                                 attributes = null; // CPP
                             }
@@ -2787,16 +2797,17 @@ public abstract class TreeBuilder<T> imp
                                     elementName,
                                     attributes);
                             selfClosing = false;
                             attributes = null; // CPP
                             break starttagloop;
                         default:
                             // fall through to AFTER_FRAMESET
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case AFTER_FRAMESET:
                     switch (group) {
                         case HTML:
                             errStrayStartTag(name);
                             if (!fragment && !isTemplateContents()) {
                                 addAttributesToHtml(attributes);
                                 attributes = null; // CPP
                             }
@@ -3366,16 +3377,17 @@ public abstract class TreeBuilder<T> imp
                     switch (group) {
                         case TEMPLATE:
                             // fall through to IN_HEAD
                             break;
                         default:
                             errStrayEndTag(name);
                             break endtagloop;
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_ROW:
                     switch (group) {
                         case TR:
                             eltPos = findLastOrRoot(TreeBuilder.TR);
                             if (eltPos == 0) {
                                 assert fragment || isTemplateContents();
                                 errNoTableRowToClose();
                                 break endtagloop;
@@ -3416,16 +3428,17 @@ public abstract class TreeBuilder<T> imp
                         case COLGROUP:
                         case HTML:
                         case TD_OR_TH:
                             errStrayEndTag(name);
                             break endtagloop;
                         default:
                             // fall through to IN_TABLE
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_TABLE_BODY:
                     switch (group) {
                         case TBODY_OR_THEAD_OR_TFOOT:
                             eltPos = findLastOrRoot(name);
                             if (eltPos == 0) {
                                 errStrayEndTag(name);
                                 break endtagloop;
                             }
@@ -3451,16 +3464,17 @@ public abstract class TreeBuilder<T> imp
                         case HTML:
                         case TD_OR_TH:
                         case TR:
                             errStrayEndTag(name);
                             break endtagloop;
                         default:
                             // fall through to IN_TABLE
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_TABLE:
                     switch (group) {
                         case TABLE:
                             eltPos = findLast("table");
                             if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) {
                                 assert fragment || isTemplateContents();
                                 errStrayEndTag(name);
                                 break endtagloop;
@@ -3482,16 +3496,17 @@ public abstract class TreeBuilder<T> imp
                             break endtagloop;
                         case TEMPLATE:
                             // fall through to IN_HEAD
                             break;
                         default:
                             errStrayEndTag(name);
                             // fall through to IN_BODY
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_CAPTION:
                     switch (group) {
                         case CAPTION:
                             eltPos = findLastInTableScope("caption");
                             if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) {
                                 break endtagloop;
                             }
                             generateImpliedEndTags();
@@ -3527,16 +3542,17 @@ public abstract class TreeBuilder<T> imp
                         case TBODY_OR_THEAD_OR_TFOOT:
                         case TD_OR_TH:
                         case TR:
                             errStrayEndTag(name);
                             break endtagloop;
                         default:
                             // fall through to IN_BODY
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_CELL:
                     switch (group) {
                         case TD_OR_TH:
                             eltPos = findLastInTableScope(name);
                             if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) {
                                 errStrayEndTag(name);
                                 break endtagloop;
                             }
@@ -3565,16 +3581,17 @@ public abstract class TreeBuilder<T> imp
                         case COL:
                         case COLGROUP:
                         case HTML:
                             errStrayEndTag(name);
                             break endtagloop;
                         default:
                             // fall through to IN_BODY
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case FRAMESET_OK:
                 case IN_BODY:
                     switch (group) {
                         case BODY:
                             if (!isSecondOnStackBody()) {
                                 assert fragment || isTemplateContents();
                                 errStrayEndTag(name);
                                 break endtagloop;
@@ -3802,27 +3819,27 @@ public abstract class TreeBuilder<T> imp
                         case TABLE:
                         case TEXTAREA: // XXX??
                             errStrayEndTag(name);
                             break endtagloop;
                         case NOSCRIPT:
                             if (scriptingEnabled) {
                                 errStrayEndTag(name);
                                 break endtagloop;
-                            } else {
-                                // fall through
                             }
+                            // CPPONLY: MOZ_FALLTHROUGH;
                         case A:
                         case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
                         case FONT:
                         case NOBR:
                             if (adoptionAgencyEndTag(name)) {
                                 break endtagloop;
                             }
                             // else handle like any other tag
+                            // CPPONLY: MOZ_FALLTHROUGH;
                         default:
                             if (isCurrent(name)) {
                                 pop();
                                 break endtagloop;
                             }
 
                             eltPos = currentPtr;
                             for (;;) {
@@ -3839,16 +3856,17 @@ public abstract class TreeBuilder<T> imp
                                     break endtagloop;
                                 } else if (eltPos == 0 || node.isSpecial()) {
                                     errStrayEndTag(name);
                                     break endtagloop;
                                 }
                                 eltPos--;
                             }
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_HEAD:
                     switch (group) {
                         case HEAD:
                             pop();
                             mode = AFTER_HEAD;
                             break endtagloop;
                         case BR:
                         case HTML:
@@ -3927,16 +3945,17 @@ public abstract class TreeBuilder<T> imp
                                 resetTheInsertionMode();
                                 continue;
                             } else {
                                 break endtagloop;
                             }
                         default:
                             // fall through to IN_SELECT
                     }
+                    // CPPONLY: MOZ_FALLTHROUGH;
                 case IN_SELECT:
                     switch (group) {
                         case OPTION:
                             if (isCurrent("option")) {
                                 pop();
                                 break endtagloop;
                             } else {
                                 errStrayEndTag(name);
--- a/parser/html/moz.build
+++ b/parser/html/moz.build
@@ -94,10 +94,9 @@ FINAL_LIBRARY = 'xul'
 
 # DEFINES['ENABLE_VOID_MENUITEM'] = True
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
-    CXXFLAGS += ['-Wno-error=shadow',
-                 '-Wno-implicit-fallthrough']
+    CXXFLAGS += ['-Wno-error=shadow']
--- a/parser/html/nsHtml5MetaScanner.cpp
+++ b/parser/html/nsHtml5MetaScanner.cpp
@@ -128,16 +128,17 @@ stateloop:
               NS_HTML5_BREAK(dataloop);
             }
             default: {
               continue;
             }
           }
         }
       dataloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case TAG_OPEN: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -168,16 +169,17 @@ stateloop:
               }
               state = nsHtml5MetaScanner::DATA;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       tagopenloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case TAG_NAME: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -225,16 +227,17 @@ stateloop:
             }
             default: {
               metaState = NO;
               continue;
             }
           }
         }
       tagnameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BEFORE_ATTRIBUTE_NAME: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
@@ -283,16 +286,17 @@ stateloop:
               httpEquivIndex = INT32_MAX;
               contentTypeIndex = INT32_MAX;
               state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
               NS_HTML5_BREAK(beforeattributenameloop);
             }
           }
         }
       beforeattributenameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case ATTRIBUTE_NAME: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -344,16 +348,17 @@ stateloop:
                   httpEquivIndex = INT32_MAX;
                 }
               }
               continue;
             }
           }
         }
       attributenameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BEFORE_ATTRIBUTE_VALUE: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -381,16 +386,17 @@ stateloop:
             default: {
               handleCharInAttributeValue(c);
               state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_UNQUOTED;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       beforeattributevalueloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
@@ -405,16 +411,17 @@ stateloop:
             }
             default: {
               handleCharInAttributeValue(c);
               continue;
             }
           }
         }
       attributevaluedoublequotedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case AFTER_ATTRIBUTE_VALUE_QUOTED: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -439,16 +446,17 @@ stateloop:
             default: {
               state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       afterattributevaluequotedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SELF_CLOSING_START_TAG: {
         c = read();
         switch (c) {
           case -1: {
             NS_HTML5_BREAK(stateloop);
           }
           case '>': {
@@ -561,16 +569,17 @@ stateloop:
             default: {
               state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       markupdeclarationopenloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case MARKUP_DECLARATION_HYPHEN: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -581,16 +590,17 @@ stateloop:
             default: {
               state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       markupdeclarationhyphenloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT_START: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -604,16 +614,17 @@ stateloop:
             }
             default: {
               state = nsHtml5MetaScanner::COMMENT;
               NS_HTML5_BREAK(commentstartloop);
             }
           }
         }
       commentstartloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -622,16 +633,17 @@ stateloop:
               NS_HTML5_BREAK(commentloop);
             }
             default: {
               continue;
             }
           }
         }
       commentloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT_END_DASH: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
@@ -641,16 +653,17 @@ stateloop:
             }
             default: {
               state = nsHtml5MetaScanner::COMMENT;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       commentenddashloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT_END: {
         for (;;) {
           c = read();
           switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
--- a/parser/html/nsHtml5Tokenizer.cpp
+++ b/parser/html/nsHtml5Tokenizer.cpp
@@ -551,23 +551,25 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       dataloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case TAG_OPEN: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (c >= 'A' && c <= 'Z') {
@@ -636,16 +638,17 @@ stateloop:
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       tagopenloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case TAG_NAME: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -655,16 +658,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               strBufToElementNameString();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
@@ -685,29 +689,31 @@ stateloop:
                 mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               if (c >= 'A' && c <= 'Z') {
                 c += 0x20;
               } else if (c == '-') {
                 containsHyphen = true;
               }
               appendStrBuf(c);
               continue;
             }
           }
         }
       tagnameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BEFORE_ATTRIBUTE_NAME: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -716,16 +722,17 @@ stateloop:
           }
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '/': {
               state = P::transition(mViewSource,
@@ -739,39 +746,42 @@ stateloop:
                 mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             case '\"':
             case '\'':
             case '<':
             case '=': {
               if (P::reportErrors) {
                 errBadCharBeforeAttributeNameOrNull(c);
               }
+              MOZ_FALLTHROUGH;
             }
             default: {
               if (c >= 'A' && c <= 'Z') {
                 c += 0x20;
               }
               attributeLine = line;
               clearStrBufBeforeUse();
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::ATTRIBUTE_NAME, reconsume, pos);
               NS_HTML5_BREAK(beforeattributenameloop);
             }
           }
         }
       beforeattributenameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case ATTRIBUTE_NAME: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -781,16 +791,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::AFTER_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               attributeNameComplete();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::AFTER_ATTRIBUTE_NAME,
                                     reconsume,
@@ -821,48 +832,52 @@ stateloop:
                 mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             case '\"':
             case '\'':
             case '<': {
               if (P::reportErrors) {
                 errQuoteOrLtInAttributeNameOrNull(c);
               }
+              MOZ_FALLTHROUGH;
             }
             default: {
               if (c >= 'A' && c <= 'Z') {
                 c += 0x20;
               }
               appendStrBuf(c);
               continue;
             }
           }
         }
       attributenameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BEFORE_ATTRIBUTE_VALUE: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '\"': {
               attributeLine = line;
@@ -904,38 +919,41 @@ stateloop:
                 mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             case '<':
             case '=':
             case '`': {
               if (P::reportErrors) {
                 errLtOrEqualsOrGraveInUnquotedAttributeOrNull(c);
               }
+              MOZ_FALLTHROUGH;
             }
             default: {
               attributeLine = line;
               clearStrBufBeforeUse();
               appendStrBuf(c);
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::ATTRIBUTE_VALUE_UNQUOTED,
                                     reconsume,
                                     pos);
 
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       beforeattributevalueloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -970,24 +988,26 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       attributevaluedoublequotedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case AFTER_ATTRIBUTE_VALUE_QUOTED: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -996,16 +1016,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
@@ -1035,16 +1056,17 @@ stateloop:
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       afterattributevaluequotedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SELF_CLOSING_START_TAG: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
         switch (c) {
           case '>': {
@@ -1085,16 +1107,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               addAttributeWithValue();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
@@ -1120,25 +1143,27 @@ stateloop:
                 mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             case '<':
             case '\"':
             case '\'':
             case '=':
             case '`': {
               if (P::reportErrors) {
                 errUnquotedAttributeValOrNull(c);
               }
+              MOZ_FALLTHROUGH;
             }
             default: {
 
               appendStrBuf(c);
               continue;
             }
           }
         }
@@ -1151,16 +1176,17 @@ stateloop:
           c = checkChar(buf, pos);
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '/': {
               addAttributeWithoutValue();
@@ -1183,23 +1209,25 @@ stateloop:
                 mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             case '\"':
             case '\'':
             case '<': {
               if (P::reportErrors) {
                 errQuoteOrLtInAttributeNameOrNull(c);
               }
+              MOZ_FALLTHROUGH;
             }
             default: {
               addAttributeWithoutValue();
               if (c >= 'A' && c <= 'Z') {
                 c += 0x20;
               }
               clearStrBufBeforeUse();
               appendStrBuf(c);
@@ -1241,30 +1269,32 @@ stateloop:
               if (tokenHandler->cdataSectionAllowed()) {
                 clearStrBufBeforeUse();
                 appendStrBuf(c);
                 index = 0;
                 state = P::transition(
                   mViewSource, nsHtml5Tokenizer::CDATA_START, reconsume, pos);
                 NS_HTML5_CONTINUE(stateloop);
               }
+              MOZ_FALLTHROUGH;
             }
             default: {
               if (P::reportErrors) {
                 errBogusComment();
               }
               clearStrBufBeforeUse();
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       markupdeclarationopenloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case MARKUP_DECLARATION_HYPHEN: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -1284,16 +1314,17 @@ stateloop:
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       markupdeclarationhyphenloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT_START: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -1323,26 +1354,28 @@ stateloop:
             case '\n': {
               appendStrBufLineFeed();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_BREAK(commentstartloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_BREAK(commentstartloop);
             }
           }
         }
       commentstartloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -1359,24 +1392,26 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       commentloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT_END_DASH: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -1395,26 +1430,28 @@ stateloop:
             case '\n': {
               appendStrBufLineFeed();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       commentenddashloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case COMMENT_END: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -1448,16 +1485,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::COMMENT_END_BANG,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               adjustDoubleHyphenAndAppendToStrBufAndErr(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
@@ -1489,16 +1527,17 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
@@ -1534,16 +1573,17 @@ stateloop:
           case '\n': {
             appendStrBufLineFeed();
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
           }
           case '\0': {
             c = 0xfffd;
+            MOZ_FALLTHROUGH;
           }
           default: {
             appendStrBuf(c);
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
           }
         }
@@ -1572,16 +1612,17 @@ stateloop:
             clearStrBufAfterUse();
             cstart = pos;
             reconsume = true;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::CDATA_SECTION, reconsume, pos);
             break;
           }
         }
+        MOZ_FALLTHROUGH;
       }
       case CDATA_SECTION: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -1600,23 +1641,25 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       cdatasectionloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case CDATA_RSQB: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -1631,16 +1674,17 @@ stateloop:
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::CDATA_SECTION, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       cdatarsqb_end:;
+        MOZ_FALLTHROUGH;
       }
       case CDATA_RSQB_RSQB: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -1703,24 +1747,26 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       attributevaluesinglequotedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case CONSUME_CHARACTER_REFERENCE: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
         if (c == '\0') {
           NS_HTML5_BREAK(stateloop);
@@ -1773,16 +1819,17 @@ stateloop:
             appendCharRefBuf(c);
             state =
               P::transition(mViewSource,
                             nsHtml5Tokenizer::CHARACTER_REFERENCE_HILO_LOOKUP,
                             reconsume,
                             pos);
           }
         }
+        MOZ_FALLTHROUGH;
       }
       case CHARACTER_REFERENCE_HILO_LOOKUP: {
         {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (c == '\0') {
@@ -1813,16 +1860,17 @@ stateloop:
           entCol = -1;
           candidate = -1;
           charRefBufMark = 0;
           state = P::transition(mViewSource,
                                 nsHtml5Tokenizer::CHARACTER_REFERENCE_TAIL,
                                 reconsume,
                                 pos);
         }
+        MOZ_FALLTHROUGH;
       }
       case CHARACTER_REFERENCE_TAIL: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (c == '\0') {
@@ -1962,16 +2010,17 @@ stateloop:
             NS_HTML5_CONTINUE(stateloop);
           }
           default: {
             reconsume = true;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::DECIMAL_NRC_LOOP, reconsume, pos);
           }
         }
+        MOZ_FALLTHROUGH;
       }
       case DECIMAL_NRC_LOOP: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -2032,16 +2081,17 @@ stateloop:
                                     nsHtml5Tokenizer::HANDLE_NCR_VALUE,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(decimalloop);
             }
           }
         }
       decimalloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case HANDLE_NCR_VALUE: {
         charRefBufLen = 0;
         handleNcrValue(returnState);
         state = P::transition(mViewSource, returnState, reconsume, pos);
         NS_HTML5_CONTINUE(stateloop);
       }
       case HEX_NCR_LOOP: {
@@ -2139,16 +2189,17 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       }
       case CLOSE_TAG_OPEN: {
@@ -2185,16 +2236,17 @@ stateloop:
             clearStrBufBeforeUse();
             appendStrBuf(c);
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
           }
           case '\0': {
             c = 0xfffd;
+            MOZ_FALLTHROUGH;
           }
           default: {
             if (c >= 'A' && c <= 'Z') {
               c += 0x20;
             }
             if (c >= 'a' && c <= 'z') {
               endTag = true;
               clearStrBufBeforeUse();
@@ -2256,16 +2308,17 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       }
       case RAWTEXT: {
@@ -2294,23 +2347,25 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       rawtextloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case RAWTEXT_RCDATA_LESS_THAN_SIGN: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2328,16 +2383,17 @@ stateloop:
               cstart = pos;
               reconsume = true;
               state = P::transition(mViewSource, returnState, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       rawtextrcdatalessthansignloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case NON_DATA_END_TAG_NAME: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < endTagExpectationAsArray.length) {
@@ -2367,16 +2423,17 @@ stateloop:
                 state = P::transition(mViewSource,
                                       nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                       reconsume,
                                       pos);
                 NS_HTML5_BREAK(stateloop);
               }
               case '\n': {
                 silentLineFeed();
+                MOZ_FALLTHROUGH;
               }
               case ' ':
               case '\t':
               case '\f': {
                 clearStrBufAfterUse();
                 state = P::transition(mViewSource,
                                       nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                       reconsume,
@@ -2445,24 +2502,26 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       boguscommentloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BOGUS_COMMENT_HYPHEN: {
       boguscommenthyphenloop:
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
@@ -2486,16 +2545,17 @@ stateloop:
             case '\n': {
               appendStrBufLineFeed();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
@@ -2527,23 +2587,25 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       scriptdataloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_LESS_THAN_SIGN: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2571,16 +2633,17 @@ stateloop:
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::SCRIPT_DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdatalessthansignloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_ESCAPE_START: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2596,16 +2659,17 @@ stateloop:
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::SCRIPT_DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdataescapestartloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_ESCAPE_START_DASH: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2621,16 +2685,17 @@ stateloop:
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::SCRIPT_DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdataescapestartdashloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_ESCAPED_DASH_DASH: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2664,27 +2729,29 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(scriptdataescapeddashdashloop);
             }
           }
         }
       scriptdataescapeddashdashloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_ESCAPED: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -2713,23 +2780,25 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       scriptdataescapedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_ESCAPED_DASH: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2763,27 +2832,29 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdataescapeddashloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2817,16 +2888,17 @@ stateloop:
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdataescapedlessthanloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPE_START: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           MOZ_ASSERT(index > 0);
@@ -2853,16 +2925,17 @@ stateloop:
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f':
             case '/':
             case '>': {
               state =
                 P::transition(mViewSource,
@@ -2877,16 +2950,17 @@ stateloop:
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdatadoubleescapestartloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -2915,23 +2989,25 @@ stateloop:
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       scriptdatadoubleescapedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -2966,28 +3042,30 @@ stateloop:
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdatadoubleescapeddashloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -3022,28 +3100,30 @@ stateloop:
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdatadoubleescapeddashdashloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -3063,16 +3143,17 @@ stateloop:
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       scriptdatadoubleescapedlessthanloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPE_END: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < 6) {
@@ -3098,16 +3179,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f':
             case '/':
             case '>': {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
@@ -3154,16 +3236,17 @@ stateloop:
           } else {
             reconsume = true;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::DOCTYPE, reconsume, pos);
             NS_HTML5_BREAK(markupdeclarationdoctypeloop);
           }
         }
       markupdeclarationdoctypeloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case DOCTYPE: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -3177,16 +3260,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_DOCTYPE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_DOCTYPE_NAME,
                                     reconsume,
                                     pos);
@@ -3201,16 +3285,17 @@ stateloop:
                                     nsHtml5Tokenizer::BEFORE_DOCTYPE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(doctypeloop);
             }
           }
         }
       doctypeloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BEFORE_DOCTYPE_NAME: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -3219,16 +3304,17 @@ stateloop:
           }
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '>': {
               if (P::reportErrors) {
@@ -3237,30 +3323,32 @@ stateloop:
               forceQuirks = true;
               emitDoctypeToken(pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               if (c >= 'A' && c <= 'Z') {
                 c += 0x20;
               }
               clearStrBufBeforeUse();
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DOCTYPE_NAME, reconsume, pos);
               NS_HTML5_BREAK(beforedoctypenameloop);
             }
           }
         }
       beforedoctypenameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case DOCTYPE_NAME: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -3270,16 +3358,17 @@ stateloop:
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::AFTER_DOCTYPE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               strBufToDoctypeName();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::AFTER_DOCTYPE_NAME,
                                     reconsume,
@@ -3290,41 +3379,44 @@ stateloop:
               strBufToDoctypeName();
               emitDoctypeToken(pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               if (c >= 'A' && c <= 'Z') {
                 c += 0x0020;
               }
               appendStrBuf(c);
               continue;
             }
           }
         }
       doctypenameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case AFTER_DOCTYPE_NAME: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '>': {
               emitDoctypeToken(pos);
@@ -3350,16 +3442,17 @@ stateloop:
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       afterdoctypenameloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case DOCTYPE_UBLIC: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < 5) {
@@ -3382,16 +3475,17 @@ stateloop:
               P::transition(mViewSource,
                             nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_KEYWORD,
                             reconsume,
                             pos);
             NS_HTML5_BREAK(doctypeublicloop);
           }
         }
       doctypeublicloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case AFTER_DOCTYPE_PUBLIC_KEYWORD: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -3405,16 +3499,17 @@ stateloop:
                 mViewSource,
                 nsHtml5Tokenizer::BEFORE_DOCTYPE_PUBLIC_IDENTIFIER,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::BEFORE_DOCTYPE_PUBLIC_IDENTIFIER,
                 reconsume,
@@ -3459,30 +3554,32 @@ stateloop:
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       afterdoctypepublickeywordloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '\"': {
               clearStrBufBeforeUse();
@@ -3516,16 +3613,17 @@ stateloop:
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       beforedoctypepublicidentifierloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -3554,24 +3652,26 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       doctypepublicidentifierdoublequotedloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -3581,16 +3681,17 @@ stateloop:
                 mViewSource,
                 nsHtml5Tokenizer::BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS,
                 reconsume,
@@ -3631,30 +3732,32 @@ stateloop:
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       afterdoctypepublicidentifierloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '>': {
               emitDoctypeToken(pos);
@@ -3684,16 +3787,17 @@ stateloop:
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       betweendoctypepublicandsystemidentifiersloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -3722,16 +3826,17 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       }
@@ -3743,16 +3848,17 @@ stateloop:
           c = checkChar(buf, pos);
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '>': {
               emitDoctypeToken(pos);
@@ -3764,16 +3870,17 @@ stateloop:
               bogusDoctypeWithoutQuirks();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_BREAK(afterdoctypesystemidentifierloop);
             }
           }
         }
       afterdoctypesystemidentifierloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BOGUS_DOCTYPE: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -3788,16 +3895,17 @@ stateloop:
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             default: {
               continue;
             }
           }
         }
       }
       case DOCTYPE_YSTEM: {
@@ -3826,16 +3934,17 @@ stateloop:
               P::transition(mViewSource,
                             nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_KEYWORD,
                             reconsume,
                             pos);
             NS_HTML5_BREAK(doctypeystemloop);
           }
         }
       doctypeystemloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case AFTER_DOCTYPE_SYSTEM_KEYWORD: {
         for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
@@ -3849,16 +3958,17 @@ stateloop:
                 mViewSource,
                 nsHtml5Tokenizer::BEFORE_DOCTYPE_SYSTEM_IDENTIFIER,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::BEFORE_DOCTYPE_SYSTEM_IDENTIFIER,
                 reconsume,
@@ -3903,30 +4013,32 @@ stateloop:
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       afterdoctypesystemkeywordloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
+              MOZ_FALLTHROUGH;
             }
             case ' ':
             case '\t':
             case '\f': {
               continue;
             }
             case '\"': {
               clearStrBufBeforeUse();
@@ -3960,16 +4072,17 @@ stateloop:
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       beforedoctypesystemidentifierloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           switch (c) {
@@ -3998,16 +4111,17 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       }
@@ -4043,16 +4157,17 @@ stateloop:
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               appendStrBufLineFeed();
               continue;
             }
             case '\0': {
               c = 0xfffd;
+              MOZ_FALLTHROUGH;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       }
@@ -4072,16 +4187,17 @@ stateloop:
               NS_HTML5_BREAK(processinginstructionloop);
             }
             default: {
               continue;
             }
           }
         }
       processinginstructionloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case PROCESSING_INSTRUCTION_QUESTION_MARK: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
         switch (c) {
           case '>': {
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -320,16 +320,17 @@ nsHtml5TreeBuilder::characters(const cha
   }
   switch (mode) {
     case IN_BODY:
     case IN_CELL:
     case IN_CAPTION: {
       if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) {
         reconstructTheActiveFormattingElements();
       }
+      MOZ_FALLTHROUGH;
     }
     case TEXT: {
       accumulateCharacters(buf, start, length);
       return;
     }
     case IN_TABLE:
     case IN_TABLE_BODY:
     case IN_ROW: {
@@ -620,16 +621,17 @@ nsHtml5TreeBuilder::eof()
       case IN_COLUMN_GROUP:
       case FRAMESET_OK:
       case IN_CAPTION:
       case IN_CELL:
       case IN_BODY: {
         if (isTemplateModeStackEmpty()) {
           NS_HTML5_BREAK(eofloop);
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_TEMPLATE: {
         int32_t eltPos = findLast(nsGkAtoms::_template);
         if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
           MOZ_ASSERT(fragment);
           NS_HTML5_BREAK(eofloop);
         }
         if (MOZ_UNLIKELY(mViewSource)) {
@@ -755,16 +757,17 @@ starttagloop:
               errHtmlStartTagInForeignContext(name);
               if (!fragment) {
                 while (!isSpecialParentInForeign(stack[currentPtr])) {
                   pop();
                 }
                 NS_HTML5_CONTINUE(starttagloop);
               }
             }
+            MOZ_FALLTHROUGH;
           }
           default: {
             if (kNameSpaceID_SVG == currNs) {
               attributes->adjustForSvg();
               if (selfClosing) {
                 appendVoidElementToCurrentMayFosterSVG(elementName, attributes);
                 selfClosing = false;
               } else {
@@ -885,16 +888,17 @@ starttagloop:
             }
             clearStackBackTo(eltPos);
             pop();
             mode = IN_TABLE_BODY;
             continue;
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_TABLE_BODY: {
         switch (group) {
           case TR: {
             clearStackBackTo(
               findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
             appendToCurrentNodeAndPushElement(elementName, attributes);
             mode = IN_ROW;
@@ -924,16 +928,17 @@ starttagloop:
               clearStackBackTo(eltPos);
               pop();
               mode = IN_TABLE;
               continue;
             }
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_TABLE: {
         for (;;) {
           switch (group) {
             case CAPTION: {
               clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
               insertMarker();
               appendToCurrentNodeAndPushElement(elementName, attributes);
@@ -1036,16 +1041,17 @@ starttagloop:
             }
             default: {
               errStartTagInTable(name);
               NS_HTML5_BREAK(intableloop);
             }
           }
         }
       intableloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case IN_CAPTION: {
         switch (group) {
           case CAPTION:
           case COL:
           case COLGROUP:
           case TBODY_OR_THEAD_OR_TFOOT:
           case TR:
@@ -1063,16 +1069,17 @@ starttagloop:
               pop();
             }
             clearTheListOfActiveFormattingElementsUpToTheLastMarker();
             mode = IN_TABLE;
             continue;
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_CELL: {
         switch (group) {
           case CAPTION:
           case COL:
           case COLGROUP:
           case TBODY_OR_THEAD_OR_TFOOT:
           case TR:
@@ -1083,16 +1090,17 @@ starttagloop:
               NS_HTML5_BREAK(starttagloop);
             } else {
               closeTheCell(eltPos);
               continue;
             }
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case FRAMESET_OK: {
         switch (group) {
           case FRAMESET: {
             if (mode == FRAMESET_OK) {
               if (!currentPtr || stack[1]->getGroup() != BODY) {
                 MOZ_ASSERT(fragment || isTemplateContents());
                 errStrayStartTag(name);
@@ -1135,19 +1143,21 @@ starttagloop:
                 !(group == INPUT &&
                   nsHtml5Portability::
                     lowerCaseLiteralEqualsIgnoreAsciiCaseString(
                       "hidden",
                       attributes->getValue(nsHtml5AttributeName::ATTR_TYPE)))) {
               framesetOk = false;
               mode = IN_BODY;
             }
+            MOZ_FALLTHROUGH;
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_BODY: {
         for (;;) {
           switch (group) {
             case HTML: {
               errStrayStartTag(name);
               if (!fragment && !isTemplateContents()) {
                 addAttributesToHtml(attributes);
@@ -1358,16 +1368,17 @@ starttagloop:
               mode = IN_TABLE;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case BR:
             case EMBED:
             case AREA_OR_WBR: {
               reconstructTheActiveFormattingElements();
+              MOZ_FALLTHROUGH;
             }
 #ifdef ENABLE_VOID_MENUITEM
             case MENUITEM:
 #endif
             case PARAM_OR_SOURCE_OR_TRACK: {
               appendVoidElementToCurrentMayFoster(elementName, attributes);
               selfClosing = false;
               attributes = nullptr;
@@ -1420,18 +1431,18 @@ starttagloop:
             }
             case NOSCRIPT: {
               if (!scriptingEnabled) {
                 reconstructTheActiveFormattingElements();
                 appendToCurrentNodeAndPushElementMayFoster(elementName,
                                                            attributes);
                 attributes = nullptr;
                 NS_HTML5_BREAK(starttagloop);
-              } else {
               }
+              MOZ_FALLTHROUGH;
             }
             case NOFRAMES:
             case IFRAME:
             case NOEMBED: {
               startTagGenericRawText(elementName, attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
@@ -1555,16 +1566,17 @@ starttagloop:
               appendToCurrentNodeAndPushElementMayFoster(elementName,
                                                          attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
           }
         }
       inbodyloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case IN_HEAD: {
         for (;;) {
           switch (group) {
             case HTML: {
               errStrayStartTag(name);
               if (!fragment && !isTemplateContents()) {
                 addAttributesToHtml(attributes);
@@ -1625,16 +1637,17 @@ starttagloop:
             default: {
               pop();
               mode = AFTER_HEAD;
               NS_HTML5_CONTINUE(starttagloop);
             }
           }
         }
       inheadloop_end:;
+        MOZ_FALLTHROUGH;
       }
       case IN_HEAD_NOSCRIPT: {
         switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
@@ -1729,16 +1742,17 @@ starttagloop:
             while (currentPtr >= eltPos) {
               pop();
             }
             resetTheInsertionMode();
             continue;
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_SELECT: {
         switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
@@ -1837,16 +1851,17 @@ starttagloop:
           case FRAME: {
             appendVoidElementToCurrentMayFoster(elementName, attributes);
             selfClosing = false;
             attributes = nullptr;
             NS_HTML5_BREAK(starttagloop);
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case AFTER_FRAMESET: {
         switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
@@ -2411,16 +2426,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case TEMPLATE: {
             break;
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_ROW: {
         switch (group) {
           case TR: {
             eltPos = findLastOrRoot(nsHtml5TreeBuilder::TR);
             if (!eltPos) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errNoTableRowToClose();
@@ -2466,16 +2482,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case COLGROUP:
           case HTML:
           case TD_OR_TH: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_TABLE_BODY: {
         switch (group) {
           case TBODY_OR_THEAD_OR_TFOOT: {
             eltPos = findLastOrRoot(name);
             if (!eltPos) {
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
@@ -2504,16 +2521,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case HTML:
           case TD_OR_TH:
           case TR: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_TABLE: {
         switch (group) {
           case TABLE: {
             eltPos = findLast(nsGkAtoms::table);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errStrayEndTag(name);
@@ -2538,16 +2556,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           }
           case TEMPLATE: {
             break;
           }
           default: {
             errStrayEndTag(name);
           }
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_CAPTION: {
         switch (group) {
           case CAPTION: {
             eltPos = findLastInTableScope(nsGkAtoms::caption);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               NS_HTML5_BREAK(endtagloop);
             }
@@ -2586,16 +2605,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case TBODY_OR_THEAD_OR_TFOOT:
           case TD_OR_TH:
           case TR: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_CELL: {
         switch (group) {
           case TD_OR_TH: {
             eltPos = findLastInTableScope(name);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
@@ -2630,16 +2650,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case COL:
           case COLGROUP:
           case HTML: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case FRAMESET_OK:
       case IN_BODY: {
         switch (group) {
           case BODY: {
             if (!isSecondOnStackBody()) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errStrayEndTag(name);
@@ -2879,26 +2900,27 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case TEXTAREA: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
           case NOSCRIPT: {
             if (scriptingEnabled) {
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
-            } else {
             }
+            MOZ_FALLTHROUGH;
           }
           case A:
           case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
           case FONT:
           case NOBR: {
             if (adoptionAgencyEndTag(name)) {
               NS_HTML5_BREAK(endtagloop);
             }
+            MOZ_FALLTHROUGH;
           }
           default: {
             if (isCurrent(name)) {
               pop();
               NS_HTML5_BREAK(endtagloop);
             }
             eltPos = currentPtr;
             for (;;) {
@@ -2915,16 +2937,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
               } else if (!eltPos || node->isSpecial()) {
                 errStrayEndTag(name);
                 NS_HTML5_BREAK(endtagloop);
               }
               eltPos--;
             }
           }
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_HEAD: {
         switch (group) {
           case HEAD: {
             pop();
             mode = AFTER_HEAD;
             NS_HTML5_BREAK(endtagloop);
           }
@@ -3019,16 +3042,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
               resetTheInsertionMode();
               continue;
             } else {
               NS_HTML5_BREAK(endtagloop);
             }
           }
           default:; // fall through
         }
+        MOZ_FALLTHROUGH;
       }
       case IN_SELECT: {
         switch (group) {
           case OPTION: {
             if (isCurrent(nsGkAtoms::option)) {
               pop();
               NS_HTML5_BREAK(endtagloop);
             } else {