mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1152479 - Assert IsCallerChrome() in some layout-related nsIDOMWindowUtils APIs. r=ehsan
--HG-- extra : rebase_source : 137e10ca1f6c01825cd352c1bd2bcff9c9bf9d1e extra : source : 33e3ce1ae558eba912aad4487ff40d691ca4368e
This commit is contained in:
parent
80b5170af7
commit
3cb90b0f6f
@ -290,9 +290,7 @@ nsDOMWindowUtils::UpdateLayerTree()
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDOMWindowUtils::SetCSSViewport(float aWidthPx, float aHeightPx)
|
nsDOMWindowUtils::SetCSSViewport(float aWidthPx, float aHeightPx)
|
||||||
{
|
{
|
||||||
if (!nsContentUtils::IsCallerChrome()) {
|
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
||||||
return NS_ERROR_DOM_SECURITY_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(aWidthPx >= 0.0 && aHeightPx >= 0.0)) {
|
if (!(aWidthPx >= 0.0 && aHeightPx >= 0.0)) {
|
||||||
return NS_ERROR_ILLEGAL_VALUE;
|
return NS_ERROR_ILLEGAL_VALUE;
|
||||||
@ -416,9 +414,7 @@ nsDOMWindowUtils::SetDisplayPortMarginsForElement(float aLeftMargin,
|
|||||||
nsIDOMElement* aElement,
|
nsIDOMElement* aElement,
|
||||||
uint32_t aPriority)
|
uint32_t aPriority)
|
||||||
{
|
{
|
||||||
if (!nsContentUtils::IsCallerChrome()) {
|
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
||||||
return NS_ERROR_DOM_SECURITY_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIPresShell* presShell = GetPresShell();
|
nsIPresShell* presShell = GetPresShell();
|
||||||
if (!presShell) {
|
if (!presShell) {
|
||||||
@ -510,9 +506,7 @@ nsDOMWindowUtils::SetResolution(float aResolution)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDOMWindowUtils::SetResolutionAndScaleTo(float aResolution)
|
nsDOMWindowUtils::SetResolutionAndScaleTo(float aResolution)
|
||||||
{
|
{
|
||||||
if (!nsContentUtils::IsCallerChrome()) {
|
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
||||||
return NS_ERROR_DOM_SECURITY_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIPresShell* presShell = GetPresShell();
|
nsIPresShell* presShell = GetPresShell();
|
||||||
if (!presShell) {
|
if (!presShell) {
|
||||||
@ -587,9 +581,7 @@ nsDOMWindowUtils::GetIsFirstPaint(bool *aIsFirstPaint)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDOMWindowUtils::GetPresShellId(uint32_t *aPresShellId)
|
nsDOMWindowUtils::GetPresShellId(uint32_t *aPresShellId)
|
||||||
{
|
{
|
||||||
if (!nsContentUtils::IsCallerChrome()) {
|
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
||||||
return NS_ERROR_DOM_SECURITY_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIPresShell* presShell = GetPresShell();
|
nsIPresShell* presShell = GetPresShell();
|
||||||
if (presShell) {
|
if (presShell) {
|
||||||
@ -3266,9 +3258,7 @@ nsDOMWindowUtils::GetPlugins(JSContext* cx, JS::MutableHandle<JS::Value> aPlugin
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDOMWindowUtils::SetScrollPositionClampingScrollPortSize(float aWidth, float aHeight)
|
nsDOMWindowUtils::SetScrollPositionClampingScrollPortSize(float aWidth, float aHeight)
|
||||||
{
|
{
|
||||||
if (!nsContentUtils::IsCallerChrome()) {
|
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
||||||
return NS_ERROR_DOM_SECURITY_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(aWidth >= 0.0 && aHeight >= 0.0)) {
|
if (!(aWidth >= 0.0 && aHeight >= 0.0)) {
|
||||||
return NS_ERROR_ILLEGAL_VALUE;
|
return NS_ERROR_ILLEGAL_VALUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user