Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Cosmetic changes Created July 28, 2017, 11:02 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « metadata.edge ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -70,6 +70,7 @@
"text", "removeExisting");
const addFilter = wrapper({type: "filters.add"}, "text");
const removeFilter = wrapper({type: "filters.remove"}, "text");
+const quoteCSS = wrapper({type: "composer.quoteCSS"}, "CSS");
const whitelistedDomainRegexp = /^@@\|\|([^/:]+)\^\$document$/;
const statusMessages = new Map([
@@ -529,9 +530,14 @@
function removeFromListBox(boxId, text)
{
let list = document.getElementById(boxId);
- let selector = "option[value=" + CSS.escape(text) + "]";
- for (let option of list.querySelectorAll(selector))
- list.removeChild(option);
+ // Edge does not support CSS.escape yet:
+ // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/101410/
+ quoteCSS(text, escapedCSS =>
+ {
+ let selector = "option[value=" + escapedCSS + "]";
+ for (let option of list.querySelectorAll(selector))
+ list.removeChild(option);
+ });
}
function addWhitelistDomain(event)
« no previous file with comments | « metadata.edge ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld