Bug 983899, part 1 - Delete some trailing whitespace in XBL. r=mrbkap

This commit is contained in:
Andrew McCreight 2014-03-18 14:25:39 -07:00
parent 86f527ecb1
commit 69ec149e2d
3 changed files with 40 additions and 41 deletions

View File

@ -75,7 +75,7 @@ XBLFinalize(JSFreeOp *fop, JSObject *obj)
nsXBLDocumentInfo* docInfo =
static_cast<nsXBLDocumentInfo*>(::JS_GetPrivate(obj));
nsContentUtils::DeferredFinalize(docInfo);
nsXBLJSClass* c = nsXBLJSClass::fromJSClass(::JS_GetClass(obj));
c->Drop();
}
@ -265,7 +265,7 @@ nsXBLBinding::InstallAnonymousContent(nsIContent* aAnonParent, nsIContent* aElem
// XXXbz This really shouldn't be a void method!
child->UnbindFromTree();
return;
}
}
child->SetFlags(NODE_IS_ANONYMOUS_ROOT);
@ -360,7 +360,7 @@ nsXBLBinding::GenerateAnonymousContent()
return;
}
// Find out if we're really building kids or if we're just
// using the attribute-setting shorthand hack.
uint32_t contentCount = content->GetChildCount();
@ -478,7 +478,7 @@ nsXBLBinding::FindInsertionPointFor(nsIContent* aChild)
if (mContent) {
return FindInsertionPointForInternal(aChild);
}
return mNextBinding ? mNextBinding->FindInsertionPointFor(aChild)
: nullptr;
}
@ -492,7 +492,7 @@ nsXBLBinding::FindInsertionPointForInternal(nsIContent* aChild)
return point;
}
}
return mDefaultInsertionPoint;
}
@ -584,7 +584,7 @@ nsXBLBinding::InstallEventHandlers()
nsAutoString type;
handler->GetEventName(type);
// If this is a command, add it in the system event group, otherwise
// If this is a command, add it in the system event group, otherwise
// add it to the standard event group.
// Figure out if we're using capturing or not.
@ -684,7 +684,7 @@ nsXBLBinding::UnhookEventHandlers()
if (!manager) {
return;
}
bool isChromeBinding = mPrototypeBinding->IsChrome();
nsXBLPrototypeHandler* curr;
for (curr = handlerChain; curr; curr = curr->GetNextHandler()) {
@ -692,7 +692,7 @@ nsXBLBinding::UnhookEventHandlers()
if (!handler) {
continue;
}
nsCOMPtr<nsIAtom> eventAtom = curr->GetEventName();
if (!eventAtom ||
eventAtom == nsGkAtoms::keyup ||
@ -731,7 +731,7 @@ nsXBLBinding::UnhookEventHandlers()
EventListenerFlags flags;
flags.mCapture = (handler->GetPhase() == NS_PHASE_CAPTURING);
// If this is a command, remove it from the system event group, otherwise
// If this is a command, remove it from the system event group, otherwise
// remove it from the standard event group.
if ((handler->GetType() & (NS_HANDLER_TYPE_XBL_COMMAND | NS_HANDLER_TYPE_SYSTEM)) &&
@ -905,7 +905,7 @@ nsXBLBinding::InheritsStyle() const
// XXX What about bindings with <content> but no kids, e.g., my treecell-text binding?
if (mContent)
return mPrototypeBinding->InheritsStyle();
if (mNextBinding)
return mNextBinding->InheritsStyle();
@ -1034,7 +1034,7 @@ nsXBLBinding::DoInitJSClass(JSContext *cx, JS::Handle<JSObject*> global,
// Make a new object prototyped by parent_proto and parented by global.
proto = ::JS_InitClass(cx, // context
global, // global object
parent_proto, // parent proto
parent_proto, // parent proto
c, // JSClass
nullptr, // JSNative ctor
0, // ctor args

View File

@ -154,7 +154,7 @@ public:
}
};
// nsXBLStreamListener, a helper class used for
// nsXBLStreamListener, a helper class used for
// asynchronous parsing of URLs
/* Header file */
class nsXBLStreamListener MOZ_FINAL : public nsIStreamListener,
@ -177,7 +177,7 @@ public:
private:
nsCOMPtr<nsIStreamListener> mInner;
nsAutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
nsCOMPtr<nsIWeakReference> mBoundDocument;
nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
nsCOMPtr<nsIDocument> mBindingDocument; // Only set until OnStartRequest
@ -247,7 +247,7 @@ nsXBLStreamListener::OnStartRequest(nsIRequest* request, nsISupports* aCtxt)
return mInner->OnStartRequest(request, aCtxt);
}
NS_IMETHODIMP
NS_IMETHODIMP
nsXBLStreamListener::OnStopRequest(nsIRequest* request, nsISupports* aCtxt, nsresult aStatus)
{
nsresult rv = NS_OK;
@ -301,7 +301,7 @@ nsXBLStreamListener::HandleEvent(nsIDOMEvent* aEvent)
// We have to do a flush prior to notification of the document load.
// This has to happen since the HTML content sink can be holding on
// to notifications related to our children (e.g., if you bind to the
// <body> tag) that result in duplication of content.
// <body> tag) that result in duplication of content.
// We need to get the sink's notifications flushed and then make the binding
// ready.
if (count > 0) {
@ -347,7 +347,7 @@ nsXBLStreamListener::HandleEvent(nsIDOMEvent* aEvent)
cache->PutXBLDocumentInfo(info);
}
#endif
bindingManager->PutXBLDocumentInfo(info);
// Notify all pending requests that their bindings are
@ -423,7 +423,7 @@ nsXBLService::IsChromeOrResourceURI(nsIURI* aURI)
{
bool isChrome = false;
bool isResource = false;
if (NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)) &&
if (NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)) &&
NS_SUCCEEDED(aURI->SchemeIs("resource", &isResource)))
return (isChrome || isResource);
return false;
@ -435,10 +435,10 @@ nsXBLService::IsChromeOrResourceURI(nsIURI* aURI)
nsresult
nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL,
nsIPrincipal* aOriginPrincipal,
nsXBLBinding** aBinding, bool* aResolveStyle)
nsXBLBinding** aBinding, bool* aResolveStyle)
{
NS_PRECONDITION(aOriginPrincipal, "Must have an origin principal");
*aBinding = nullptr;
*aResolveStyle = false;
@ -518,11 +518,11 @@ nsXBLService::LoadBindings(nsIContent* aContent, nsIURI* aURL,
// Figure out if we have any scoped sheets. If so, we do a second resolve.
*aResolveStyle = newBinding->HasStyleSheets();
newBinding.swap(*aBinding);
}
return NS_OK;
return NS_OK;
}
nsresult
@ -537,7 +537,7 @@ nsXBLService::FlushStyleBindings(nsIContent* aContent)
aContent->SetXBLBinding(nullptr); // Flush old style bindings
}
return NS_OK;
}
@ -659,7 +659,7 @@ nsXBLService::FlushMemory()
nsresult
nsXBLService::BindingReady(nsIContent* aBoundElement,
nsIURI* aURI,
nsIURI* aURI,
bool* aIsReady)
{
// Don't do a security check here; we know this binding is set to go.
@ -667,7 +667,7 @@ nsXBLService::BindingReady(nsIContent* aBoundElement,
}
nsresult
nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
bool* aIsReady, nsXBLBinding** aResult)
{
@ -678,7 +678,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
}
nsresult
nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
bool* aIsReady, nsXBLBinding** aResult,
nsTArray<nsIURI*>& aDontExtendURIs)
@ -686,7 +686,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
NS_ASSERTION(aPeekOnly || aResult,
"Must have non-null out param if not just peeking to see "
"whether the binding is ready");
if (aResult)
*aResult = nullptr;
@ -703,7 +703,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
aOriginPrincipal,
false, getter_AddRefs(docInfo));
NS_ENSURE_SUCCESS(rv, rv);
if (!docInfo)
return NS_ERROR_FAILURE;
@ -821,11 +821,11 @@ IsSystemOrChromeURLPrincipal(nsIPrincipal* aPrincipal)
if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
return true;
}
nsCOMPtr<nsIURI> uri;
aPrincipal->GetURI(getter_AddRefs(uri));
NS_ENSURE_TRUE(uri, false);
bool isChrome = false;
return NS_SUCCEEDED(uri->SchemeIs("chrome", &isChrome)) && isChrome;
}
@ -841,11 +841,11 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
NS_PRECONDITION(aBindingURI, "Must have a binding URI");
NS_PRECONDITION(!aOriginPrincipal || aBoundDocument,
"If we're doing a security check, we better have a document!");
nsresult rv;
if (aOriginPrincipal) {
// Security check - Enforce same-origin policy, except to chrome.
// We have to be careful to not pass aContent as the context here.
// We have to be careful to not pass aContent as the context here.
// Otherwise, if there is a JS-implemented content policy, we will attempt
// to wrap the content node, which will try to load XBL bindings for it, if
// any. Since we're not done loading this binding yet, that will reenter
@ -886,13 +886,13 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
#ifdef MOZ_XUL
// We've got a file. Check our XBL document cache.
nsXULPrototypeCache* cache = nsXULPrototypeCache::GetInstance();
bool useXULCache = cache && cache->IsEnabled();
bool useXULCache = cache && cache->IsEnabled();
if (useXULCache) {
// The first line of defense is the chrome cache.
// The first line of defense is the chrome cache.
// This cache crosses the entire product, so that any XBL bindings that are
// part of chrome will be reused across all XUL documents.
info = cache->GetXBLDocumentInfo(documentURI);
info = cache->GetXBLDocumentInfo(documentURI);
}
#endif
@ -957,7 +957,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
if (!info) {
// Finally, if all lines of defense fail, we go and fetch the binding
// document.
// Always load chrome synchronously
bool chrome;
if (NS_SUCCEEDED(documentURI->SchemeIs("chrome", &chrome)) && chrome)
@ -985,7 +985,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
info->WritePrototypeBindings();
}
#endif
if (bindingManager) {
// Also put it in our binding manager's document table.
bindingManager->PutXBLDocumentInfo(info);
@ -1001,7 +1001,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
nsresult
nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoundDocument,
nsIURI* aDocumentURI, nsIURI* aBindingURI,
nsIURI* aDocumentURI, nsIURI* aBindingURI,
bool aForceSyncLoad, nsIDocument** aResult)
{
nsresult rv = NS_OK;
@ -1009,7 +1009,7 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun
*aResult = nullptr;
// Now we have to synchronously load the binding file.
// Create an XML content sink and a parser.
// Create an XML content sink and a parser.
nsCOMPtr<nsILoadGroup> loadGroup;
if (aBoundDocument)
loadGroup = aBoundDocument->GetDocumentLoadGroup();
@ -1092,4 +1092,3 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun
return NS_OK;
}

View File

@ -84,10 +84,10 @@ protected:
// Release any memory that we can
nsresult FlushMemory();
// This method synchronously loads and parses an XBL file.
nsresult FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoundDocument,
nsIURI* aDocumentURI, nsIURI* aBindingURI,
nsIURI* aDocumentURI, nsIURI* aBindingURI,
bool aForceSyncLoad, nsIDocument** aResult);
/**