mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Merged backout
This commit is contained in:
commit
91e40e05b5
@ -80,13 +80,6 @@ var focusableElements = [
|
||||
"<iframe src=\"about:blank\" tabindex=\"1\"></iframe>",
|
||||
"<iframe src=\"about:blank\" contenteditable=\"true\"></iframe>",
|
||||
|
||||
"<iframe></iframe>",
|
||||
"<iframe tabindex=\"-1\"></iframe>",
|
||||
"<iframe tabindex=\"0\"></iframe>",
|
||||
"<iframe tabindex=\"0\" disabled></iframe>",
|
||||
"<iframe tabindex=\"1\"></iframe>",
|
||||
"<iframe disabled></iframe>",
|
||||
|
||||
"<img tabindex=\"-1\">",
|
||||
"<img tabindex=\"0\">",
|
||||
"<img tabindex=\"0\" disabled>",
|
||||
@ -186,6 +179,13 @@ var nonFocusableElements = [
|
||||
"<div tabindex=\"0\" disabled></div>",
|
||||
"<div disabled></div>",
|
||||
|
||||
"<iframe></iframe>",
|
||||
"<iframe tabindex=\"-1\"></iframe>",
|
||||
"<iframe tabindex=\"0\"></iframe>",
|
||||
"<iframe tabindex=\"0\" disabled></iframe>",
|
||||
"<iframe tabindex=\"1\"></iframe>",
|
||||
"<iframe disabled></iframe>",
|
||||
|
||||
"<img>",
|
||||
"<img disabled>",
|
||||
"<img contenteditable=\"true\">",
|
||||
@ -280,19 +280,12 @@ var focusableInContentEditable = [
|
||||
"<embed contenteditable=\"true\">",
|
||||
|
||||
"<iframe src=\"about:blank\"></iframe>",
|
||||
"<iframe></iframe>",
|
||||
"<iframe src=\"about:blank\" disabled></iframe>",
|
||||
"<iframe disabled></iframe>",
|
||||
"<iframe src=\"about:blank\" tabindex=\"-1\"></iframe>",
|
||||
"<iframe tabindex=\"-1\"></iframe>",
|
||||
"<iframe src=\"about:blank\" tabindex=\"0\"></iframe>",
|
||||
"<iframe tabindex=\"0\"></iframe>",
|
||||
"<iframe src=\"about:blank\" tabindex=\"0\" disabled></iframe>",
|
||||
"<iframe tabindex=\"0\" disabled></iframe>",
|
||||
"<iframe src=\"about:blank\" tabindex=\"1\"></iframe>",
|
||||
"<iframe tabindex=\"1\"></iframe>",
|
||||
"<iframe src=\"about:blank\" contenteditable=\"true\"></iframe>",
|
||||
"<iframe contenteditable=\"true\"></iframe>",
|
||||
|
||||
"<img tabindex=\"-1\">",
|
||||
"<img tabindex=\"0\">",
|
||||
|
@ -390,8 +390,6 @@ WrapObject(JSContext *cx, JSObject *parent, jsval *vp, XPCWrappedNative* wn)
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
CheckWindow(wn);
|
||||
|
||||
XPCJSRuntime *rt = nsXPConnect::GetRuntimeInstance();
|
||||
|
||||
// The parent must be the inner global object for its scope.
|
||||
|
@ -1255,8 +1255,6 @@ JSObject *
|
||||
XPCNativeWrapper::GetNewOrUsed(JSContext *cx, XPCWrappedNative *wrapper,
|
||||
JSObject *scope, nsIPrincipal *aObjectPrincipal)
|
||||
{
|
||||
CheckWindow(wrapper);
|
||||
|
||||
if (aObjectPrincipal) {
|
||||
nsIScriptSecurityManager *ssm = GetSecurityManager();
|
||||
|
||||
|
@ -311,12 +311,6 @@ WrapObject(JSContext *cx, JSObject *scope, jsval v, jsval *vp)
|
||||
return ThrowException(NS_ERROR_FAILURE, cx);
|
||||
}
|
||||
|
||||
XPCWrappedNative *wn =
|
||||
XPCWrappedNative::GetWrappedNativeOfJSObject(cx, objToWrap);
|
||||
if (wn) {
|
||||
CheckWindow(wn);
|
||||
}
|
||||
|
||||
JSObject *wrapperObj =
|
||||
JS_NewObjectWithGivenProto(cx, &SJOWClass.base, nsnull, scope);
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
|
||||
#include "XPCWrapper.h"
|
||||
#include "XPCNativeWrapper.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
||||
namespace XPCWrapper {
|
||||
|
||||
@ -165,35 +164,6 @@ static JSClass IteratorClass = {
|
||||
JSCLASS_NO_OPTIONAL_MEMBERS
|
||||
};
|
||||
|
||||
void
|
||||
CheckWindow(XPCWrappedNative *wn)
|
||||
{
|
||||
JSClass *clasp = wn->GetFlatJSObject()->getClass();
|
||||
|
||||
// Censor objects that can't be windows.
|
||||
switch (clasp->name[0]) {
|
||||
case 'C': // ChromeWindow?
|
||||
if (clasp->name[1] != 'h') {
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'M': // ModalContentWindow
|
||||
break;
|
||||
case 'W': // Window
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> pwin(do_QueryWrappedNative(wn));
|
||||
if (!pwin || pwin->IsInnerWindow()) {
|
||||
return;
|
||||
}
|
||||
|
||||
pwin->EnsureInnerWindow();
|
||||
}
|
||||
|
||||
JSBool
|
||||
RewrapObject(JSContext *cx, JSObject *scope, JSObject *obj, WrapperType hint,
|
||||
jsval *vp)
|
||||
|
@ -417,13 +417,6 @@ WrapFunction(JSContext *cx, JSObject *wrapperObj, JSObject *funobj, jsval *v,
|
||||
: XPCCrossOriginWrapper::WrapFunction(cx, wrapperObj, funobj, v);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a JSObject that might represent a Window object, ensures that the
|
||||
* window object has an inner window.
|
||||
*/
|
||||
void
|
||||
CheckWindow(XPCWrappedNative *wn);
|
||||
|
||||
/**
|
||||
* Given a potentially-wrapped object, creates a wrapper for it.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user