1
1
/** Provides classes for working with HTML documents. */
2
2
3
3
import javascript
4
+ private import internal.Locations
4
5
5
6
module HTML {
6
7
/**
@@ -43,7 +44,12 @@ module HTML {
43
44
class Element extends Locatable , @xmlelement {
44
45
Element ( ) { exists ( FileContainingHtml f | xmlElements ( this , _, _, _, f ) ) }
45
46
46
- override Location getLocation ( ) { xmllocations ( this , result ) }
47
+ override DbLocation getLocation ( ) {
48
+ exists ( @location loc |
49
+ xmllocations ( this , loc ) and
50
+ result = TDbLocation ( loc )
51
+ )
52
+ }
47
53
48
54
/**
49
55
* Gets the name of this HTML element.
@@ -122,7 +128,12 @@ module HTML {
122
128
class Attribute extends Locatable , @xmlattribute {
123
129
Attribute ( ) { exists ( FileContainingHtml f | xmlAttrs ( this , _, _, _, _, f ) ) }
124
130
125
- override Location getLocation ( ) { xmllocations ( this , result ) }
131
+ override DbLocation getLocation ( ) {
132
+ exists ( @location loc |
133
+ xmllocations ( this , loc ) and
134
+ result = TDbLocation ( loc )
135
+ )
136
+ }
126
137
127
138
/**
128
139
* Gets the inline script of this attribute, if any.
@@ -327,7 +338,12 @@ module HTML {
327
338
*/
328
339
predicate isCData ( ) { xmlChars ( this , _, _, _, 1 , _) }
329
340
330
- override Location getLocation ( ) { xmllocations ( this , result ) }
341
+ override DbLocation getLocation ( ) {
342
+ exists ( @location loc |
343
+ xmllocations ( this , loc ) and
344
+ result = TDbLocation ( loc )
345
+ )
346
+ }
331
347
}
332
348
333
349
/**
@@ -350,6 +366,11 @@ module HTML {
350
366
351
367
override string toString ( ) { xmlComments ( this , result , _, _) }
352
368
353
- override Location getLocation ( ) { xmllocations ( this , result ) }
369
+ override DbLocation getLocation ( ) {
370
+ exists ( @location loc |
371
+ xmllocations ( this , loc ) and
372
+ result = TDbLocation ( loc )
373
+ )
374
+ }
354
375
}
355
376
}
0 commit comments