Bug 482921 part 1 - Implement HTML syntax highlighting using the new parser. r=Olli.Pettay.

This commit is contained in:
Henri Sivonen
2010-07-30 13:15:38 +03:00
parent 6d5bbec2af
commit a42c6e14db
37 changed files with 4254 additions and 107 deletions

View File

@@ -893,6 +893,24 @@ nsHtml5TreeOpExecutor::InitializeDocWriteParserState(nsAHtml5TreeBuilderState* a
GetParser()->InitializeDocWriteParserState(aState, aLine);
}
nsIURI*
nsHtml5TreeOpExecutor::GetViewSourceBaseURI()
{
if (!mViewSourceBaseURI) {
nsCOMPtr<nsIURI> orig = mDocument->GetOriginalURI();
bool isViewSource;
orig->SchemeIs("view-source", &isViewSource);
if (isViewSource) {
nsCOMPtr<nsINestedURI> nested = do_QueryInterface(orig);
NS_ASSERTION(nested, "URI with scheme view-source didn't QI to nested!");
nested->GetInnerURI(getter_AddRefs(mViewSourceBaseURI));
} else {
mViewSourceBaseURI = orig;
}
}
return mViewSourceBaseURI;
}
// Speculative loading
already_AddRefed<nsIURI>