Bug 655877 - Part 29: Don't underline links within SVG text by default. r=dbaron

This commit is contained in:
Cameron McCormack 2012-08-05 11:01:19 +10:00
parent 8b50ca5867
commit 4a39934652

View File

@ -1195,6 +1195,13 @@ PresShell::CreatePreferenceStyleSheet()
mPrefStyleSheet->SetURIs(uri, uri, uri);
mPrefStyleSheet->SetComplete();
PRUint32 index;
rv =
mPrefStyleSheet->InsertRuleInternal(NS_LITERAL_STRING("@namespace svg url(http://www.w3.org/2000/svg);"),
0, &index);
if (NS_FAILED(rv)) {
mPrefStyleSheet = nullptr;
return rv;
}
rv =
mPrefStyleSheet->InsertRuleInternal(NS_LITERAL_STRING("@namespace url(http://www.w3.org/1999/xhtml);"),
0, &index);
@ -1207,10 +1214,10 @@ PresShell::CreatePreferenceStyleSheet()
return NS_OK;
}
// XXX We want these after the @namespace rule. Does order matter
// XXX We want these after the @namespace rules. Does order matter
// for these rules, or can we call StyleRule::StyleRuleCount()
// and just "append"?
static PRUint32 sInsertPrefSheetRulesAt = 1;
static PRUint32 sInsertPrefSheetRulesAt = 2;
nsresult
PresShell::SetPrefNoScriptRule()
@ -1345,7 +1352,7 @@ nsresult PresShell::SetPrefLinkRules(void)
// NOTE: these must go in the agent stylesheet or they cannot be
// overridden by authors
rv = mPrefStyleSheet->
InsertRuleInternal(NS_LITERAL_STRING("*|*:-moz-any-link{text-decoration:underline}"),
InsertRuleInternal(NS_LITERAL_STRING("*|*:-moz-any-link:not(svg|a){text-decoration:underline}"),
sInsertPrefSheetRulesAt, &index);
} else {
rv = mPrefStyleSheet->