[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

beidson at apple.com beidson at apple.com
Thu Oct 29 20:31:40 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit b37c6d0e20dafac009e8723152967ec51f4dc896
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 22 02:15:29 2009 +0000

    Add coding style guidelines for 'using namespace.'
    https://bugs.webkit.org/show_bug.cgi?id=29499
    
    Reviewed by Darin Adler.
    
    * coding/coding-style.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48616 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitSite/ChangeLog b/WebKitSite/ChangeLog
index 0b3736e..3e6e094 100644
--- a/WebKitSite/ChangeLog
+++ b/WebKitSite/ChangeLog
@@ -1,5 +1,14 @@
 2009-09-21  Brady Eidson  <beidson at apple.com>
 
+        Reviewed by Darin Adler.
+
+        Add coding style guidelines for 'using namespace.'
+        https://bugs.webkit.org/show_bug.cgi?id=29499
+
+        * coding/coding-style.html:
+
+2009-09-21  Brady Eidson  <beidson at apple.com>
+
         Rubberstamped by Sam Weinig.
 
         Add some example files for an upcoming blog post.
diff --git a/WebKitSite/coding/coding-style.html b/WebKitSite/coding/coding-style.html
index b2d4d94..0ad12a5 100644
--- a/WebKitSite/coding/coding-style.html
+++ b/WebKitSite/coding/coding-style.html
@@ -704,7 +704,60 @@ Don't bother to organize them in a logical order.
 #include "QualifiedName.h"
 #include "Attribute.h"
 </pre>
+</ol>
+
+<h3>"using namespace" Statements</h3>
+
+<ol>
+
+<li>Any "using namespace" statements for a nested namespace whose parent namespace 
+is also defined in a file must be declared within that namespace definition.
+
+<h4 class="right">Right:</h4>
+<pre class="code">
+// HTMLBaseElement.cpp
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+} // namespace WebCore
+</pre>
+
+<h4 class="wrong">Wrong:</h4>
+<pre class="code">
+// HTMLBaseElement.cpp
+
+using namespace WebCore::HTMLNames;
+
+namespace WebCore {
 
+} // namespace WebCore
+</pre>
+
+<li>Any other "using namespace" statements must be declared before the first namespace 
+definition in the file.
+<h4 class="right">Right:</h4>
+<pre class="code">
+// HTMLSelectElement.cpp
+
+using namespace std;
+
+namespace WebCore {
+
+} // namespace WebCore
+</pre>
+
+<h4 class="wrong">Wrong:</h4>
+<pre class="code">
+// HTMLSelectElement.cpp
+
+namespace WebCore {
+
+using namespace std;
+
+} // namespace WebCore
+</pre>
 </ol>
 
 <?php

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list