|
66 | 66 | public class Node extends EventTarget { |
67 | 67 |
|
68 | 68 | /** |
| 69 | + * The node is an element. |
| 70 | + * |
69 | 71 | * @see org.w3c.dom.Node#ELEMENT_NODE |
70 | 72 | */ |
71 | 73 | @JsxConstant |
72 | 74 | public static final int ELEMENT_NODE = org.w3c.dom.Node.ELEMENT_NODE; |
73 | 75 |
|
74 | 76 | /** |
| 77 | + * The node is an attribute. |
| 78 | + * |
75 | 79 | * @see org.w3c.dom.Node#ATTRIBUTE_NODE |
76 | 80 | */ |
77 | 81 | @JsxConstant |
78 | 82 | public static final int ATTRIBUTE_NODE = org.w3c.dom.Node.ATTRIBUTE_NODE; |
79 | 83 |
|
80 | 84 | /** |
| 85 | + * The node is a text node. |
| 86 | + * |
81 | 87 | * @see org.w3c.dom.Node#TEXT_NODE |
82 | 88 | */ |
83 | 89 | @JsxConstant |
84 | 90 | public static final int TEXT_NODE = org.w3c.dom.Node.TEXT_NODE; |
85 | 91 |
|
86 | 92 | /** |
| 93 | + * The node is a CDATA section. |
| 94 | + * |
87 | 95 | * @see org.w3c.dom.Node#CDATA_SECTION_NODE |
88 | 96 | */ |
89 | 97 | @JsxConstant |
90 | 98 | public static final int CDATA_SECTION_NODE = org.w3c.dom.Node.CDATA_SECTION_NODE; |
91 | 99 |
|
92 | 100 | /** |
| 101 | + * The node is an entity reference. |
| 102 | + * |
93 | 103 | * @see org.w3c.dom.Node#ENTITY_REFERENCE_NODE |
94 | 104 | */ |
95 | 105 | @JsxConstant |
96 | 106 | public static final int ENTITY_REFERENCE_NODE = org.w3c.dom.Node.ENTITY_REFERENCE_NODE; |
97 | 107 |
|
98 | 108 | /** |
| 109 | + * The node is an entity. |
| 110 | + * |
99 | 111 | * @see org.w3c.dom.Node#ENTITY_NODE |
100 | 112 | */ |
101 | 113 | @JsxConstant |
102 | 114 | public static final int ENTITY_NODE = org.w3c.dom.Node.ENTITY_NODE; |
103 | 115 |
|
104 | 116 | /** |
| 117 | + * The node is a processing instruction. |
| 118 | + * |
105 | 119 | * @see org.w3c.dom.Node#PROCESSING_INSTRUCTION_NODE |
106 | 120 | */ |
107 | 121 | @JsxConstant |
108 | 122 | public static final int PROCESSING_INSTRUCTION_NODE = org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE; |
109 | 123 |
|
110 | 124 | /** |
| 125 | + * The node is a comment. |
| 126 | + * |
111 | 127 | * @see org.w3c.dom.Node#COMMENT_NODE |
112 | 128 | */ |
113 | 129 | @JsxConstant |
114 | 130 | public static final int COMMENT_NODE = org.w3c.dom.Node.COMMENT_NODE; |
115 | 131 |
|
116 | 132 | /** |
| 133 | + * The node is a document. |
| 134 | + * |
117 | 135 | * @see org.w3c.dom.Node#DOCUMENT_NODE |
118 | 136 | */ |
119 | 137 | @JsxConstant |
120 | 138 | public static final int DOCUMENT_NODE = org.w3c.dom.Node.DOCUMENT_NODE; |
121 | 139 |
|
122 | 140 | /** |
| 141 | + * The node is a document type. |
| 142 | + * |
123 | 143 | * @see org.w3c.dom.Node#DOCUMENT_TYPE_NODE |
124 | 144 | */ |
125 | 145 | @JsxConstant |
126 | 146 | public static final int DOCUMENT_TYPE_NODE = org.w3c.dom.Node.DOCUMENT_TYPE_NODE; |
127 | 147 |
|
128 | 148 | /** |
| 149 | + * The node is a document fragment. |
| 150 | + * |
129 | 151 | * @see org.w3c.dom.Node#DOCUMENT_FRAGMENT_NODE |
130 | 152 | */ |
131 | 153 | @JsxConstant |
132 | 154 | public static final int DOCUMENT_FRAGMENT_NODE = org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE; |
133 | 155 |
|
134 | 156 | /** |
| 157 | + * The node is a notation. |
| 158 | + * |
135 | 159 | * @see org.w3c.dom.Node#NOTATION_NODE |
136 | 160 | */ |
137 | 161 | @JsxConstant |
138 | 162 | public static final int NOTATION_NODE = org.w3c.dom.Node.NOTATION_NODE; |
139 | 163 |
|
140 | 164 | /** |
| 165 | + * The nodes are disconnected. |
| 166 | + * |
141 | 167 | * @see org.w3c.dom.Node#DOCUMENT_POSITION_DISCONNECTED |
142 | 168 | */ |
143 | 169 | @JsxConstant |
144 | 170 | public static final int DOCUMENT_POSITION_DISCONNECTED = org.w3c.dom.Node.DOCUMENT_POSITION_DISCONNECTED; |
145 | 171 |
|
146 | 172 | /** |
| 173 | + * The reference node precedes the other node. |
| 174 | + * |
147 | 175 | * @see org.w3c.dom.Node#DOCUMENT_POSITION_PRECEDING |
148 | 176 | */ |
149 | 177 | @JsxConstant |
150 | 178 | public static final int DOCUMENT_POSITION_PRECEDING = org.w3c.dom.Node.DOCUMENT_POSITION_PRECEDING; |
151 | 179 |
|
152 | 180 | /** |
| 181 | + * The reference node follows the other node. |
| 182 | + * |
153 | 183 | * @see org.w3c.dom.Node#DOCUMENT_POSITION_FOLLOWING |
154 | 184 | */ |
155 | 185 | @JsxConstant |
156 | 186 | public static final int DOCUMENT_POSITION_FOLLOWING = org.w3c.dom.Node.DOCUMENT_POSITION_FOLLOWING; |
157 | 187 |
|
158 | 188 | /** |
| 189 | + * The reference node contains the other node. |
| 190 | + * |
159 | 191 | * @see org.w3c.dom.Node#DOCUMENT_POSITION_CONTAINS |
160 | 192 | */ |
161 | 193 | @JsxConstant |
162 | 194 | public static final int DOCUMENT_POSITION_CONTAINS = org.w3c.dom.Node.DOCUMENT_POSITION_CONTAINS; |
163 | 195 |
|
164 | 196 | /** |
| 197 | + * The reference node is contained by the other node. |
| 198 | + * |
165 | 199 | * @see org.w3c.dom.Node#DOCUMENT_POSITION_CONTAINED_BY |
166 | 200 | */ |
167 | 201 | @JsxConstant |
168 | 202 | public static final int DOCUMENT_POSITION_CONTAINED_BY = org.w3c.dom.Node.DOCUMENT_POSITION_CONTAINED_BY; |
169 | 203 |
|
170 | 204 | /** |
| 205 | + * The document position is implementation-specific. |
| 206 | + * |
171 | 207 | * @see org.w3c.dom.Node#DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
172 | 208 | */ |
173 | 209 | @JsxConstant |
@@ -523,11 +559,11 @@ public Node cloneNode(final boolean deep) { |
523 | 559 | } |
524 | 560 |
|
525 | 561 | /** |
526 | | - * Check if 2 nodes are equals. |
527 | | - * For detail specifications |
528 | | - * @see <a href="https://dom.spec.whatwg.org/#concept-node-equals">concept-node-equals</a> |
| 562 | + * Determines whether this node is structurally equal to the specified node. |
| 563 | + * |
529 | 564 | * @param other the node to compare with |
530 | | - * @return true or false |
| 565 | + * @return {@code true} if the two nodes are structurally equal |
| 566 | + * @see <a href="https://dom.spec.whatwg.org/#concept-node-equals">WHATWG DOM: concept-node-equals</a> |
531 | 567 | */ |
532 | 568 | @JsxFunction |
533 | 569 | public boolean isEqualNode(final Node other) { |
@@ -642,35 +678,32 @@ else if (this instanceof Text || this instanceof Comment) { |
642 | 678 | } |
643 | 679 |
|
644 | 680 | /** |
645 | | - * This method provides a way to determine whether two Node references returned by |
646 | | - * the implementation reference the same object. |
647 | | - * When two Node references are references to the same object, even if through a proxy, |
648 | | - * the references may be used completely interchangeably, such that all attributes |
649 | | - * have the same values and calling the same DOM method on either reference always has exactly the same effect. |
| 681 | + * Determines whether this node and the specified node are the same object. |
650 | 682 | * |
651 | 683 | * @param other the node to test against |
652 | | - * |
653 | | - * @return whether this node is the same node as the given one |
| 684 | + * @return {@code true} if this node is the same node as the given one |
654 | 685 | */ |
655 | 686 | @JsxFunction |
656 | 687 | public boolean isSameNode(final Object other) { |
657 | 688 | return this == other; |
658 | 689 | } |
659 | 690 |
|
660 | 691 | /** |
661 | | - * Returns whether this node has any children. |
662 | | - * @return boolean true if this node has any children, false otherwise |
| 692 | + * Returns whether this node has any child nodes. |
| 693 | + * |
| 694 | + * @return {@code true} if this node has any child nodes |
663 | 695 | */ |
664 | 696 | @JsxFunction |
665 | 697 | public boolean hasChildNodes() { |
666 | 698 | return getDomNodeOrDie().getChildren().iterator().hasNext(); |
667 | 699 | } |
668 | 700 |
|
669 | 701 | /** |
670 | | - * @param namespace string containing the namespace to look the prefix up |
671 | | - * @return a string containing the prefix for a given namespace URI, |
672 | | - * if present, and null if not. When multiple prefixes are possible, |
673 | | - * the first prefix is returned. |
| 702 | + * Returns the namespace prefix for the specified namespace URI. |
| 703 | + * |
| 704 | + * @param namespace the namespace URI |
| 705 | + * @return the corresponding namespace prefix, or {@code null} if none exists; |
| 706 | + * if multiple prefixes are possible, the first one is returned |
674 | 707 | */ |
675 | 708 | @JsxFunction |
676 | 709 | public String lookupPrefix(final String namespace) { |
@@ -788,8 +821,9 @@ public HtmlUnitScriptable getOwnerDocument() { |
788 | 821 | } |
789 | 822 |
|
790 | 823 | /** |
791 | | - * Returns the owner document. |
792 | | - * @return the document |
| 824 | + * Returns the root node of this node's tree. |
| 825 | + * |
| 826 | + * @return the root node |
793 | 827 | */ |
794 | 828 | @JsxFunction |
795 | 829 | public Node getRootNode() { |
@@ -868,9 +902,10 @@ public NamedNodeMap getAttributes() { |
868 | 902 | } |
869 | 903 |
|
870 | 904 | /** |
871 | | - * Checks whether the given element is contained within this object. |
872 | | - * @param element element object that specifies the element to check |
873 | | - * @return true if the element is contained within this object |
| 905 | + * Returns whether the specified node is contained within this node. |
| 906 | + * |
| 907 | + * @param element the node to check |
| 908 | + * @return {@code true} if the specified node is contained within this node |
874 | 909 | */ |
875 | 910 | @JsxFunction |
876 | 911 | public boolean contains(final Object element) { |
@@ -900,8 +935,9 @@ public String getBaseURI() { |
900 | 935 | } |
901 | 936 |
|
902 | 937 | /** |
903 | | - * Returns true when the current element has any attributes or not. |
904 | | - * @return true if an attribute is specified on this element |
| 938 | + * Returns whether this node has any attributes. |
| 939 | + * |
| 940 | + * @return {@code true} if this node has one or more attributes |
905 | 941 | */ |
906 | 942 | public boolean hasAttributes() { |
907 | 943 | return getDomNodeOrDie().hasAttributes(); |
@@ -1003,9 +1039,10 @@ protected Element getLastElementChild() { |
1003 | 1039 | } |
1004 | 1040 |
|
1005 | 1041 | /** |
1006 | | - * Gets the children of the current node. |
| 1042 | + * Returns the child elements of this node. |
| 1043 | + * |
| 1044 | + * @return a live collection of this node's child elements |
1007 | 1045 | * @see <a href="http://msdn.microsoft.com/en-us/library/ms537446.aspx">MSDN documentation</a> |
1008 | | - * @return the child at the given position |
1009 | 1046 | */ |
1010 | 1047 | protected HTMLCollection getChildren() { |
1011 | 1048 | final DomNode node = getDomNodeOrDie(); |
|
0 commit comments