diff --git a/.travis.yml b/.travis.yml index 9d7d2526d7440..b71170795be8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,10 @@ language: node_js sudo: false -# force trusty as Google Chrome addon is not supported on Precise dist: trusty node_js: - '6.9.5' addons: - chrome: stable # firefox: "38.0" apt: sources: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6da0cb25d17c7..9aa324f89b7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [4.4.7](https://github.com/angular/angular/compare/4.4.6...4.4.7) (2018-04-16) + + +### Bug Fixes + +* **core:** use appropriate inert document strategy for Firefox & Safari ([#22077](https://github.com/angular/angular/issues/22077)) ([2c5cf19](https://github.com/angular/angular/commit/2c5cf19)) + + + ## [4.4.6](https://github.com/angular/angular/compare/4.4.5...4.4.6) (2017-10-18) diff --git a/aio/karma.conf.js b/aio/karma.conf.js index c2d83c7804636..032dd4145363f 100644 --- a/aio/karma.conf.js +++ b/aio/karma.conf.js @@ -30,8 +30,14 @@ module.exports = function (config) { colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], + browsers: ['CustomChrome'], browserNoActivityTimeout: 60000, - singleRun: false + singleRun: false, + customLaunchers: { + CustomChrome: { + base: 'Chrome', + flags: process.env.TRAVIS && ['--no-sandbox'] + } + } }); }; diff --git a/aio/package.json b/aio/package.json index 0431e3d63402d..c575a860d5488 100644 --- a/aio/package.json +++ b/aio/package.json @@ -57,7 +57,7 @@ "~~check-env": "node scripts/check-environment", "~~build": "ng build --target=production --environment=stable -sm --build-optimizer", "post~~build": "yarn sw-manifest && yarn sw-copy", - "~~update-webdriver": "webdriver-manager update --standalone false --gecko false" + "~~update-webdriver": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG" }, "engines": { "node": ">=6.9.5 <7.0.0", diff --git a/aio/protractor.conf.js b/aio/protractor.conf.js index 1cd695135f7e2..d112804b62c95 100644 --- a/aio/protractor.conf.js +++ b/aio/protractor.conf.js @@ -12,7 +12,8 @@ exports.config = { browserName: 'chrome', // For Travis chromeOptions: { - binary: process.env.CHROME_BIN + binary: process.env.CHROME_BIN, + args: ['--no-sandbox'] } }, directConnect: true, diff --git a/aio/scripts/test-pwa-score.js b/aio/scripts/test-pwa-score.js index a53e1b28b26d0..bf2fc2916a165 100644 --- a/aio/scripts/test-pwa-score.js +++ b/aio/scripts/test-pwa-score.js @@ -17,8 +17,16 @@ const printer = require('lighthouse/lighthouse-cli/printer'); const config = require('lighthouse/lighthouse-core/config/default.js'); // Constants +const CHROME_LAUNCH_OPTS = {}; const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/'; + +// Specify the path and flags for Chrome on Travis +if (process.env.TRAVIS) { + process.env.LIGHTHOUSE_CHROMIUM_PATH = process.env.CHROME_BIN; + CHROME_LAUNCH_OPTS.chromeFlags = ['--no-sandbox']; +} + // Run _main(process.argv.slice(2)); @@ -66,7 +74,7 @@ function ignoreHttpsAudits(config) { } function launchChromeAndRunLighthouse(url, flags, config) { - return chromeLauncher.launch().then(chrome => { + return chromeLauncher.launch(CHROME_LAUNCH_OPTS).then(chrome => { flags.port = chrome.port; return lighthouse(url, flags, config). then(results => chrome.kill().then(() => results)). diff --git a/aio/tools/examples/shared/package.json b/aio/tools/examples/shared/package.json index 85ba989112e2f..9c665fc06dc81 100644 --- a/aio/tools/examples/shared/package.json +++ b/aio/tools/examples/shared/package.json @@ -6,7 +6,7 @@ "scripts": { "http-server": "http-server", "protractor": "protractor", - "webdriver:update": "webdriver-manager update --standalone false --gecko false", + "webdriver:update": "webdriver-manager update --standalone false --gecko false $CHROMEDRIVER_VERSION_ARG", "postinstall": "yarn webdriver:update" }, "keywords": [], diff --git a/aio/tools/examples/shared/protractor.config.js b/aio/tools/examples/shared/protractor.config.js index 21b54feb8bc4b..4e97cc1d6ae72 100644 --- a/aio/tools/examples/shared/protractor.config.js +++ b/aio/tools/examples/shared/protractor.config.js @@ -20,7 +20,12 @@ exports.config = { // Capabilities to be passed to the webdriver instance. capabilities: { - 'browserName': 'chrome' + 'browserName': 'chrome', + // For Travis + chromeOptions: { + binary: process.env.CHROME_BIN, + args: ['--no-sandbox'] + } }, // Framework to use. Jasmine is recommended. diff --git a/integration/hello_world__closure/package.json b/integration/hello_world__closure/package.json index 51ec7029bace5..78519201cc869 100644 --- a/integration/hello_world__closure/package.json +++ b/integration/hello_world__closure/package.json @@ -23,7 +23,7 @@ "protractor": "file:../../node_modules/protractor" }, "scripts": { - "postinstall": "webdriver-manager update --gecko false", + "postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG", "closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf", "test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first", "serve": "lite-server -c e2e/browser.config.json", diff --git a/integration/hello_world__systemjs_umd/package.json b/integration/hello_world__systemjs_umd/package.json index c3b3fb42b2a1d..bc65edc9bc7ff 100644 --- a/integration/hello_world__systemjs_umd/package.json +++ b/integration/hello_world__systemjs_umd/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "license": "MIT", "scripts": { - "postinstall": "webdriver-manager update --gecko false", + "postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG", "test": "concurrently \"npm run serve\" \"npm run protractor\" --kill-others --success first", "serve": "lite-server -c bs-config.e2e.json", "preprotractor": "tsc -p e2e", diff --git a/package.json b/package.json index e99953aacbe74..4d8d3a90fe505 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-srcs", - "version": "4.4.6", + "version": "4.4.7", "private": true, "branchPattern": "2.0.*", "description": "Angular - a web framework for modern web apps", @@ -18,7 +18,8 @@ }, "scripts": { "preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/')\"", - "postinstall": "webdriver-manager update --gecko false", + "postinstall": "yarn update-webdriver", + "update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG", "check-env": "gulp check-env" }, "dependencies": { diff --git a/packages/platform-browser/src/security/html_sanitizer.ts b/packages/platform-browser/src/security/html_sanitizer.ts index c0cccf3530984..7365df8813806 100644 --- a/packages/platform-browser/src/security/html_sanitizer.ts +++ b/packages/platform-browser/src/security/html_sanitizer.ts @@ -10,35 +10,9 @@ import {isDevMode} from '@angular/core'; import {DomAdapter, getDOM} from '../dom/dom_adapter'; +import {InertBodyHelper} from './inert_body'; import {sanitizeSrcset, sanitizeUrl} from './url_sanitizer'; -/** A element that can be safely used to parse untrusted HTML. Lazily initialized below. */ -let inertElement: HTMLElement|null = null; -/** Lazily initialized to make sure the DOM adapter gets set before use. */ -let DOM: DomAdapter = null !; - -/** Returns an HTML element that is guaranteed to not execute code when creating elements in it. */ -function getInertElement() { - if (inertElement) return inertElement; - DOM = getDOM(); - - // Prefer using