Bug 1147946, part 7 - Remove trailing whitespace from nsXULContentSink.cpp. r=baku
authorAndrew McCreight <continuation@gmail.com>
Fri, 03 Apr 2015 08:56:54 -0700
changeset 267404 f7faee1e85ea1811f9fdcafecf4c3edd4eddfc2f
parent 267403 269ce19afa4342567b819de3248ec5d540d4de70
child 267405 e45901374cd43e4fba82c1df64cec32665136861
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1147946
milestone40.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 1147946, part 7 - Remove trailing whitespace from nsXULContentSink.cpp. r=baku
dom/xul/nsXULContentSink.cpp
--- a/dom/xul/nsXULContentSink.cpp
+++ b/dom/xul/nsXULContentSink.cpp
@@ -211,96 +211,96 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(XULContentSinkImpl)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(XULContentSinkImpl)
 
 //----------------------------------------------------------------------
 // nsIContentSink interface
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::WillBuildModel(nsDTDMode aDTDMode)
 {
 #if FIXME
     if (! mParentContentSink) {
         // If we're _not_ an overlay, then notify the document that
         // the load is beginning.
         mDocument->BeginLoad();
     }
 #endif
 
     return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::DidBuildModel(bool aTerminated)
 {
     nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
     if (doc) {
         doc->EndLoad();
         mDocument = nullptr;
     }
 
     // Drop our reference to the parser to get rid of a circular
     // reference.
     NS_IF_RELEASE(mParser);
     return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::WillInterrupt(void)
 {
     // XXX Notify the docshell, if necessary
     return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::WillResume(void)
 {
     // XXX Notify the docshell, if necessary
     return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::SetParser(nsParserBase* aParser)
 {
     NS_IF_RELEASE(mParser);
     mParser = aParser;
     NS_IF_ADDREF(mParser);
     return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::SetDocumentCharset(nsACString& aCharset)
 {
     nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
     if (doc) {
         doc->SetDocumentCharacterSet(aCharset);
     }
-  
+
     return NS_OK;
 }
 
 nsISupports *
 XULContentSinkImpl::GetTarget()
 {
     nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
-    return doc;    
+    return doc;
 }
 
 //----------------------------------------------------------------------
 
 nsresult
 XULContentSinkImpl::Init(nsIDocument* aDocument,
                          nsXULPrototypeDocument* aPrototype)
 {
     NS_PRECONDITION(aDocument != nullptr, "null ptr");
     if (! aDocument)
         return NS_ERROR_NULL_POINTER;
-    
+
     nsresult rv;
 
     mDocument    = do_GetWeakReference(aDocument);
     mPrototype   = aPrototype;
 
     mDocumentURL = mPrototype->GetURI();
 
     // XXX this presumes HTTP header info is already set in document
@@ -439,45 +439,45 @@ XULContentSinkImpl::CreateElement(mozill
 
     *aResult = element;
     return NS_OK;
 }
 
 /**** BEGIN NEW APIs ****/
 
 
-NS_IMETHODIMP 
-XULContentSinkImpl::HandleStartElement(const char16_t *aName, 
+NS_IMETHODIMP
+XULContentSinkImpl::HandleStartElement(const char16_t *aName,
                                        const char16_t **aAtts,
-                                       uint32_t aAttsCount, 
+                                       uint32_t aAttsCount,
                                        uint32_t aLineNumber)
-{ 
+{
   // XXX Hopefully the parser will flag this before we get here. If
   // we're in the epilog, there should be no new elements
   NS_PRECONDITION(mState != eInEpilog, "tag in XUL doc epilog");
   NS_PRECONDITION(aAttsCount % 2 == 0, "incorrect aAttsCount");
   // Adjust aAttsCount so it's the actual number of attributes
   aAttsCount /= 2;
-  
+
   if (mState == eInEpilog)
       return NS_ERROR_UNEXPECTED;
 
   if (mState != eInScript) {
       FlushText();
   }
 
   int32_t nameSpaceID;
   nsCOMPtr<nsIAtom> prefix, localName;
   nsContentUtils::SplitExpatName(aName, getter_AddRefs(prefix),
                                  getter_AddRefs(localName), &nameSpaceID);
 
   nsRefPtr<mozilla::dom::NodeInfo> nodeInfo;
   nodeInfo = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
                                            nsIDOMNode::ELEMENT_NODE);
-  
+
   nsresult rv = NS_OK;
   switch (mState) {
   case eInProlog:
       // We're the root document element
       rv = OpenRoot(aAtts, aAttsCount, nodeInfo);
       break;
 
   case eInDocumentElement:
@@ -491,17 +491,17 @@ XULContentSinkImpl::HandleStartElement(c
              aLineNumber));
       rv = NS_ERROR_UNEXPECTED; // XXX
       break;
   }
 
   return rv;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::HandleEndElement(const char16_t *aName)
 {
     // Never EVER return anything but NS_OK or
     // NS_ERROR_HTMLPARSER_BLOCK from this method. Doing so will blow
     // the parser's little mind all over the planet.
     nsresult rv;
 
     nsRefPtr<nsXULPrototypeNode> node;
@@ -578,52 +578,52 @@ XULContentSinkImpl::HandleEndElement(con
 
         mPrototype->SetRootElement(element);
         mState = eInEpilog;
     }
 
     return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::HandleComment(const char16_t *aName)
 {
    FlushText();
    return NS_OK;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 XULContentSinkImpl::HandleCDataSection(const char16_t *aData, uint32_t aLength)
 {
     FlushText();
     return AddText(aData, aLength);
 }
 
-NS_IMETHODIMP 
-XULContentSinkImpl::HandleDoctypeDecl(const nsAString & aSubset, 
-                                      const nsAString & aName, 
-                                      const nsAString & aSystemId, 
+NS_IMETHODIMP
+XULContentSinkImpl::HandleDoctypeDecl(const nsAString & aSubset,
+                                      const nsAString & aName,
+                                      const nsAString & aSystemId,
                                       const nsAString & aPublicId,
                                       nsISupports* aCatalogData)
 {
     return NS_OK;
 }
 
-NS_IMETHODIMP 
-XULContentSinkImpl::HandleCharacterData(const char16_t *aData, 
+NS_IMETHODIMP
+XULContentSinkImpl::HandleCharacterData(const char16_t *aData,
                                         uint32_t aLength)
 {
   if (aData && mState != eInProlog && mState != eInEpilog) {
     return AddText(aData, aLength);
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP 
-XULContentSinkImpl::HandleProcessingInstruction(const char16_t *aTarget, 
+NS_IMETHODIMP
+XULContentSinkImpl::HandleProcessingInstruction(const char16_t *aTarget,
                                                 const char16_t *aData)
 {
     FlushText();
 
     const nsDependentString target(aTarget);
     const nsDependentString data(aData);
 
     // Note: the created nsXULPrototypePI has mRefCnt == 1
@@ -656,17 +656,17 @@ XULContentSinkImpl::HandleXMLDeclaration
                                          const char16_t *aEncoding,
                                          int32_t aStandalone)
 {
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-XULContentSinkImpl::ReportError(const char16_t* aErrorText, 
+XULContentSinkImpl::ReportError(const char16_t* aErrorText,
                                 const char16_t* aSourceText,
                                 nsIScriptError *aError,
                                 bool *_retval)
 {
   NS_PRECONDITION(aError && aSourceText && aErrorText, "Check arguments!!!");
 
   // The expat driver should report the error.
   *_retval = true;
@@ -693,54 +693,54 @@ XULContentSinkImpl::ReportError(const ch
   const char16_t* noAtts[] = { 0, 0 };
 
   NS_NAMED_LITERAL_STRING(errorNs,
                           "http://www.mozilla.org/newlayout/xml/parsererror.xml");
 
   nsAutoString parsererror(errorNs);
   parsererror.Append((char16_t)0xFFFF);
   parsererror.AppendLiteral("parsererror");
-  
+
   rv = HandleStartElement(parsererror.get(), noAtts, 0, 0);
   NS_ENSURE_SUCCESS(rv,rv);
 
   rv = HandleCharacterData(aErrorText, NS_strlen(aErrorText));
-  NS_ENSURE_SUCCESS(rv,rv);  
-  
+  NS_ENSURE_SUCCESS(rv,rv);
+
   nsAutoString sourcetext(errorNs);
   sourcetext.Append((char16_t)0xFFFF);
   sourcetext.AppendLiteral("sourcetext");
 
   rv = HandleStartElement(sourcetext.get(), noAtts, 0, 0);
   NS_ENSURE_SUCCESS(rv,rv);
-  
+
   rv = HandleCharacterData(aSourceText, NS_strlen(aSourceText));
   NS_ENSURE_SUCCESS(rv,rv);
-  
+
   rv = HandleEndElement(sourcetext.get());
-  NS_ENSURE_SUCCESS(rv,rv); 
-  
+  NS_ENSURE_SUCCESS(rv,rv);
+
   rv = HandleEndElement(parsererror.get());
   NS_ENSURE_SUCCESS(rv,rv);
 
   return rv;
 }
 
 nsresult
-XULContentSinkImpl::OpenRoot(const char16_t** aAttributes, 
-                             const uint32_t aAttrLen, 
+XULContentSinkImpl::OpenRoot(const char16_t** aAttributes,
+                             const uint32_t aAttrLen,
                              mozilla::dom::NodeInfo *aNodeInfo)
 {
     NS_ASSERTION(mState == eInProlog, "how'd we get here?");
     if (mState != eInProlog)
         return NS_ERROR_UNEXPECTED;
 
     nsresult rv;
 
-    if (aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XHTML) || 
+    if (aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XHTML) ||
         aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XUL)) {
         PR_LOG(gContentSinkLog, PR_LOG_ERROR,
                ("xul: script tag not allowed as root content element"));
 
         return NS_ERROR_UNEXPECTED;
     }
 
     // Create the element
@@ -774,17 +774,17 @@ XULContentSinkImpl::OpenRoot(const char1
     rv = AddAttributes(aAttributes, aAttrLen, element);
     if (NS_FAILED(rv)) return rv;
 
     mState = eInDocumentElement;
     return NS_OK;
 }
 
 nsresult
-XULContentSinkImpl::OpenTag(const char16_t** aAttributes, 
+XULContentSinkImpl::OpenTag(const char16_t** aAttributes,
                             const uint32_t aAttrLen,
                             const uint32_t aLineNumber,
                             mozilla::dom::NodeInfo *aNodeInfo)
 {
     nsresult rv;
 
     // Create the element
     nsXULPrototypeElement* element;
@@ -814,26 +814,26 @@ XULContentSinkImpl::OpenTag(const char16
     }
 
     // Add the attributes
     rv = AddAttributes(aAttributes, aAttrLen, element);
     if (NS_FAILED(rv)) return rv;
 
     children->AppendElement(element);
 
-    if (aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XHTML) || 
+    if (aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XHTML) ||
         aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XUL)) {
         // Do scripty things now
         rv = OpenScript(aAttributes, aLineNumber);
         NS_ENSURE_SUCCESS(rv, rv);
 
         NS_ASSERTION(mState == eInScript || mState == eInDocumentElement,
                      "Unexpected state");
         if (mState == eInScript) {
-            // OpenScript has pushed the nsPrototypeScriptElement onto the 
+            // OpenScript has pushed the nsPrototypeScriptElement onto the
             // stack, so we're done.
             return NS_OK;
         }
     }
 
     // Push the element onto the context stack, so that child
     // containers will hook up to us as their parent.
     rv = mContextStack.Push(element, mState);
@@ -959,18 +959,18 @@ XULContentSinkImpl::OpenScript(const cha
 
   mContextStack.Push(script, mState);
   mState = eInScript;
 
   return NS_OK;
 }
 
 nsresult
-XULContentSinkImpl::AddAttributes(const char16_t** aAttributes, 
-                                  const uint32_t aAttrLen, 
+XULContentSinkImpl::AddAttributes(const char16_t** aAttributes,
+                                  const uint32_t aAttrLen,
                                   nsXULPrototypeElement* aElement)
 {
   // Add tag attributes to the element
   nsresult rv;
 
   // Create storage for the attributes
   nsXULPrototypeAttribute* attrs = nullptr;
   if (aAttrLen > 0) {
@@ -1008,17 +1008,17 @@ XULContentSinkImpl::AddAttributes(const 
       }
 #endif
   }
 
   return NS_OK;
 }
 
 nsresult
-XULContentSinkImpl::AddText(const char16_t* aText, 
+XULContentSinkImpl::AddText(const char16_t* aText,
                             int32_t aLength)
 {
   // Create buffer when we first need it
   if (0 == mTextSize) {
       mText = (char16_t *) malloc(sizeof(char16_t) * 4096);
       if (nullptr == mText) {
           return NS_ERROR_OUT_OF_MEMORY;
       }
@@ -1042,16 +1042,16 @@ XULContentSinkImpl::AddText(const char16
         mTextSize += aLength;
         mText = (char16_t *) realloc(mText, sizeof(char16_t) * mTextSize);
         if (nullptr == mText) {
             return NS_ERROR_OUT_OF_MEMORY;
         }
       }
     }
     memcpy(&mText[mTextLength],aText + offset, sizeof(char16_t) * amount);
-    
+
     mTextLength += amount;
     offset += amount;
     aLength -= amount;
   }
 
   return NS_OK;
 }