mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Back out Surya Ismail's patch from bug 378518 as the possible cause of numerous test failures.
This commit is contained in:
parent
a0f5ad4bb4
commit
12f3f485f0
@ -81,7 +81,6 @@
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsIConsoleService.h"
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsXULPrototypeCache.h"
|
||||
@ -148,60 +147,6 @@ IsAncestorBinding(nsIDocument* aDocument,
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool CheckTagNameWhiteList(PRInt32 aNameSpaceID, nsIAtom *aTagName)
|
||||
{
|
||||
static nsIContent::AttrValuesArray kValidXULTagNames[] = {
|
||||
&nsGkAtoms::box, &nsGkAtoms::browser, &nsGkAtoms::button,
|
||||
&nsGkAtoms::hbox, &nsGkAtoms::image, &nsGkAtoms::menu,
|
||||
&nsGkAtoms::menubar, &nsGkAtoms::menuitem, &nsGkAtoms::menupopup,
|
||||
&nsGkAtoms::row, &nsGkAtoms::spacer, &nsGkAtoms::splitter,
|
||||
&nsGkAtoms::text, &nsGkAtoms::tree, nsnull};
|
||||
|
||||
PRUint32 i;
|
||||
if (aNameSpaceID == kNameSpaceID_XUL) {
|
||||
for (i = 0; kValidXULTagNames[i]; ++i) {
|
||||
if (aTagName == *(kValidXULTagNames[i])) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (aNameSpaceID == kNameSpaceID_SVG) {
|
||||
if (aTagName == nsGkAtoms::g) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
/* static */ nsresult
|
||||
PrintErrorToConsole(const nsAString& errText, nsIURI* aURI,
|
||||
const nsAFlatString& aSourceLine, PRUint32 aLineNumber,
|
||||
PRUint32 aColumnNumber, PRUint32 aErrorFlags,
|
||||
const char *aCategory)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIConsoleService> consoleService
|
||||
(do_GetService(NS_CONSOLESERVICE_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCAutoString spec;
|
||||
if (aURI)
|
||||
aURI->GetSpec(spec);
|
||||
|
||||
nsCOMPtr<nsIScriptError> errorObject =
|
||||
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = errorObject->Init(errText.Data(),
|
||||
NS_ConvertUTF8toUTF16(spec).get(), // file name
|
||||
aSourceLine.get(),
|
||||
aLineNumber, aColumnNumber,
|
||||
aErrorFlags, aCategory);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return consoleService->LogMessage(errorObject);
|
||||
}
|
||||
|
||||
// Individual binding requests.
|
||||
class nsXBLBindingRequest
|
||||
{
|
||||
@ -920,18 +865,6 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
|
||||
nsContentUtils::NameSpaceManager()->GetNameSpaceID(nameSpace);
|
||||
|
||||
nsCOMPtr<nsIAtom> tagName = do_GetAtom(display);
|
||||
// Check the white list
|
||||
if (!CheckTagNameWhiteList(nameSpaceID, tagName)) {
|
||||
nsAutoString errText = NS_LITERAL_STRING("Extending ") + value +
|
||||
NS_LITERAL_STRING(
|
||||
" is invalid. In general, do not extend tag names.");
|
||||
|
||||
PrintErrorToConsole(errText, boundDocument->GetDocumentURI(),
|
||||
EmptyString(), 0, 0,
|
||||
nsIScriptError::errorFlag, "XBL");
|
||||
NS_ERROR("Invalid extends value");
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
protoBinding->SetBaseTag(nameSpaceID, tagName);
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ _TEST_FILES = \
|
||||
test_bug366770.html \
|
||||
test_bug371724.xhtml \
|
||||
test_bug372769.xhtml \
|
||||
test_bug378518.xul \
|
||||
test_bug378866.xhtml \
|
||||
test_bug397934.xhtml \
|
||||
test_bug389322.xhtml \
|
||||
|
@ -1,83 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=378518
|
||||
-->
|
||||
<window title="Mozilla Bug 378518"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript" src="/MochiKit/packed.js" />
|
||||
<script type="application/javascript"
|
||||
src="/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="mybinding" extends="xul:checkbox">
|
||||
<content>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
||||
<!-- test resuls are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=378518"
|
||||
target="_blank">Mozilla Bug 378518</a>
|
||||
</body>
|
||||
|
||||
<!-- The elements we're testing with -->
|
||||
<command id="myBoxCommand" oncommand="myBoxClicked = true;"/>
|
||||
<command id="myCheckBoxCommand" oncommand="myCheckBoxClicked = true;"/>
|
||||
<command id="myExtendedBoxCommand" oncommand="myExtendedBoxClicked = true;"/>
|
||||
|
||||
<box id="myBox" command="myBoxCommand">
|
||||
<label>myBox</label>
|
||||
</box>
|
||||
|
||||
<checkbox id="myCheckBox" command="myCheckBoxCommand" label="myCheckBox"/>
|
||||
|
||||
<box id="myExtendedBox" command="myExtendedBoxCommand"
|
||||
style="-moz-binding:url(#mybinding)">
|
||||
<label>myExtendedBox</label>
|
||||
</box>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript"> <![CDATA[
|
||||
|
||||
var myBoxClicked = false;
|
||||
var myCheckBoxClicked = false;
|
||||
var myExtendedBoxClicked = false;
|
||||
|
||||
function testClick(elemName) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var wu =
|
||||
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIDOMWindowUtils);
|
||||
|
||||
var a = document.getElementById(elemName).getBoundingClientRect();
|
||||
wu.sendMouseEvent('mousedown', a.left + 1, a.top + 1, 0, 1, 0);
|
||||
wu.sendMouseEvent('mouseup', a.left + 1, a.top + 1, 0, 1, 0);
|
||||
}
|
||||
|
||||
function doTest() {
|
||||
testClick('myBox');
|
||||
testClick('myCheckBox');
|
||||
testClick('myExtendedBox');
|
||||
ok(!myBoxClicked, "Shouldn't fire");
|
||||
ok(myCheckBoxClicked, "Should fire");
|
||||
ok(!myExtendedBoxClicked, "Shouldn't fire");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
/** Test for Bug 378518 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
setTimeout(doTest, 300);
|
||||
});
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
Loading…
Reference in New Issue
Block a user