Bug 1216260 - Replace mozMatchesSelector with matches in add-on SDK. r=matteo

This commit is contained in:
Mike Taylor 2015-10-28 07:43:00 +01:00
parent 902b163621
commit 6898bfcc30
3 changed files with 19 additions and 19 deletions

View File

@ -183,7 +183,7 @@ CONTEXTS.SelectorContext = Class({
let selector = this.selector;
while (!(popupNode instanceof Ci.nsIDOMDocument)) {
if (popupNode.mozMatchesSelector(selector))
if (popupNode.matches(selector))
return popupNode;
popupNode = popupNode.parentNode;

View File

@ -294,21 +294,21 @@ exports.testStringOverload = createProxyTest(html, function (helper, assert) {
);
});
exports["test MozMatchedSelector"] = createProxyTest("", function (helper) {
exports["test Element.matches()"] = createProxyTest("", function (helper) {
helper.createWorker(
'new ' + function ContentScriptScope() {
// Check mozMatchesSelector XrayWrappers bug:
// mozMatchesSelector returns bad results when we are not calling it from the node itself
// SEE BUG 658909: mozMatchesSelector returns incorrect results with XrayWrappers
assert(document.createElement( "div" ).mozMatchesSelector("div"),
"mozMatchesSelector works while being called from the node");
assert(document.documentElement.mozMatchesSelector.call(
// Check matches XrayWrappers bug (Bug 658909):
// Test that Element.matches() does not return bad results when we are
// not calling it from the node itself.
assert(document.createElement( "div" ).matches("div"),
"matches works while being called from the node");
assert(document.documentElement.matches.call(
document.createElement( "div" ),
"div"
),
"mozMatchesSelector works while being called from a " +
"matches works while being called from a " +
"function reference to " +
"document.documentElement.mozMatchesSelector.call");
"document.documentElement.matches.call");
done();
}
);

View File

@ -294,21 +294,21 @@ exports.testStringOverload = createProxyTest(html, function (helper, assert) {
);
});
exports["test MozMatchedSelector"] = createProxyTest("", function (helper) {
exports["test Element.matches()"] = createProxyTest("", function (helper) {
helper.createWorker(
'new ' + function ContentScriptScope() {
// Check mozMatchesSelector XrayWrappers bug:
// mozMatchesSelector returns bad results when we are not calling it from the node itself
// SEE BUG 658909: mozMatchesSelector returns incorrect results with XrayWrappers
assert(document.createElement( "div" ).mozMatchesSelector("div"),
"mozMatchesSelector works while being called from the node");
assert(document.documentElement.mozMatchesSelector.call(
// Check matches XrayWrappers bug (Bug 658909):
// Test that Element.matches() does not return bad results when we are
// not calling it from the node itself.
assert(document.createElement( "div" ).matches("div"),
"matches works while being called from the node");
assert(document.documentElement.matches.call(
document.createElement( "div" ),
"div"
),
"mozMatchesSelector works while being called from a " +
"matches works while being called from a " +
"function reference to " +
"document.documentElement.mozMatchesSelector.call");
"document.documentElement.matches.call");
done();
}
);