| Summary: | [HTML] onClick and on* event attributes are not added to CU based on case | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Steve Northover <steve_northover> |
| Component: | JS Tools | Assignee: | Curtis Windatt <curtis.windatt.public> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public, Michael_Rennie |
| Version: | 10.0 | ||
| Target Milestone: | 11.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | 481137 | ||
| Bug Blocks: | |||
There is some weirdness here due to Bug 481137 with the prefix being added and I will add comments to that bug. But there is another significant problem specific to this case: It appears we are using a case sensitive check for on* attributes (onClick is ignored). To be specific, the regex is run case insensitive but our list of known attributes is using object keys. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=cfc00781284d35207ae3629e75b97ab67f7916a5 Fixed the case issue as well as an offset issue in findScriptBlocks http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6095b10761a31439d065dcff1cbe3d4e7607e96d Add tests for case sensitivity, fix tests for offset issue. The exact test case in this example does not work. I tried changing the bogus case from onClick to onclick and it made no difference. (In reply to Steve Northover from comment #4) > The exact test case in this example does not work. I tried changing the > bogus case from onClick to onclick and it made no difference. That initial case is actually a dupe of 481137. Fixing the case issue means it is treated as a snippet, but we are still prepending is with 'this.' resulting in eslint thinking the function is unused. I have code in my workspace which will be committed under 481137 that removes the prefixing and fixes this case. I did however leave a question on that bug about whether we ever want to see 'unused function' warnings in HTML files. Ummm ... you can't close a bug as FIXED when it has a set of steps that still show the problem. You can close it as a DUP or say it depends on another bug or that the steps are invalid or ... Spoke to Curtis and we agree to reopen the bug and close it when the dependent bug is fixed. I have verified that the steps in this bug report no longer show a problem. Normally I would just close the bug. Is there any reason you want this bug to remain open? If not, just close as FIXED. Now that Bug 481137 is closed this should be closed too. |
1) get minesweeper-object 2) open button.html 3) hover over quick fix for line 12 (ie. "function onClick(ev) { ...") 3) BUG: 'Function onClick is not used' The onClick() function is referenced later in the HTML file: <body> <button onClick="onClick()"><img src="images/happy.gif"></button> <!-- <button onClick="click()"><img src="images/sad.gif"></button> --> </body>