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AC,CAAC;CACnC,CAAC","file":"history.js","sourcesContent":["// Window history.\n//\n// Each window belongs to a history. Think of history as a timeline, with\n// currently active window, and multiple previous and future windows. From that\n// window you can navigate backwards and forwards between all other windows that\n// belong to the same history.\n//\n// Each window also has a container: either a browser tab or an iframe. When\n// navigating in history, a different window (from the same history), replaces\n// the current window within its container.\n//\n// Containers have access to the currently active window, not the history\n// itself, so navigation has to alert the container when there's a change in the\n// currently active window.\n//\n// The history does so by calling a \"focus\" function. To create the first\n// window, the container must first create a new history and supply a focus\n// function. The result is another function it can use to create the new window.\n//\n// From there on, it can navigate in history and add new windows by changing the\n// current location (or using assign/replace).\n//\n// It can be used like this:\n//\n// active = null\n// focus = (window)->\n// active = window\n// history = createHistory(browser, focus)\n// window = history(url: url, name: name)\n\n\nconst assert = require('assert');\nconst loadDocument = require('./document');\nconst resourceLoader = require('jsdom/lib/jsdom/browser/resource-loader');\nconst URL = require('url');\n\n\nclass Location {\n\n constructor(history, url) {\n this._history = history;\n this._url = url || (history.current ? history.current.url : 'about:blank');\n }\n\n assign(url) {\n this._history.assign(url);\n }\n\n replace(url) {\n this._history.replace(url);\n }\n\n reload() {\n this._history.reload();\n }\n\n toString() {\n return this._url;\n }\n\n get hostname() {\n return URL.parse(this._url).hostname;\n }\n\n set hostname(hostname) {\n const newUrl = URL.parse(this._url);\n if (newUrl.port)\n newUrl.host = `${hostname}:${newUrl.port}`;\n else\n newUrl.host = hostname;\n this.assign(URL.format(newUrl));\n }\n\n get href() {\n return this._url;\n }\n\n set href(href) {\n this.assign(URL.format(href));\n }\n\n get origin() {\n return `${this.protocol}//${this.host}`;\n }\n\n get hash() {\n return URL.parse(this._url).hash || '';\n }\n\n set hash(value) {\n const url = Object.assign(URL.parse(this._url), { hash: value });\n this.assign(URL.format(url));\n }\n\n get host() {\n return URL.parse(this._url).host || '';\n }\n\n set host(value) {\n const url = Object.assign(URL.parse(this._url), { host: value });\n this.assign(URL.format(url));\n }\n\n get pathname() {\n return URL.parse(this._url).pathname || '';\n }\n\n set pathname(value) {\n const url = Object.assign(URL.parse(this._url), { pathname: value });\n this.assign(URL.format(url));\n }\n\n get port() {\n return URL.parse(this._url).port || '';\n }\n\n set port(value) {\n const url = Object.assign(URL.parse(this._url), { port: value });\n this.assign(URL.format(url));\n }\n\n get protocol() {\n return URL.parse(this._url).protocol || '';\n }\n\n set protocol(value) {\n const url = Object.assign(URL.parse(this._url), { protocol: value });\n this.assign(URL.format(url));\n }\n\n get search() {\n return URL.parse(this._url).search || '';\n }\n\n set search(value) {\n const url = Object.assign(URL.parse(this._url), { search: value });\n this.assign(URL.format(url));\n }\n}\n\n\n// Returns true if the hash portion of the URL changed between the history entry\n// (entry) and the new URL we want to inspect (url).\nfunction hashChange(entry, url) {\n if (!entry)\n return false;\n const [aBase, aHash] = url.split('#');\n const [bBase, bHash] = entry.url.split('#');\n return (aBase === bBase) && (aHash !== bHash);\n}\n\n// If window is not the top level window, return parent for creating new child\n// window, otherwise returns false.\nfunction parentFrom(window) {\n if (window.parent !== window)\n return window.parent;\n}\n\n\n// Entry has the following properties:\n// window - Window for this history entry (may be shared with other entries)\n// url - URL for this history entry\n// pushState - Push state state\n// next - Next entry in history\n// prev - Previous entry in history\nclass Entry {\n\n constructor(window, url, pushState) {\n this.window = window;\n this.url = URL.format(url);\n this.pushState = pushState;\n this.prev = null;\n this.next = null;\n }\n\n // Called to destroy this entry. Used when we destroy the entire history,\n // closing all windows. But also used when we replace one entry with another,\n // and there are two cases to worry about:\n // - The current entry uses the same window as the previous entry, we get rid\n // of the entry, but must keep the entry intact\n // - The current entry uses the same window as the new entry, also need to\n // keep window intact\n //\n // keepAlive - Call destroy on every document except this one, since it's\n // being replaced.\n destroy(keepAlive) {\n if (this.next) {\n this.next.destroy(keepAlive || this.window);\n this.next = null;\n }\n // Do not close window if replacing entry with same window\n if (keepAlive === this.window)\n return;\n // Do not close window if used by previous entry in history\n if (this.prev && this.prev.window === this.window)\n return;\n this.window._destroy();\n }\n\n append(newEntry, keepAlive) {\n if (this.next)\n this.next.destroy(keepAlive);\n newEntry.prev = this;\n this.next = newEntry;\n }\n\n}\n\n\nclass History {\n\n constructor(browser, focus) {\n this.browser = browser;\n this.focus = focus;\n this.first = null;\n this.current = null;\n }\n\n // Opens the first window and returns it.\n open(args) {\n args.browser = this.browser;\n args.history = this;\n const document = loadDocument(args);\n const window = document.defaultView;\n this.addEntry(window, args.url);\n return window;\n }\n\n // Dispose of all windows in history\n destroy() {\n this.focus(null);\n // Re-entrant\n const first = this.first;\n this.first = null;\n this.current = null;\n if (first)\n first.destroy();\n }\n\n // Add a new entry. When a window opens it call this to add itself to history.\n addEntry(window, url = window.location.href, pushState = undefined) {\n const entry = new Entry(window, url, pushState);\n if (this.current) {\n this.current.append(entry);\n this.current = entry;\n } else {\n this.first = entry;\n this.current = entry;\n }\n this.focus(window);\n }\n\n // Replace current entry with a new one.\n replaceEntry(window, url = window.location.href, pushState = undefined) {\n const entry = new Entry(window, url, pushState);\n if (this.current === this.first) {\n if (this.current)\n this.current.destroy(window);\n this.first = entry;\n this.current = entry;\n } else {\n this.current.prev.append(entry, window);\n this.current = entry;\n }\n this.focus(window);\n }\n\n // Call with two argument to update window.location and current.url to new URL\n updateLocation(window, url) {\n if (window === this.current)\n this.current.url = url;\n window.document._URL = url;\n window.document._location = new Location(this, url);\n }\n\n // Returns window.location\n get location() {\n return new Location(this);\n }\n\n\n // Form submission\n submit(args) {\n args.browser = this.browser;\n args.history = this;\n const { window } = this.current;\n if (window) {\n args.name = window.name;\n args.parent = parentFrom(window);\n args.referrer = window.location.href;\n }\n const document = loadDocument(args);\n this.addEntry(document.defaultView, document.location.href);\n }\n\n // Returns current URL.\n get url() {\n return this.current && this.current.url;\n }\n\n\n // -- Implementation of window.history --\n\n // This method is available from Location, used to navigate to a new page.\n assign(url) {\n let name = '';\n let parent = null;\n\n if (this.current) {\n url = resourceLoader.resolveResourceUrl(this.current.window.document, url);\n name = this.current.window.name;\n parent = parentFrom(this.current.window);\n }\n if (this.current && this.current.url === url) {\n this.replace(url);\n return;\n }\n\n if (hashChange(this.current, url)) {\n const { window } = this.current;\n this.updateLocation(window, url);\n this.addEntry(window, url); // Reuse window with new URL\n const event = window.document.createEvent('HTMLEvents');\n event.initEvent('hashchange', true, false);\n window._eventQueue.enqueue(function() {\n window.dispatchEvent(event);\n });\n } else {\n const args = {\n browser: this.browser,\n history: this,\n name: name,\n url: url,\n parent: parent,\n referrer: this.current && this.current.window.document.referrer\n };\n const document = loadDocument(args);\n this.addEntry(document.defaultView, url);\n }\n }\n\n // This method is available from Location, used to navigate to a new page.\n replace(url) {\n url = URL.format(url);\n let name = '';\n\n if (this.current) {\n url = resourceLoader.resolveResourceUrl(this.current.window.document, url);\n name = this.current.window.name;\n }\n\n if (hashChange(this.current, url)) {\n const { window } = this.current;\n this.replaceEntry(window, url); // Reuse window with new URL\n const event = window.document.createEvent('HTMLEvents');\n event.initEvent('hashchange', true, false);\n window._eventQueue.enqueue(function() {\n window.dispatchEvent(event);\n });\n } else {\n const args = {\n browser: this.browser,\n history: this,\n name: name,\n url: url,\n parent: parentFrom(this.current.window)\n };\n const document = loadDocument(args);\n this.replaceEntry(document.defaultView, url);\n }\n }\n\n reload() {\n const { window } = this.current;\n if (window) {\n const url = window.location.href;\n const args = {\n browser: this.browser,\n history: this,\n name: window.name,\n url: url,\n parent: parentFrom(window),\n referrer: window.document.referrer\n };\n const document = loadDocument(args);\n this.replaceEntry(document.defaultView, url);\n }\n }\n\n // This method is available from Location.\n go(amount) {\n const was = this.current;\n while (amount > 0) {\n if (this.current.next)\n this.current = this.current.next;\n --amount;\n }\n while (amount < 0) {\n if (this.current.prev)\n this.current = this.current.prev;\n ++amount;\n }\n\n // If moving from one page to another\n if (this.current && was && this.current !== was) {\n const { window } = this.current;\n this.updateLocation(window, this.current.url);\n this.focus(window);\n\n if (this.current.pushState || was.pushState) {\n // Created with pushState/replaceState, send popstate event if navigating\n // within same host.\n const oldHost = URL.parse(was.url).host;\n const newHost = URL.parse(this.current.url).host;\n if (oldHost === newHost) {\n const popstate = window.document.createEvent('HTMLEvents');\n popstate.initEvent('popstate', false, false);\n popstate.state = this.current.pushState;\n window._eventQueue.enqueue(function() {\n window.dispatchEvent(popstate);\n });\n }\n } else if (hashChange(was, this.current.url)) {\n const hashchange = window.document.createEvent('HTMLEvents');\n hashchange.initEvent('hashchange', true, false);\n window._eventQueue.enqueue(function() {\n window.dispatchEvent(hashchange);\n });\n }\n }\n }\n\n\n // This method is available from Location.\n get length() {\n let entry = this.first;\n let length = 0;\n while (entry) {\n ++length;\n entry = entry.next;\n }\n return length;\n }\n\n\n // This method is available from Location.\n pushState(state, title, url = this.url) {\n url = resourceLoader.resolveResourceUrl(this.current.window.document, url);\n // TODO: check same origin\n this.addEntry(this.current.window, url, state || {});\n this.updateLocation(this.current.window, url);\n }\n\n // This method is available from Location.\n replaceState(state, title, url = this.url) {\n url = resourceLoader.resolveResourceUrl(this.current.window.document, url);\n // TODO: check same origin\n this.replaceEntry(this.current.window, url, state || {});\n this.updateLocation(this.current.window, url);\n }\n\n // This method is available from Location.\n get state() {\n return this.current.pushState;\n }\n\n\n dump(output = process.stdout) {\n for (let entry = this.first, i = 1; entry; entry = entry.next, ++i)\n output.write(`${i}: ${URL.format(entry.url)}\\n`);\n }\n}\n\n\n// Creates and returns a new history.\n//\n// browser - The browser object\n// focus - The focus method, called when a new window is in focus\n//\n// Returns a function for opening a new window, which accepts:\n// name - Window name (optional)\n// opener - Opening window (window.open call)\n// parent - Parent window (for frames)\n// url - Set document location to this URL upon opening\nmodule.exports = function createHistory(browser, focus) {\n assert(browser && browser.visit, 'Missing parameter browser');\n assert(focus && focus.call, 'Missing parameter focus or not a function');\n const history = new History(browser, focus);\n return history.open.bind(history);\n};\n\n"]}