Open Bug 1327997 Opened 7 years ago Updated 2 years ago

Event listeners tooltip displays corrupted source url

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: arni2033, Unassigned)

References

Details

(Keywords: regression)

>>>   My Info:   Win7_64, Nightly 52, 32bit, ID 20161001030430 (2016-10-01)
STR_1:
1. Open url   data:text/html,<body onclick="">
2. Open devtools -> inspector, click on (ev) button near <body> in markup

AR:  Event listeners tooltip displace source `<""=data:text/html,<body%20onclick`
ER:  Tooltip should display correct source:  `data:text/html,<body%20onclick="">`


STR_2:
1. Open http://example.org/
2. Open devtools -> inspector, add attribute `onclick=""` to <body> node in markup
3. Click on (ev) button near <body> in markup

AR:  Event listeners tooltip displace source `/http://exaple.org`
ER:  Tooltip should display correct source:  `http://exaple.org/`

This is regression from bug 1266450. Regression range:
> https://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=63ec66da50faad032454a44d3af3124c35102b3e&tochange=62ad4f6b5c3428e4b33e1e4ba75288c94c45ec92@ Julian Descottes [:jdescottes]:
It seems that this is a regresion caused by your change. Please have a look.
No longer blocks: 1277113
Component: Untriaged → Developer Tools: Animation Inspector
Component: Developer Tools: Animation Inspector → Developer Tools: Inspector
We set the event origin as the title and textContent of the filename element created in EventTooltipHelper.js [1]

We should escape the origin before setting it as the title attribute. I don't think we have any html escaping utility available, although it should be easy to add one. Or alternatively since we set it as the textContent of filename, we can get the escaped version by getting filename.innerHTML.

[1] http://searchfox.org/mozilla-central/source/devtools/client/shared/widgets/tooltip/EventTooltipHelper.js#101-110
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.