Bug 1216893 - Add in disabled namespace for SVG r=hsivonen,smaug

MozReview-Commit-ID: 7Gum6wazraS
This commit is contained in:
Jonathan Kingston
2016-12-01 07:41:22 +00:00
parent 00db9a9c29
commit 87bc70f75d
14 changed files with 271 additions and 11 deletions

View File

@@ -10,6 +10,7 @@
#include "nsStyleLinkElement.h"
#include "nsScriptLoader.h"
#include "nsIHTMLDocument.h"
#include "nsNameSpaceManager.h"
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHtml5DocumentBuilder, nsContentSink,
mOwnedElements)
@@ -57,6 +58,12 @@ nsHtml5DocumentBuilder::SetDocumentCharsetAndSource(nsACString& aCharset, int32_
void
nsHtml5DocumentBuilder::UpdateStyleSheet(nsIContent* aElement)
{
nsCOMPtr<nsIStyleSheetLinkingElement> ssle(do_QueryInterface(aElement));
if (!ssle) {
MOZ_ASSERT(nsNameSpaceManager::GetInstance()->mSVGDisabled, "Node didn't QI to style, but SVG wasn't disabled.");
return;
}
// Break out of the doc update created by Flush() to zap a runnable
// waiting to call UpdateStyleSheet without the right observer
EndDocUpdate();
@@ -66,9 +73,6 @@ nsHtml5DocumentBuilder::UpdateStyleSheet(nsIContent* aElement)
return;
}
nsCOMPtr<nsIStyleSheetLinkingElement> ssle(do_QueryInterface(aElement));
NS_ASSERTION(ssle, "Node didn't QI to style.");
ssle->SetEnableUpdates(true);
bool willNotify;