Skip to content

Commit 1c4e26a

Browse files
committed
merge updates from official devtools
CHROME-REV:46eb80c604172d2aefdeb290efad8a69286af51d CHROME-TAG:82.0.4080.0
2 parents 30ec36a + c2fd23a commit 1c4e26a

File tree

237 files changed

+191
-89966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+191
-89966
lines changed

Diff for: resources/unpacked/devtools/DEPS

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
vars = {
66
'build_url': 'https://chromium.googlesource.com/chromium/src/build.git',
7-
'build_revision': 'e393474c8c5e0e8c7437574379709915e55b14f2',
7+
'build_revision': '54fe4c7ea6338c333ec5f05c29c321fb22d9ec5d',
88

99
'buildtools_url': 'https://chromium.googlesource.com/chromium/src/buildtools.git',
1010
'buildtools_revision': 'fa6ae42dcfbf3bf965439c0bdfeb03cf4e2a5840',
1111

1212
'depot_tools_url': 'https://chromium.googlesource.com/chromium/tools/depot_tools.git',
13-
'depot_tools_revision': 'ee8be8a368620af69739f41046464630ed4f2309',
13+
'depot_tools_revision': 'ffd02955e6680f9f5a32872682bd03227487014e',
1414

1515
'inspector_protocol_url': 'https://chromium.googlesource.com/deps/inspector_protocol',
1616
'inspector_protocol_revision': '81ef742ba3587767fc08652d299df9e9b7051407',
@@ -23,11 +23,11 @@ vars = {
2323

2424
# Chromium build number for unit tests. It should be regularly updated to
2525
# the content of https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/LAST_CHANGE
26-
'chromium_linux': '747553',
26+
'chromium_linux': '747986',
2727
# the content of https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win_x64/LAST_CHANGE
28-
'chromium_win': '747549',
28+
'chromium_win': '747980',
2929
# the content of https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/LAST_CHANGE
30-
'chromium_mac': '747547',
30+
'chromium_mac': '747969',
3131
}
3232

3333
# Only these hosts are allowed for dependencies in this DEPS file.

Diff for: resources/unpacked/devtools/PRESUBMIT.py

+8-52
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"""
3434

3535
import sys
36+
import six
3637

3738
EXCLUSIVE_CHANGE_DIRECTORIES = [
3839
[ 'third_party', 'v8' ],
@@ -44,8 +45,10 @@
4445

4546

4647
def _ExecuteSubProcess(input_api, output_api, script_path, args, results):
47-
process = input_api.subprocess.Popen(
48-
[input_api.python_executable, script_path] + args, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
48+
if isinstance(script_path, six.string_types):
49+
script_path = [input_api.python_executable, script_path]
50+
51+
process = input_api.subprocess.Popen(script_path + args, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
4952
out, _ = process.communicate()
5053
if process.returncode != 0:
5154
results.append(output_api.PresubmitError(out))
@@ -113,16 +116,8 @@ def _CheckLicenses(input_api, output_api):
113116

114117
def _CheckFormat(input_api, output_api):
115118
results = [output_api.PresubmitNotifyResult('Running Format Checks:')]
116-
def popen(args):
117-
return input_api.subprocess.Popen(args=args, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
118-
119-
format_args = ['git', 'cl', 'format', '--js']
120-
format_process = popen(format_args)
121-
format_out, _ = format_process.communicate()
122-
if format_process.returncode != 0:
123-
results.append(output_api.PresubmitError(format_out))
124119

125-
return results
120+
return _ExecuteSubProcess(input_api, output_api, ['git', 'cl', 'format', '--js'], [], results)
126121

127122

128123
def _CheckDevtoolsLocalization(input_api, output_api, check_all_files=False): # pylint: disable=invalid-name
@@ -186,18 +181,6 @@ def _CheckOptimizeSVGHashes(input_api, output_api):
186181
return results
187182

188183

189-
def _CheckCSSViolations(input_api, output_api):
190-
results = [output_api.PresubmitNotifyResult('Running CSS Violation Check:')]
191-
for f in input_api.AffectedFiles(include_deletes=False):
192-
if not f.LocalPath().endswith('.css'):
193-
continue
194-
for line_number, line in f.ChangedContents():
195-
if '/deep/' in line:
196-
results.append(output_api.PresubmitError(('%s:%d uses /deep/ selector') % (f.LocalPath(), line_number)))
197-
if '::shadow' in line:
198-
results.append(output_api.PresubmitError(('%s:%d uses ::shadow selector') % (f.LocalPath(), line_number)))
199-
return results
200-
201184

202185
def _CheckGeneratedFiles(input_api, output_api):
203186
v8_directory_path = input_api.os_path.join(input_api.PresubmitLocalPath(), 'v8')
@@ -288,7 +271,6 @@ def _CommonChecks(input_api, output_api):
288271
results.extend(_CheckDevtoolsStyle(input_api, output_api))
289272
results.extend(_CheckFormat(input_api, output_api))
290273
results.extend(_CheckOptimizeSVGHashes(input_api, output_api))
291-
results.extend(_CheckCSSViolations(input_api, output_api))
292274
results.extend(_CheckChangesAreExclusiveToDirectory(input_api, output_api))
293275
results.extend(_CheckNoUncheckedFiles(input_api, output_api))
294276
results.extend(_CheckForTooLargeFiles(input_api, output_api))
@@ -325,38 +307,12 @@ def _getAffectedFiles(input_api, parent_directories, excluded_actions, accepted_
325307
return affected_files
326308

327309

328-
def _getAffectedFrontEndFiles(input_api):
329-
devtools_root = input_api.PresubmitLocalPath()
330-
devtools_front_end = input_api.os_path.join(devtools_root, 'front_end')
331-
affected_front_end_files = _getAffectedFiles(input_api, [devtools_front_end], ['D'], ['.js'])
332-
return [input_api.os_path.relpath(file_name, devtools_root) for file_name in affected_front_end_files]
333-
334-
335-
def _getAffectedJSFiles(input_api):
336-
devtools_root = input_api.PresubmitLocalPath()
337-
devtools_front_end = input_api.os_path.join(devtools_root, 'front_end')
338-
devtools_scripts = input_api.os_path.join(devtools_root, 'scripts')
339-
affected_js_files = _getAffectedFiles(input_api, [devtools_front_end, devtools_scripts], ['D'], ['.js'])
340-
return [input_api.os_path.relpath(file_name, devtools_root) for file_name in affected_js_files]
341-
342-
343-
def _checkWithNodeScript(input_api, output_api, script_path, script_arguments=None): # pylint: disable=invalid-name
310+
def _checkWithNodeScript(input_api, output_api, script_path, script_arguments=[]): # pylint: disable=invalid-name
344311
original_sys_path = sys.path
345312
try:
346313
sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), 'scripts')]
347314
import devtools_paths
348315
finally:
349316
sys.path = original_sys_path
350317

351-
node_path = devtools_paths.node_path()
352-
353-
if script_arguments is None:
354-
script_arguments = []
355-
356-
process = input_api.subprocess.Popen(
357-
[node_path, script_path] + script_arguments, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
358-
out, _ = process.communicate()
359-
360-
if process.returncode != 0:
361-
return [output_api.PresubmitError(out)]
362-
return [output_api.PresubmitNotifyResult(out)]
318+
return _ExecuteSubProcess(input_api, output_api, [devtools_paths.node_path(), script_path], script_arguments, [])

Diff for: resources/unpacked/devtools/front_end/inspector_main/RenderingOptions.js

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ export class RenderingOptionsView extends UI.Widget.VBox {
7474
this._appendSelect(
7575
ls`Forces CSS prefers-reduced-motion media feature`,
7676
self.Common.settings.moduleSetting('emulatedCSSMediaFeaturePrefersReducedMotion'));
77+
this.contentElement.createChild('div').classList.add('panel-section-separator');
78+
79+
this._appendSelect(
80+
ls`Forces vision deficiency emulation`, self.Common.settings.moduleSetting('emulatedVisionDeficiency'));
7781
}
7882

7983
/**

Diff for: resources/unpacked/devtools/front_end/inspector_main/inspector_main_strings.grdp

+24
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<message name="IDS_DEVTOOLS_035f93937dfd06c795a75877c9e6ddeb" desc="Checkbox subtitle for 'FPS meter' in the Rendering tool">
44
Plots frames per second, frame rate distribution, and GPU memory.
55
</message>
6+
<message name="IDS_DEVTOOLS_05934928102b17827b8f03ed60c3e6e0" desc="Command Menu search query that points to the Rendering tool">
7+
fps
8+
</message>
69
<message name="IDS_DEVTOOLS_099969ccad146161b304e766f9a1fe56" desc="Title of a setting under the Network category that can be invoked through the Command Menu">
710
Show ads on this site, if allowed
811
</message>
@@ -21,18 +24,30 @@
2124
<message name="IDS_DEVTOOLS_1e7cf45a622bb0fe494f9e4da1016982" desc="Text in Rendering Options">
2225
Layout Shift Regions
2326
</message>
27+
<message name="IDS_DEVTOOLS_22858c2062e610f015f64e2090f77f8a" desc="Command Menu search query that points to the Rendering tool">
28+
color vision deficiency
29+
</message>
2430
<message name="IDS_DEVTOOLS_2b1a578586beb46008e1542e9283ad99" desc="Checkbox title in Rendering tool">
2531
Scrolling performance issues
2632
</message>
2733
<message name="IDS_DEVTOOLS_36bec95bf12fb795a5a100251f0cc421" desc="Checkbox subtitle for 'Layer boarders' in the Rendering tool">
2834
Shows layer borders (orange/olive) and tiles (cyan).
2935
</message>
36+
<message name="IDS_DEVTOOLS_3a3d5225e008ed3017e9572ab8160815" desc="Command Menu search query that points to the Rendering tool">
37+
CSS media type
38+
</message>
39+
<message name="IDS_DEVTOOLS_4047b37213dd5663ffd2cfbfe54826b0" desc="Command Menu search query that points to the Rendering tool">
40+
vision deficiency
41+
</message>
3042
<message name="IDS_DEVTOOLS_417316246f12b8235535182cc9eebe45" desc="Accessibility subtitle for media select element in Rendering tool">
3143
Forces media type for testing print and screen styles
3244
</message>
3345
<message name="IDS_DEVTOOLS_43f244627bf87f76a0dee86f364df473" desc="Checkbox subtitle for 'Layout Shift Regions' in the Rendering tool">
3446
Highlights areas of the page (blue) that were shifted. May not be suitable for people prone to photosensitive epilepsy.
3547
</message>
48+
<message name="IDS_DEVTOOLS_508386d4665c7d3d7b4958a52e28eab1" desc="Command Menu search query that points to the Rendering tool">
49+
CSS media feature
50+
</message>
3651
<message name="IDS_DEVTOOLS_53f2f05226edcd77bd4351cb27d07ba8" desc="Text in Rendering Options">
3752
Highlights frames (red) detected to be ads.
3853
</message>
@@ -81,6 +96,12 @@
8196
<message name="IDS_DEVTOOLS_a4c766a2e6eb33e7575331b6affd9778" desc="Checkbox subtitle for 'Paint flashing' in the Rendering tool">
8297
Highlights areas of the page (green) that need to be repainted. May not be suitable for people prone to photosensitive epilepsy.
8398
</message>
99+
<message name="IDS_DEVTOOLS_c1940aeeb9693a02e28c52eb85ce261c" desc="Command Menu search query that points to the Rendering tool">
100+
paint
101+
</message>
102+
<message name="IDS_DEVTOOLS_c61404957758dfda283709e89376ab3e" desc="Command Menu search query that points to the Rendering tool">
103+
layout
104+
</message>
84105
<message name="IDS_DEVTOOLS_cb835af5f855f79e8611dd3f8fec6aac" desc="Title of an action in the inspector main tool to reload">
85106
Reload page
86107
</message>
@@ -90,4 +111,7 @@
90111
<message name="IDS_DEVTOOLS_f23c9ba06e7123f0b4c906de90fbcc9f" desc="Title of a setting under the DevTools category that can be invoked through the Command Menu">
91112
Auto-open <ph name="LOCKED_1">DevTools</ph> for popups
92113
</message>
114+
<message name="IDS_DEVTOOLS_fe904c39945840470511a9ff798e9812" desc="Accessibility subtitle for vision deficiency select element in Rendering tool">
115+
Forces vision deficiency emulation
116+
</message>
93117
</grit-part>

Diff for: resources/unpacked/devtools/front_end/inspector_main/module.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@
126126
"title": "Rendering",
127127
"persistence": "closeable",
128128
"order": 50,
129-
"className": "InspectorMain.RenderingOptionsView"
129+
"className": "InspectorMain.RenderingOptionsView",
130+
"tags": "paint, layout, fps, CSS media type, CSS media feature, vision deficiency, color vision deficiency"
130131
}
131132
],
132133
"dependencies": [

Diff for: resources/unpacked/devtools/front_end/resources/resourcesPanel.css

+1
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,5 @@
139139

140140
.resources-sidebar {
141141
padding: 0;
142+
overflow-x: auto;
142143
}

Diff for: resources/unpacked/devtools/front_end/sdk/EmulationModel.js

+13
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export class EmulationModel extends SDKModel {
5656
});
5757
this._updateCssMedia();
5858

59+
const visionDeficiencySetting = self.Common.settings.moduleSetting('emulatedVisionDeficiency');
60+
visionDeficiencySetting.addChangeListener(() => this._emulateVisionDeficiency(visionDeficiencySetting.get()));
61+
if (visionDeficiencySetting.get()) {
62+
this._emulateVisionDeficiency(visionDeficiencySetting.get());
63+
}
64+
5965
this._touchEnabled = false;
6066
this._touchMobile = false;
6167
this._customTouchEnabled = false;
@@ -140,6 +146,13 @@ export class EmulationModel extends SDKModel {
140146
}
141147
}
142148

149+
/**
150+
* @param {string} type
151+
*/
152+
_emulateVisionDeficiency(type) {
153+
this._emulationAgent.setEmulatedVisionDeficiency(type);
154+
}
155+
143156
/**
144157
* @param {number} rate
145158
*/

Diff for: resources/unpacked/devtools/front_end/sdk/module.json

+72-10
Original file line numberDiff line numberDiff line change
@@ -309,20 +309,82 @@
309309
"storageType": "session",
310310
"defaultValue": "",
311311
"options": [
312-
{
313-
"title": "Do not emulate CSS prefers-reduced-motion",
314-
"text": "No emulation",
315-
"value": ""
316-
},
317-
{
318-
"title": "Emulate CSS prefers-reduced-motion: reduce",
319-
"text": "prefers-reduced-motion: reduce",
320-
"value": "reduce"
321-
}
312+
{
313+
"title": "Do not emulate CSS prefers-reduced-motion",
314+
"text": "No emulation",
315+
"value": ""
316+
},
317+
{
318+
"title": "Emulate CSS prefers-reduced-motion: reduce",
319+
"text": "prefers-reduced-motion: reduce",
320+
"value": "reduce"
321+
}
322322
],
323323
"tags": "query",
324324
"title": "Emulate CSS media feature prefers-reduced-motion"
325325
},
326+
{
327+
"type": "setting",
328+
"category": "Rendering",
329+
"settingName": "emulatedVisionDeficiency",
330+
"settingType": "enum",
331+
"storageType": "session",
332+
"defaultValue": "",
333+
"options": [
334+
{
335+
"title": "Do not emulate any vision deficiency",
336+
"text": "No emulation",
337+
"value": "none"
338+
},
339+
{
340+
"title": "Emulate blurred vision",
341+
"text": "Blurred vision",
342+
"value": "blurredVision"
343+
},
344+
{
345+
"title": "Emulate protanopia",
346+
"text": "Protanopia",
347+
"value": "protanopia"
348+
},
349+
{
350+
"title": "Emulate protanomaly",
351+
"text": "Protanomaly",
352+
"value": "protanomaly"
353+
},
354+
{
355+
"title": "Emulate deuteranopia",
356+
"text": "Deuteranopia",
357+
"value": "deuteranopia"
358+
},
359+
{
360+
"title": "Emulate deuteranomaly",
361+
"text": "Deuteranomaly",
362+
"value": "deuteranomaly"
363+
},
364+
{
365+
"title": "Emulate tritanopia",
366+
"text": "Tritanopia",
367+
"value": "tritanopia"
368+
},
369+
{
370+
"title": "Emulate tritanomaly",
371+
"text": "Tritanomaly",
372+
"value": "tritanomaly"
373+
},
374+
{
375+
"title": "Emulate achromatopsia",
376+
"text": "Achromatopsia",
377+
"value": "achromatopsia"
378+
},
379+
{
380+
"title": "Emulate achromatomaly",
381+
"text": "Achromatomaly",
382+
"value": "achromatomaly"
383+
}
384+
],
385+
"tags": "query",
386+
"title": "Emulate vision deficiencies"
387+
},
326388
{
327389
"type": "setting",
328390
"category": "Console",

0 commit comments

Comments
 (0)