diff --git a/lib/url-state-machine.js b/lib/url-state-machine.js index e386a8221..ca6b00232 100644 --- a/lib/url-state-machine.js +++ b/lib/url-state-machine.js @@ -575,6 +575,13 @@ URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, c URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { if (infra.isASCIIAlphanumeric(c) || c === p("+") || c === p("-") || c === p(".")) { this.buffer += cStr.toLowerCase(); + } else if (c === p(":") && this.buffer.length === 1 && + [...this.buffer].every(ch => infra.isASCIIAlpha(ch.codePointAt(0))) && + this.input[this.pointer + 1] === p("\\")) { + this.url.scheme = "file"; + this.url.host = ""; + this.buffer += ":"; + this.state = "path"; } else if (c === p(":")) { if (this.stateOverride) { if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { diff --git a/scripts/get-latest-platform-tests.js b/scripts/get-latest-platform-tests.js index 2c09518d6..cc7ed2ebd 100644 --- a/scripts/get-latest-platform-tests.js +++ b/scripts/get-latest-platform-tests.js @@ -13,7 +13,7 @@ const path = require("path"); // 1. Go to https://github.com/web-platform-tests/wpt/tree/master/url // 2. Press "y" on your keyboard to get a permalink // 3. Copy the commit hash -const commitHash = "40fc257a28faf7c378f59185235685ea8684e8f4"; +const commitHash = "d0bdd2662590a436305355c1bf84754d756689b4"; const urlPrefix = `https://raw.githubusercontent.com/web-platform-tests/wpt/${commitHash}/url/`; const targetDir = path.resolve(__dirname, "..", "test", "web-platform-tests");