Backed out changeset fba52fc5161a (bug 813906)

This commit is contained in:
Ed Morley 2013-02-13 12:05:39 +00:00
Родитель 6c297f1ea1
Коммит fad95d0ac0
4 изменённых файлов: 0 добавлений и 85 удалений

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

@ -65,7 +65,6 @@ MOCHITEST_FILES = \
file_bug771202.html \
test_bug777098.html \
test_bug751809.html \
test_bug813906.html \
test_enumerate.html \
test_npruntime_construct.html \
307-xo-redirect.sjs \

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

@ -1,47 +0,0 @@
<!doctype html>
<html>
<head>
<title>Test for Bug 813906</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<base href="chrome://browser/content/">
</head>
<body>
<script type="application/javascript">
function f() {
document.getElementsByTagName("base")[0].href = "http://www.safe.com/";
}
</script>
<svg>
<symbol id="a">
<foreignObject>
<object bugmode="813906" frame="frame1"></object>
</foreignObject>
</symbol>
<use />
</svg>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
var frameLoadCount = 0;
function frameLoaded() {
frameLoadCount++;
if (frameLoadCount == 1) {
document.getElementsByTagName("object")[0].type = "application/x-test";
document.getElementsByTagName("use")[0].setAttributeNS("http://www.w3.org/1999/xlink", "href", location.href + "#a");
} else if (frameLoadCount == 2) {
isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'),
0, 'plugin shouldnt be able to cause navigation to chrome URLs');
SimpleTest.finish();
}
}
</script>
<iframe name="frame1" onload="frameLoaded()"></iframe>
</body>
</html>

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

@ -583,34 +583,6 @@ drawAsyncBitmapColor(InstanceData* instanceData)
instanceData->backBuffer = oldFront;
}
static bool bug813906(NPP npp, const char* const function, const char* const url, const char* const frame)
{
InstanceData* id = static_cast<InstanceData*>(npp->pdata);
NPObject *windowObj = nullptr;
NPError err = NPN_GetValue(npp, NPNVWindowNPObject, &windowObj);
if (err != NPERR_NO_ERROR) {
return false;
}
NPVariant result;
bool res = NPN_Invoke(npp, windowObj, NPN_GetStringIdentifier(function), nullptr, 0, &result);
NPN_ReleaseObject(windowObj);
if (!res) {
return false;
}
NPN_ReleaseVariantValue(&result);
err = NPN_GetURL(npp, url, frame);
if (err != NPERR_NO_ERROR) {
err = NPN_GetURL(npp, "about:blank", frame);
return false;
}
return true;
}
//
// function signatures
//
@ -822,7 +794,6 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char*
instanceData->frontBuffer = NULL;
instanceData->backBuffer = NULL;
instanceData->mouseUpEventCount = 0;
instanceData->bugMode = -1;
instance->pdata = instanceData;
TestNPObject* scriptableObject = (TestNPObject*)NPN_CreateObject(instance, &sNPClass);
@ -953,9 +924,6 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char*
if (!strcmp(argn[i], "closestream")) {
instanceData->closeStream = true;
}
if (strcmp(argn[i], "bugmode") == 0) {
instanceData->bugMode = atoi(argv[i]);
}
}
if (!browserSupportsWindowless || !pluginSupportsWindowlessMode()) {
@ -1048,10 +1016,6 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char*
}
}
if ((instanceData->bugMode == 813906) && instanceData->frame.length()) {
bug813906(instance, "f", "browser.xul", instanceData->frame.c_str());
}
return NPERR_NO_ERROR;
}

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

@ -151,7 +151,6 @@ typedef struct InstanceData {
NPAsyncSurface *frontBuffer;
NPAsyncSurface *backBuffer;
int32_t mouseUpEventCount;
int32_t bugMode;
} InstanceData;
void notifyDidPaint(InstanceData* instanceData);