Bug 1194856 - Load noscript.css and noframes.css from data: URLs in release builds. r=dbaron

This commit is contained in:
Cameron McCormack 2015-09-10 13:24:12 +10:00
parent 670d9501e5
commit a0ae7c0304
3 changed files with 21 additions and 2 deletions

View File

@ -4,6 +4,9 @@
/* This sheet is added to the style set for documents with frames disabled */
/* Until bug 1194856 is fixed, if you update this file you should also update
the data: URL in nsLayoutStylesheetCache::NoFramesSheet(). */
noframes {
display: block;
}

View File

@ -4,6 +4,9 @@
/* This sheet is added to the style set for documents with script disabled */
/* Until bug 1194856 is fixed, if you update this file you should also update
the data: URL in nsLayoutStylesheetCache::NoScriptSheet(). */
noscript {
display: none !important;
}

View File

@ -198,7 +198,13 @@ nsLayoutStylesheetCache::NoScriptSheet()
EnsureGlobal();
if (!gStyleCache->mNoScriptSheet) {
LoadSheetURL("resource://gre-resources/noscript.css",
// If you update the data: URL, also update noscript.css (See bug 1194856.)
LoadSheetURL(
#ifdef RELEASE_BUILD
"data:text/css,noscript { display%3A none !important%3B }",
#else
"resource://gre-resources/noscript.css",
#endif
gStyleCache->mNoScriptSheet, true);
}
@ -211,7 +217,14 @@ nsLayoutStylesheetCache::NoFramesSheet()
EnsureGlobal();
if (!gStyleCache->mNoFramesSheet) {
LoadSheetURL("resource://gre-resources/noframes.css",
// If you update the data: URL, also update noframes.css (See bug 1194856.)
LoadSheetURL(
#ifdef RELEASE_BUILD
"data:text/css,noframes { display%3A block%3B } "
"frame%2C frameset%2C iframe { display%3A none !important%3B }",
#else
"resource://gre-resources/noframes.css",
#endif
gStyleCache->mNoFramesSheet, true);
}