Skip to content

Commit c2fd23a

Browse files
committed
squash 'resources/unpacked/devtools' changes from ef68b16..d55d486
d55d486 Fix horizontal scroll on Application tab side bar b557580 Update DevTools DEPS. 70d5eb3 Update DevTools Chromium DEPS. d33b94c Update DevTools DEPS. 892b638 Reland "Support emulating vision deficiencies" 0dce8fe Cleanup _checkWithNodeScript 50f2c19 Cleanup _CheckFormat presubmit check 251715e Remove unnecessary _CheckCSSViolations check fd873e7 Remove Sinon and associated deps git-subtree-dir: resources/unpacked/devtools git-subtree-split: d55d486
1 parent e2e8684 commit c2fd23a

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

DEPS

Lines changed: 5 additions & 5 deletions
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.

PRESUBMIT.py

Lines changed: 8 additions & 52 deletions
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, [])

front_end/inspector_main/RenderingOptions.js

Lines changed: 4 additions & 0 deletions
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
/**

front_end/inspector_main/inspector_main_strings.grdp

Lines changed: 24 additions & 0 deletions
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>

front_end/inspector_main/module.json

Lines changed: 2 additions & 1 deletion
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": [

front_end/resources/resourcesPanel.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,5 @@
139139

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

front_end/sdk/EmulationModel.js

Lines changed: 13 additions & 0 deletions
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
*/

front_end/sdk/module.json

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,20 +302,82 @@
302302
"storageType": "session",
303303
"defaultValue": "",
304304
"options": [
305-
{
306-
"title": "Do not emulate CSS prefers-reduced-motion",
307-
"text": "No emulation",
308-
"value": ""
309-
},
310-
{
311-
"title": "Emulate CSS prefers-reduced-motion: reduce",
312-
"text": "prefers-reduced-motion: reduce",
313-
"value": "reduce"
314-
}
305+
{
306+
"title": "Do not emulate CSS prefers-reduced-motion",
307+
"text": "No emulation",
308+
"value": ""
309+
},
310+
{
311+
"title": "Emulate CSS prefers-reduced-motion: reduce",
312+
"text": "prefers-reduced-motion: reduce",
313+
"value": "reduce"
314+
}
315315
],
316316
"tags": "query",
317317
"title": "Emulate CSS media feature prefers-reduced-motion"
318318
},
319+
{
320+
"type": "setting",
321+
"category": "Rendering",
322+
"settingName": "emulatedVisionDeficiency",
323+
"settingType": "enum",
324+
"storageType": "session",
325+
"defaultValue": "",
326+
"options": [
327+
{
328+
"title": "Do not emulate any vision deficiency",
329+
"text": "No emulation",
330+
"value": "none"
331+
},
332+
{
333+
"title": "Emulate blurred vision",
334+
"text": "Blurred vision",
335+
"value": "blurredVision"
336+
},
337+
{
338+
"title": "Emulate protanopia",
339+
"text": "Protanopia",
340+
"value": "protanopia"
341+
},
342+
{
343+
"title": "Emulate protanomaly",
344+
"text": "Protanomaly",
345+
"value": "protanomaly"
346+
},
347+
{
348+
"title": "Emulate deuteranopia",
349+
"text": "Deuteranopia",
350+
"value": "deuteranopia"
351+
},
352+
{
353+
"title": "Emulate deuteranomaly",
354+
"text": "Deuteranomaly",
355+
"value": "deuteranomaly"
356+
},
357+
{
358+
"title": "Emulate tritanopia",
359+
"text": "Tritanopia",
360+
"value": "tritanopia"
361+
},
362+
{
363+
"title": "Emulate tritanomaly",
364+
"text": "Tritanomaly",
365+
"value": "tritanomaly"
366+
},
367+
{
368+
"title": "Emulate achromatopsia",
369+
"text": "Achromatopsia",
370+
"value": "achromatopsia"
371+
},
372+
{
373+
"title": "Emulate achromatomaly",
374+
"text": "Achromatomaly",
375+
"value": "achromatomaly"
376+
}
377+
],
378+
"tags": "query",
379+
"title": "Emulate vision deficiencies"
380+
},
319381
{
320382
"type": "setting",
321383
"category": "Console",

0 commit comments

Comments
 (0)