Reviewed by Maciej
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jan 2007 07:23:27 +0000 (07:23 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jan 2007 07:23:27 +0000 (07:23 +0000)
        * coding/coding-style.html: Added switch/case indentation rules

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18881 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitSite/ChangeLog
WebKitSite/coding/coding-style.html

index 65d53a86ab16404f2619e219cf7cd91e781c06ac..394fc157afe8cc314ca32a60923d8c91b6b786a4 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-15  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Maciej
+
+        * coding/coding-style.html: Added switch/case indentation rules
+
 2007-01-15  Eric Seidel  <eric@webkit.org>
 
         Reviewed by bdash.
index 8e90b12ac32cdbbb04e7bd6afb25f6f4cf0d1af5..08898e5a2e7778772d1cc86bbf05dca8eef88635 100644 (file)
@@ -96,6 +96,31 @@ namespace WebCore {
 } // namespace WebCore
 </pre>
 </li>
+<li>A case label should line up with its switch statement.  The case statement is indented.
+<h4 class="right">Right:</h4>
+<pre class="code">
+switch (condition) {
+case fooCondition:
+case barCondition:
+    i++;
+    break;
+default:
+    i--;
+}
+</pre>
+
+<h4 class="wrong">Wrong:</h4>
+<pre class="code">
+switch (condition) {
+    case fooCondition:
+    case barCondition:
+        i++;
+        break;
+    default:
+        i--;
+}
+</pre>
+</li>
 </ol>
 
 <h3>Spacing</h3>