diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-10-30 12:54:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-30 11:54:13 +0000 |
commit | 850e59f98ec49dfc72ea9b71f8db7b6292f28d12 (patch) | |
tree | 1e4468913f53c073f58374e3b0a2763077ab025f /etc/start_servo.py | |
parent | d877962ee8a5003b0a6eec9fb3d16f1b759a9f9e (diff) | |
download | servo-850e59f98ec49dfc72ea9b71f8db7b6292f28d12.tar.gz servo-850e59f98ec49dfc72ea9b71f8db7b6292f28d12.zip |
servoshell: Allow overriding screen resolution with a command-line argument (#34038)
There is a command-line argument to override the default window size,
but not one for overriding the default screen resolution. This is
important for testing pages that use screen size to have different
behavior.
In addition to adding the new option this change:
- Renames the `--resolution` command-line argument to `--window-size`
to remove ambiguity with the `--screen-size` argument.
- Passes the screen size as device independent (device pixels scaled by
HiDPI factor) to Servo internals. Not only it make it simpler to pass
the `--window-size` override, it makes more sense. Different screens
can have different HiDPI factors and these can be different from the
scale of the window. This makes the screen HiDPI factor totally
independent of the one that Servo uses for the window.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'etc/start_servo.py')
-rw-r--r-- | etc/start_servo.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/start_servo.py b/etc/start_servo.py index a3815e0dc1a..5c241f4300a 100644 --- a/etc/start_servo.py +++ b/etc/start_servo.py @@ -18,7 +18,7 @@ import subprocess def start_servo(port, resolution): # Use the below command if you are running this script on windows - # cmds = 'mach.bat run --webdriver ' + port + ' --resolution ' + resolution - cmds = './mach run --webdriver=' + port + ' --resolution ' + resolution + # cmds = 'mach.bat run --webdriver ' + port + ' --window-size ' + resolution + cmds = './mach run --webdriver=' + port + ' --window-size ' + resolution process = subprocess.Popen(cmds, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return process |