mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
aggregate the tests in library-tests/HTML/HTMLElementAndHTMLAttribute into a single .ql file
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
| tst.html:5:17:5:33 | src=external.js | tst.html:5:9:5:43 | <script>...</> | src | external.js |
|
||||
| tst.html:10:11:10:16 | ng-app= | tst.html:10:5:12:11 | <body>...</> | ng-app | |
|
||||
| tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) | tst.html:11:9:11:64 | <a>...</> | href | javascript:void(alert('Nope!')) |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from HTML::Attribute a
|
||||
select a, a.getElement(), a.getName(), a.getValue()
|
||||
@@ -1,3 +0,0 @@
|
||||
| tst.html:5:9:5:43 | <script>...</> | 0 | tst.html:5:17:5:33 | src=external.js |
|
||||
| tst.html:10:5:12:11 | <body>...</> | 0 | tst.html:10:11:10:16 | ng-app= |
|
||||
| tst.html:11:9:11:64 | <a>...</> | 0 | tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from HTML::Element elt, int i
|
||||
select elt, i, elt.getAttribute(i)
|
||||
@@ -1,6 +0,0 @@
|
||||
| tst.html:2:1:13:7 | <html>...</> | 1 | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:2:1:13:7 | <html>...</> | 3 | tst.html:10:5:12:11 | <body>...</> |
|
||||
| tst.html:3:5:9:11 | <head>...</> | 1 | tst.html:4:9:4:32 | <title>...</> |
|
||||
| tst.html:3:5:9:11 | <head>...</> | 3 | tst.html:5:9:5:43 | <script>...</> |
|
||||
| tst.html:3:5:9:11 | <head>...</> | 5 | tst.html:6:9:8:17 | <script>...</> |
|
||||
| tst.html:10:5:12:11 | <body>...</> | 1 | tst.html:11:9:11:64 | <a>...</> |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from HTML::Element elt, int i
|
||||
select elt, i, elt.getChild(i)
|
||||
@@ -1,7 +0,0 @@
|
||||
| tst.html:2:1:13:7 | <html>...</> | html |
|
||||
| tst.html:3:5:9:11 | <head>...</> | head |
|
||||
| tst.html:4:9:4:32 | <title>...</> | title |
|
||||
| tst.html:5:9:5:43 | <script>...</> | script |
|
||||
| tst.html:6:9:8:17 | <script>...</> | script |
|
||||
| tst.html:10:5:12:11 | <body>...</> | body |
|
||||
| tst.html:11:9:11:64 | <a>...</> | a |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from HTML::Element elt
|
||||
select elt, elt.getName()
|
||||
@@ -1,6 +0,0 @@
|
||||
| tst.html:3:5:9:11 | <head>...</> | tst.html:2:1:13:7 | <html>...</> |
|
||||
| tst.html:4:9:4:32 | <title>...</> | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:5:9:5:43 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:6:9:8:17 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:10:5:12:11 | <body>...</> | tst.html:2:1:13:7 | <html>...</> |
|
||||
| tst.html:11:9:11:64 | <a>...</> | tst.html:10:5:12:11 | <body>...</> |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from HTML::Element elt
|
||||
select elt, elt.getParent()
|
||||
@@ -0,0 +1,30 @@
|
||||
htmlAttribute
|
||||
| tst.html:5:17:5:33 | src=external.js | tst.html:5:9:5:43 | <script>...</> | src | external.js |
|
||||
| tst.html:10:11:10:16 | ng-app= | tst.html:10:5:12:11 | <body>...</> | ng-app | |
|
||||
| tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) | tst.html:11:9:11:64 | <a>...</> | href | javascript:void(alert('Nope!')) |
|
||||
htmlElement_getAttribute
|
||||
| tst.html:5:9:5:43 | <script>...</> | 0 | tst.html:5:17:5:33 | src=external.js |
|
||||
| tst.html:10:5:12:11 | <body>...</> | 0 | tst.html:10:11:10:16 | ng-app= |
|
||||
| tst.html:11:9:11:64 | <a>...</> | 0 | tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) |
|
||||
htmlElement_getChild
|
||||
| tst.html:2:1:13:7 | <html>...</> | 1 | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:2:1:13:7 | <html>...</> | 3 | tst.html:10:5:12:11 | <body>...</> |
|
||||
| tst.html:3:5:9:11 | <head>...</> | 1 | tst.html:4:9:4:32 | <title>...</> |
|
||||
| tst.html:3:5:9:11 | <head>...</> | 3 | tst.html:5:9:5:43 | <script>...</> |
|
||||
| tst.html:3:5:9:11 | <head>...</> | 5 | tst.html:6:9:8:17 | <script>...</> |
|
||||
| tst.html:10:5:12:11 | <body>...</> | 1 | tst.html:11:9:11:64 | <a>...</> |
|
||||
htmlElement_getName
|
||||
| tst.html:2:1:13:7 | <html>...</> | html |
|
||||
| tst.html:3:5:9:11 | <head>...</> | head |
|
||||
| tst.html:4:9:4:32 | <title>...</> | title |
|
||||
| tst.html:5:9:5:43 | <script>...</> | script |
|
||||
| tst.html:6:9:8:17 | <script>...</> | script |
|
||||
| tst.html:10:5:12:11 | <body>...</> | body |
|
||||
| tst.html:11:9:11:64 | <a>...</> | a |
|
||||
htmlElement_getParent
|
||||
| tst.html:3:5:9:11 | <head>...</> | tst.html:2:1:13:7 | <html>...</> |
|
||||
| tst.html:4:9:4:32 | <title>...</> | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:5:9:5:43 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:6:9:8:17 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
|
||||
| tst.html:10:5:12:11 | <body>...</> | tst.html:2:1:13:7 | <html>...</> |
|
||||
| tst.html:11:9:11:64 | <a>...</> | tst.html:10:5:12:11 | <body>...</> |
|
||||
@@ -0,0 +1,21 @@
|
||||
import javascript
|
||||
|
||||
query predicate htmlAttribute(HTML::Attribute a, HTML::Element e, string name, string val) {
|
||||
e = a.getElement() and
|
||||
name = a.getName() and
|
||||
val = a.getValue()
|
||||
}
|
||||
|
||||
query predicate htmlElement_getAttribute(HTML::Element elt, int i, HTML::Attribute attr) {
|
||||
elt.getAttribute(i) = attr
|
||||
}
|
||||
|
||||
query predicate htmlElement_getChild(HTML::Element elt, int i, HTML::Element child) {
|
||||
elt.getChild(i) = child
|
||||
}
|
||||
|
||||
query predicate htmlElement_getName(HTML::Element elt, string name) { name = elt.getName() }
|
||||
|
||||
query predicate htmlElement_getParent(HTML::Element elt, HTML::Element parent) {
|
||||
parent = elt.getParent()
|
||||
}
|
||||
Reference in New Issue
Block a user