зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1534399 - Don't allow disabling non-author sheets. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D23624 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2d9c404352
Коммит
716d720e13
|
@ -29,3 +29,4 @@ skip-if = ((os == 'win' && bits!=64) || (os=='linux' && bits==32) || os == 'mac'
|
|||
support-files =
|
||||
test_fontVariationsAPI.css
|
||||
[test_fontFaceGeneric.xul]
|
||||
[test_ua_sheet_disable.html]
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test for bug 1534399</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script>
|
||||
function start() {
|
||||
let sheet = InspectorUtils.getAllStyleSheets(document, false)[0];
|
||||
ok(sheet.href.indexOf("test.css") == -1, "Shouldn't have found the author sheet");
|
||||
|
||||
is(sheet.disabled, false, "Sheet should initially be enabled");
|
||||
|
||||
sheet.disabled = true;
|
||||
is(sheet.disabled, false, "Shouldn't be able to disable a UA sheet");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
document.addEventListener('DOMContentLoaded', start)
|
||||
</script>
|
|
@ -241,6 +241,11 @@ void StyleSheet::ApplicableStateChanged(bool aApplicable) {
|
|||
}
|
||||
|
||||
void StyleSheet::SetDisabled(bool aDisabled) {
|
||||
// Only allow disabling author sheets.
|
||||
if (mParsingMode != css::eAuthorSheetFeatures) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aDisabled == Disabled()) {
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче