Skip to content

Commit

Permalink
Fix range formatting issues
Browse files Browse the repository at this point in the history
Signed-off-by: David Kwon <[email protected]>
  • Loading branch information
dkwon17 authored and fbricon committed Jun 11, 2019
1 parent 867aae2 commit b46bdad
Show file tree
Hide file tree
Showing 3 changed files with 746 additions and 262 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,17 @@ public boolean isDTDNotationDecl() {
return getNodeType() == DOMNode.DTD_NOTATION_DECL;
}

public boolean isOwnerDocument() {
return getNodeType() == Node.DOCUMENT_NODE;
}

public boolean isChildOfOwnerDocument() {
if (parent == null) {
return false;
}
return parent.getNodeType() == Node.DOCUMENT_NODE;
}

public int getStart() {
return start;
}
Expand Down Expand Up @@ -651,6 +662,14 @@ public DOMNode getPreviousSibling() {
return previousIndex >= 0 ? children.get(previousIndex) : null;
}

public DOMNode getPreviousNonTextSibling() {
DOMNode prev = getPreviousSibling();
while (prev != null && prev.isText()) {
prev = prev.getPreviousSibling();
}
return prev;
}

/*
* (non-Javadoc)
*
Expand Down
Loading

0 comments on commit b46bdad

Please sign in to comment.