Repository navigation
Commit bcc037a
Honor script type and legacy event attributes
Strip only leading and trailing ASCII whitespace from script type attributes. JavaScript's trim() also removes non-ASCII whitespace, incorrectly allowing scripts with otherwise unrecognized types to execute.
When both for and event attributes are present, restrict classic script execution to for="window" with event="onload" or event="onload()", using ASCII case-insensitive comparisons after stripping ASCII whitespace. Scripts with other combinations must not run.
Follow https://html.spec.whatwg.org/multipage/scripting.html#prepare-the-script-element.
Co-authored-by: codex <[email protected]>1 parent faa5c4f commit bcc037a
2 files changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
| |||
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
212 | | - | |
| 221 | + | |
213 | 222 | | |
214 | 223 | | |
215 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2143 | 2143 | | |
2144 | 2144 | | |
2145 | 2145 | | |
2146 | | - | |
2147 | | - | |
2148 | 2146 | | |
2149 | 2147 | | |
2150 | 2148 | | |
| |||
2154 | 2152 | | |
2155 | 2153 | | |
2156 | 2154 | | |
2157 | | - | |
2158 | 2155 | | |
2159 | 2156 | | |
2160 | 2157 | | |
| |||
0 commit comments