Closed
Bug 1221156
Opened 9 years ago
Closed 9 years ago
Openning the inspector's filter tooltip (to edit a SVG url CSS filter) breaks "data:" URLs
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(firefox45 fixed)
RESOLVED
FIXED
Firefox 45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: arni2033, Assigned: tromey)
References
Details
Attachments
(3 files, 2 obsolete files)
STR: (Win7_64, Nightly 45, 32bit, ID 20151031030207, new profile)
1. Open attached "testcase 1"
2. Open devtools -> Inspector, inspect <div>, open "Rules" tab in sidebar
3. Click the circle between "filter" and "url"
Result: The value changed and the rule became invalid
> before clicking url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='blur'><feGaussianBlur stdDeviation='3'/></filter></svg>#blur");
> after clicking url(data:image/svg+xml;utf8,<svg )xmlns='http://www.w3.org/2000/svg'><filter id='blur'><feGaussianBlur stdDeviation='3'/></filter></svg>#blur);
Before bug 1211796 (I guess) the STR resulted in the following invalid url (I still see that on Fx43):
> before 1211796 url(data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'><filter%20id='blur'><feGaussianBlur%20stdDeviation='3'/></filter></svg>#blur);
Expectations: Url should not change
Sorry for bugspam. Apparently, it wasn't 1211796 which changed the way of url breakage. It was 1217328
However, it's not "blocking", because I don't think it has made things way worse.
> pushlog_url (of changing the way of url breakage): https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=1a1d5630602c120dddc54c931fa3227a729d1153&tochange=c6fa796af5487f5fafdef19f0b436102439d80d6
> bug 1217328
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Attachment #8684954 -
Flags: review?(pbrosset)
Comment 5•9 years ago
|
||
Comment on attachment 8684954 [details] [diff] [review]
make FilterWidget try to preserve URL quoting
Review of attachment 8684954 [details] [diff] [review]:
-----------------------------------------------------------------
::: devtools/client/shared/widgets/FilterWidget.js
@@ +824,3 @@
> const {value, unit} = filter;
>
> return value + unit;
Took me a while to read this function, maybe I was just being dumb, but having this big block of logic in the middle threw me off. I didn't even see the returns at first.
I think this would be more readable (at least to me):
getValueAt: function(index) {
let filter = this.filters[index];
if (!filter) {
return null;
}
// Just return the value + unit for non-url values.
if (filter.name !== "url") {
return filter.value + filter.unit;
}
// url values need to be quoted and escaped.
if (filter.quote === "'") {
return "'" + filter.value.replace(/\'/g, "\\'") + "'";
} else if (filter.quote === "\"") {
return "\"" + filter.value.replace(/\"/g, "\\\"") + "\"";
}
// Unquoted. This approach might change the original input --
// for example the original might be over-quoted. But, this is
// correct and probably good enough.
return filter.value.replace(/[ \t(){};]/g, "\\$&");
}
Attachment #8684954 -
Flags: review?(pbrosset) → review+
Assignee | ||
Comment 6•9 years ago
|
||
Updated per review.
Assignee | ||
Updated•9 years ago
|
Attachment #8685448 -
Flags: review+
Assignee | ||
Comment 7•9 years ago
|
||
Assignee | ||
Comment 8•9 years ago
|
||
Rebase on top of patch for bug 1223076.
Attachment #8684954 -
Attachment is obsolete: true
Attachment #8685448 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8686160 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 10•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 45
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•