mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 553808, assertion setting template datasources, r=smaug, a=blocking
This commit is contained in:
parent
65f2786c41
commit
7c2f5f4252
@ -1139,13 +1139,8 @@ nsXULTemplateBuilder::AttributeChanged(nsIDocument* aDocument,
|
||||
// Check for a change to the 'datasources' attribute. If so, setup
|
||||
// mDB by parsing the new value and rebuild.
|
||||
else if (aAttribute == nsGkAtoms::datasources) {
|
||||
Uninit(PR_FALSE); // Reset results
|
||||
|
||||
PRBool shouldDelay;
|
||||
LoadDataSources(aDocument, &shouldDelay);
|
||||
if (!shouldDelay)
|
||||
nsContentUtils::AddScriptRunner(
|
||||
NS_NewRunnableMethod(this, &nsXULTemplateBuilder::RunnableRebuild));
|
||||
nsContentUtils::AddScriptRunner(
|
||||
NS_NewRunnableMethod(this, &nsXULTemplateBuilder::RunnableLoadAndRebuild));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1163,8 +1158,9 @@ nsXULTemplateBuilder::ContentRemoved(nsIDocument* aDocument,
|
||||
if (mQueryProcessor)
|
||||
mQueryProcessor->Done();
|
||||
|
||||
// use false since content is going away anyway
|
||||
Uninit(PR_FALSE);
|
||||
// Pass false to Uninit since content is going away anyway
|
||||
nsContentUtils::AddScriptRunner(
|
||||
NS_NewRunnableMethod(this, &nsXULTemplateBuilder::UninitFalse));
|
||||
|
||||
aDocument->RemoveObserver(this);
|
||||
|
||||
@ -1201,7 +1197,8 @@ nsXULTemplateBuilder::NodeWillBeDestroyed(const nsINode* aNode)
|
||||
mCompDB = nsnull;
|
||||
mRoot = nsnull;
|
||||
|
||||
Uninit(PR_TRUE);
|
||||
nsContentUtils::AddScriptRunner(
|
||||
NS_NewRunnableMethod(this, &nsXULTemplateBuilder::UninitTrue));
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,6 +152,20 @@ public:
|
||||
RebuildAll() = 0; // must be implemented by subclasses
|
||||
|
||||
void RunnableRebuild() { Rebuild(); }
|
||||
void RunnableLoadAndRebuild() {
|
||||
Uninit(PR_FALSE); // Reset results
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = mRoot ? mRoot->GetDocument() : nsnull;
|
||||
if (doc) {
|
||||
PRBool shouldDelay;
|
||||
LoadDataSources(doc, &shouldDelay);
|
||||
if (!shouldDelay) {
|
||||
Rebuild();
|
||||
}
|
||||
}
|
||||
}
|
||||
void UninitFalse() { Uninit(PR_FALSE); }
|
||||
void UninitTrue() { Uninit(PR_TRUE); }
|
||||
|
||||
/**
|
||||
* Find the <template> tag that applies for this builder
|
||||
|
@ -27,8 +27,7 @@ function checkConsole(expectedError)
|
||||
{
|
||||
var out = {};
|
||||
consoleService.getMessageArray(out, {});
|
||||
var messages = out.value || [];
|
||||
is(messages[0].message, expectedError, "logged message " + expectedError);
|
||||
is(out.value[0].message, expectedError, "logged message " + expectedError);
|
||||
}
|
||||
|
||||
// each test consists of a pre function executed before the template build, an
|
||||
|
Loading…
Reference in New Issue
Block a user