@@ -32,17 +32,19 @@ module HTML {
3232 /**
3333 * Holds if this is a toplevel element, that is, if it does not have a parent element.
3434 */
35- predicate isTopLevel ( ) { not exists ( getParent ( ) ) }
35+ predicate isTopLevel ( ) { not exists ( this . getParent ( ) ) }
3636
3737 /**
3838 * Gets the root HTML document element in which this element is contained.
3939 */
40- DocumentElement getDocument ( ) { result = getRoot ( ) }
40+ DocumentElement getDocument ( ) { result = this . getRoot ( ) }
4141
4242 /**
4343 * Gets the root element in which this element is contained.
4444 */
45- Element getRoot ( ) { if isTopLevel ( ) then result = this else result = getParent ( ) .getRoot ( ) }
45+ Element getRoot ( ) {
46+ if this .isTopLevel ( ) then result = this else result = this .getParent ( ) .getRoot ( )
47+ }
4648
4749 /**
4850 * Gets the `i`th child element (0-based) of this element.
@@ -52,7 +54,7 @@ module HTML {
5254 /**
5355 * Gets a child element of this element.
5456 */
55- Element getChild ( ) { result = getChild ( _) }
57+ Element getChild ( ) { result = this . getChild ( _) }
5658
5759 /**
5860 * Gets the `i`th attribute (0-based) of this element.
@@ -62,13 +64,13 @@ module HTML {
6264 /**
6365 * Gets an attribute of this element.
6466 */
65- Attribute getAnAttribute ( ) { result = getAttribute ( _) }
67+ Attribute getAnAttribute ( ) { result = this . getAttribute ( _) }
6668
6769 /**
6870 * Gets an attribute of this element that has the given name.
6971 */
7072 Attribute getAttributeByName ( string name ) {
71- result = getAnAttribute ( ) and
73+ result = this . getAnAttribute ( ) and
7274 result .getName ( ) = name
7375 }
7476
@@ -77,7 +79,7 @@ module HTML {
7779 */
7880 TextNode getTextNode ( ) { result .getParent ( ) = this }
7981
80- override string toString ( ) { result = "<" + getName ( ) + ">...</>" }
82+ override string toString ( ) { result = "<" + this . getName ( ) + ">...</>" }
8183 }
8284
8385 /**
@@ -106,7 +108,7 @@ module HTML {
106108 * Gets the root element in which the element to which this attribute
107109 * belongs is contained.
108110 */
109- Element getRoot ( ) { result = getElement ( ) .getRoot ( ) }
111+ Element getRoot ( ) { result = this . getElement ( ) .getRoot ( ) }
110112
111113 /**
112114 * Gets the name of this attribute.
@@ -121,7 +123,7 @@ module HTML {
121123 */
122124 string getValue ( ) { xmlAttrs ( this , _, _, result , _, _) }
123125
124- override string toString ( ) { result = getName ( ) + "=" + getValue ( ) }
126+ override string toString ( ) { result = this . getName ( ) + "=" + this . getValue ( ) }
125127 }
126128
127129 /**
@@ -138,7 +140,7 @@ module HTML {
138140 * ```
139141 */
140142 class DocumentElement extends Element {
141- DocumentElement ( ) { getName ( ) = "html" }
143+ DocumentElement ( ) { this . getName ( ) = "html" }
142144 }
143145
144146 /**
@@ -155,7 +157,7 @@ module HTML {
155157 class TextNode extends Locatable , @xmlcharacters {
156158 TextNode ( ) { exists ( HtmlFile f | xmlChars ( this , _, _, _, _, f ) ) }
157159
158- override string toString ( ) { result = getText ( ) }
160+ override string toString ( ) { result = this . getText ( ) }
159161
160162 /**
161163 * Gets the content of this text node.
@@ -198,7 +200,7 @@ module HTML {
198200 Element getParent ( ) { xmlComments ( this , _, result , _) }
199201
200202 /** Gets the text of this comment, not including delimiters. */
201- string getText ( ) { result = toString ( ) .regexpCapture ( "(?s)<!--(.*)-->" , 1 ) }
203+ string getText ( ) { result = this . toString ( ) .regexpCapture ( "(?s)<!--(.*)-->" , 1 ) }
202204
203205 override string toString ( ) { xmlComments ( this , result , _, _) }
204206
0 commit comments