Bug 732209 way delayed followup. Make the comments a bit clearer. DONTBUILD

This commit is contained in:
Boris Zbarsky 2015-10-08 15:49:16 -04:00
Родитель 2c8727a14d
Коммит 6fa11811c1
1 изменённых файлов: 11 добавлений и 5 удалений

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

@ -1791,11 +1791,17 @@ CSSStyleSheet::SubjectSubsumesInnerPrincipal()
return NS_ERROR_DOM_SECURITY_ERR;
}
// Now make sure we set the principal of our inner to the
// subjectPrincipal. That means we need a unique inner, of
// course. But we don't want to do that if we're not complete
// yet. Luckily, all the callers of this method throw anyway if
// not complete, so we can just do that here too.
// Now make sure we set the principal of our inner to the subjectPrincipal.
// We do this because we're in a situation where the caller would not normally
// be able to access the sheet, but the sheet has opted in to being read.
// Unfortunately, that means it's also opted in to being _edited_, and if the
// caller now makes edits to the sheet we want the resulting resource loads,
// if any, to look as if they are coming from the caller's principal, not the
// original sheet principal.
//
// That means we need a unique inner, of course. But we don't want to do that
// if we're not complete yet. Luckily, all the callers of this method throw
// anyway if not complete, so we can just do that here too.
if (!mInner->mComplete) {
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
}