mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Merge remote-tracking branch 'origin/master' into custom
This commit is contained in:
commit
a85a33f6de
10 changed files with 7221 additions and 5216 deletions
|
|
@ -1341,7 +1341,7 @@ this.PlacesUtils = {
|
|||
* The container node to search through.
|
||||
* @returns true if the node contains uri nodes, false otherwise.
|
||||
*/
|
||||
hasChildURIs: function PU_hasChildURIs(aNode) {
|
||||
hasChildURIs: function PU_hasChildURIs(aNode, aMultiple=false) {
|
||||
if (!this.nodeIsContainer(aNode))
|
||||
return false;
|
||||
|
||||
|
|
@ -1357,11 +1357,14 @@ this.PlacesUtils = {
|
|||
root.containerOpen = true;
|
||||
}
|
||||
|
||||
let foundFirst = !aMultiple;
|
||||
let found = false;
|
||||
for (let i = 0; i < root.childCount && !found; i++) {
|
||||
let child = root.getChild(i);
|
||||
if (this.nodeIsURI(child))
|
||||
found = true;
|
||||
if (this.nodeIsURI(child)) {
|
||||
found = foundFirst;
|
||||
foundFirst = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasOpen) {
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ function check_uri_nodes(aQuery, aOptions, aExpectedURINodes) {
|
|||
root.containerOpen = true;
|
||||
var node = root.getChild(0);
|
||||
do_check_eq(PU.hasChildURIs(node), aExpectedURINodes > 0);
|
||||
do_check_eq(PU.hasChildURIs(node, true), aExpectedURINodes > 1);
|
||||
do_check_eq(PU.getURLsForContainerNode(node).length, aExpectedURINodes);
|
||||
root.containerOpen = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue