core: update chrome-devtools-frontend to latest (#6101)
This commit is contained in:
Родитель
f0e6dd9e7e
Коммит
67302a07cc
|
@ -91,7 +91,7 @@ function getEffectiveRule(property, node, {
|
|||
const matchingRule = nodeStyles
|
||||
.find(style =>
|
||||
// the applicable property will be the only one that isn't in the "overloaded" state.
|
||||
style.allProperties.some(item => item.name === property &&
|
||||
style.allProperties().some(item => item.name === property &&
|
||||
matchedStyles.propertyState(item) !== CSSMatchedStyles.PropertyState.Overloaded)
|
||||
);
|
||||
|
||||
|
|
|
@ -7,48 +7,49 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* Stubbery to allow portions of the DevTools frontend to be used in lighthouse. `WebInspector`
|
||||
* Stubbery to allow portions of the DevTools frontend to be used in lighthouse. `SDK`
|
||||
* technically lives on the global object but should be accessed through a normal `require` call.
|
||||
*/
|
||||
module.exports = (function() {
|
||||
if (global.WebInspector) {
|
||||
return global.WebInspector;
|
||||
}
|
||||
|
||||
// Global pollution.
|
||||
// Check below is to make it worker-friendly where global is worker's self.
|
||||
if (global.self !== global) {
|
||||
global.self = global;
|
||||
if (global.SDK) {
|
||||
return global.SDK;
|
||||
}
|
||||
|
||||
// Dependencies for effective CSS rule calculation. Global pollution!
|
||||
global.SDK = {};
|
||||
global.TextUtils = {};
|
||||
global.Node = {
|
||||
ELEMENT_NODE: 1,
|
||||
TEXT_NODE: 3,
|
||||
};
|
||||
|
||||
global.CSSAgent = {};
|
||||
global.CSSAgent.StyleSheetOrigin = {
|
||||
Injected: 'injected',
|
||||
UserAgent: 'user-agent',
|
||||
Inspector: 'inspector',
|
||||
Regular: 'regular',
|
||||
global.Protocol = {
|
||||
CSS: {
|
||||
StyleSheetOrigin: {
|
||||
Injected: 'injected',
|
||||
UserAgent: 'user-agent',
|
||||
Inspector: 'inspector',
|
||||
Regular: 'regular',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
global.CSS = {};
|
||||
global.CSS.supports = () => true;
|
||||
/**
|
||||
* The single prototype augmentation needed from 'chrome-devtools-frontend/front_end/platform/utilities.js'.
|
||||
* @return {Array<number>}
|
||||
*/
|
||||
String.prototype.computeLineEndings = function() { // eslint-disable-line no-extend-native
|
||||
const endings = [];
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
if (this.charAt(i) === '\n') {
|
||||
endings.push(i);
|
||||
}
|
||||
}
|
||||
endings.push(this.length);
|
||||
return endings;
|
||||
};
|
||||
|
||||
// Stash the real one so we can reinstall after DT incorrectly polyfills.
|
||||
// See https://github.com/GoogleChrome/lighthouse/issues/73
|
||||
const _setImmediate = global.setImmediate;
|
||||
|
||||
global.WebInspector = {};
|
||||
const WebInspector = global.WebInspector;
|
||||
|
||||
// Shared Dependencies
|
||||
require('chrome-devtools-frontend/front_end/platform/utilities.js');
|
||||
|
||||
// Dependencies for effective CSS rule calculation.
|
||||
require('chrome-devtools-frontend/front_end/common/TextRange.js');
|
||||
require('chrome-devtools-frontend/front_end/text_utils/Text.js');
|
||||
require('chrome-devtools-frontend/front_end/text_utils/TextRange.js');
|
||||
require('chrome-devtools-frontend/front_end/sdk/CSSMatchedStyles.js');
|
||||
require('chrome-devtools-frontend/front_end/sdk/CSSMedia.js');
|
||||
require('chrome-devtools-frontend/front_end/sdk/CSSMetadata.js');
|
||||
|
@ -56,15 +57,5 @@ module.exports = (function() {
|
|||
require('chrome-devtools-frontend/front_end/sdk/CSSRule.js');
|
||||
require('chrome-devtools-frontend/front_end/sdk/CSSStyleDeclaration.js');
|
||||
|
||||
WebInspector.CSSMetadata._generatedProperties = [
|
||||
{
|
||||
name: 'font-size',
|
||||
inherited: true,
|
||||
},
|
||||
];
|
||||
|
||||
// Restore setImmediate, see comment at top.
|
||||
global.setImmediate = _setImmediate;
|
||||
|
||||
return WebInspector;
|
||||
return global.SDK;
|
||||
})();
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"axe-core": "3.0.0-beta.2",
|
||||
"chrome-devtools-frontend": "1.0.422034",
|
||||
"chrome-devtools-frontend": "1.0.593291",
|
||||
"chrome-launcher": "^0.10.4",
|
||||
"configstore": "^3.1.1",
|
||||
"cssstyle": "1.1.1",
|
||||
|
|
|
@ -1029,9 +1029,9 @@ chrome-devtools-frontend@1.0.401423:
|
|||
version "1.0.401423"
|
||||
resolved "https://registry.yarnpkg.com/chrome-devtools-frontend/-/chrome-devtools-frontend-1.0.401423.tgz#32a89b8d04e378a494be3c8d63271703be1c04ea"
|
||||
|
||||
chrome-devtools-frontend@1.0.422034:
|
||||
version "1.0.422034"
|
||||
resolved "https://registry.yarnpkg.com/chrome-devtools-frontend/-/chrome-devtools-frontend-1.0.422034.tgz#071c8ce14466b7653032fcd1ad1a4a68d5e3cbd9"
|
||||
chrome-devtools-frontend@1.0.593291:
|
||||
version "1.0.593291"
|
||||
resolved "https://registry.yarnpkg.com/chrome-devtools-frontend/-/chrome-devtools-frontend-1.0.593291.tgz#72ed2e488e4ab8c5df9f35a5ce6bb128eb3c5e74"
|
||||
|
||||
chrome-launcher@^0.10.4:
|
||||
version "0.10.4"
|
||||
|
|
Загрузка…
Ссылка в новой задаче