1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Follow-up of pr #12344

This commit is contained in:
Calixte Denizet 2020-09-09 11:46:02 +02:00
parent e51e9d1f33
commit 64a6efd95e
9 changed files with 69 additions and 56 deletions

View file

@ -329,6 +329,18 @@ class SimpleDOMNode {
return this.childNodes && this.childNodes.length > 0;
}
/**
* Search a node in the tree with the given path
* foo.bar[nnn], i.e. find the nnn-th node named
* bar under a node named foo.
*
* @param {Array} paths - an array of objects as
* returned by {parseXFAPath}.
* @param {number} pos - the current position in
* the paths array.
* @returns {SimpleDOMNode} The node corresponding
* to the path or null if not found.
*/
searchNode(paths, pos) {
if (pos >= paths.length) {
return this;