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
Родитель e45e2f99e5
Коммит caf777f1cb
3 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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);
}