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:
parent
e51e9d1f33
commit
64a6efd95e
9 changed files with 69 additions and 56 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue