-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-viewport-1] Add automation support for viewport segments #11137
base: main
Are you sure you want to change the base?
Conversation
9f414a0
to
a58630b
Compare
I don’t think I am the right person to co-review this. I would assume the authors of the https://w3c.github.io/webdriver/ spec are the people you are looking for. |
@OrKoN would you be able to review this please? The approach is modeled after Compute Pressure, Device Posture and Generic Sensor. |
Thanks for the ping, let me try to review it:
|
|
Yes, usually https://github.com/w3c/spec-prod is used to publish a preview but looks like it is not set up in this repo.
I assume it works the same way (it is also Bikeshed-based), in a non-normative section, with files being put to a folder. Note that I am not saying it is required.
Probably I made an assumption that is not correct. If this command is only meant to override the segments getter available to the page, the current steps look sufficient. Or does the command imply a way to emulate the viewport with segments visually? Is the command expected to also trigger relevant Screen Orientation, Window Resize or Posture change events mentioned in the spec or any other events? And to confirm the DOM attribute cannot be overriden from JavaScript for testing? |
Yes, I'm not entirely sure why. I'm not really a regular contributor to the CSS WG. I just happen to work on adding the viewport segments functionality.
I meant more the fact that the BIDI spec doesn't really cover the concepts but just defines the commands. For me it felt natural to have the Automation story sit next to the property it covers. Also the viewport segments concept goes hand in hand with the Device Posture API and we have dedicated commands for the Device Posture API. I don't have a strong opinion.
This is correct. Please note that the entire viewport segments concept also defines MQs and env variables which will also be invalidated and recalculated. After this patch lands, I was planning to reference this addition on the MQ spec and CSS variable spec to cover the [DisplayFeaturesOverride] case.
Screen orientation, Window Resize and posture change are not expected to change when the internal slot is set.
The |
That sounds good.The PR looks good to me % minor comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I intend to do something similar to https://github.com/web-platform-tests/wpt/tree/master/device-posture and add tests to verify the |
It would be also nice to add WebDriver-specific tests to test error conditions, wrong input, some happy path cases. Some browsers might not actually implement testdriver.js using WebDriver so it is also a good indication for external users for the level of support in the corresponding driver. |
I can investigate that. |
This commits define ways to emulate display features of a device. A display feature is a hardware feature that acts as a divider and creates logically separate regions of the viewport. Using WebDriver developers and user agents will have the opportunity to test or emulate several types of devices.
a58630b
to
bc97df6
Compare
I will still need a reviewer like @emilio to approve and merge this change. Thank you! |
Is there a precedent to put these kind of spec text inside the CSS spec? I haven't seen it before... cc @fantasai @tabatkins |
I have not seen a precedent with CSS specs but here other specs defining WebDriver extension commands https://dontcallmedom.github.io/webdex/e.html#extension%20commands%40%40webdriver%25%25dfn (not sure if the tool omits some specs) |
WebAuth, Device Posture, Compute Pressure, Generic Sensors, Web Bluetooth for example define the automation/testing story in their respective specs. Some specs like WebUSB are defining them into a dedicated spec, some specs into an explainer like WebXR. So, I don't think there is a W3C guidance around that. |
This commits define ways to emulate display features of a device. A display feature is a hardware feature that acts as a divider and creates logically separate regions of the viewport.
Using WebDriver developers and user agents will have the opportunity to test or emulate several types of devices.