Skip to content

[css-viewport] Add the segments property (#9237). - #10564

Merged
emilio merged 1 commit into
w3c:mainfrom
darktears:segments
Aug 19, 2024
Merged

[css-viewport] Add the segments property (#9237).#10564
emilio merged 1 commit into
w3c:mainfrom
darktears:segments

Conversation

@darktears

Copy link
Copy Markdown
Contributor

This property exposes in JavaScript what is already exposed to CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: here

Fixes #9237.

@darktears

Copy link
Copy Markdown
Contributor Author

I folded part of the reverted #10548 into this.

Comment thread css-viewport/Overview.bs Outdated
Comment thread css-viewport/Overview.bs Outdated
Comment thread css-viewport/Overview.bs Outdated
Comment thread css-viewport/Overview.bs
Comment thread css-viewport/Overview.bs Outdated
Comment thread css-viewport/Overview.bs
Comment thread css-viewport/Overview.bs Outdated
@darktears
darktears force-pushed the segments branch 3 times, most recently from 7ab8a60 to 7b4acf9 Compare July 16, 2024 14:21
@darktears

Copy link
Copy Markdown
Contributor Author

@emilio I'd love your review please.

Comment thread css-viewport-1/Overview.bs Outdated
Comment thread css-viewport-1/Overview.bs Outdated
@darktears

Copy link
Copy Markdown
Contributor Author

@emilio added your suggestions.

@darktears

Copy link
Copy Markdown
Contributor Author

@emilio your review is appreciated.

Comment thread css-viewport-1/Overview.bs Outdated
Comment thread css-viewport-1/Overview.bs
@bramus

bramus commented Aug 19, 2024

Copy link
Copy Markdown
Contributor

Left some comments looking at this from an author’s POV. Could be I missed some earlier discussion that explains why things are specced the way it currently is (I was OOO for 4 weeks).

Comment thread css-viewport-1/Overview.bs
Comment thread css-viewport-1/Overview.bs Outdated
@darktears

Copy link
Copy Markdown
Contributor Author

@emilio resolved your comments

@emilio emilio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread css-viewport-1/Overview.bs Outdated
</h2>

The {{segments}} property is an array of {{DOMRect}} that represent the dimensions of each existing viewport segment.
Each {{DOMRect}} contains the geometry of the segment (x, y, width, height) in ''<length>/px''.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth pointing out that they are CSS pixels, not device pixels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of the last change?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFM, we can always clarify in follow-ups as needed.

This property exposes in JavaScript what is already exposed to
CSS via env() variables.

TAG review w3ctag/design-reviews#689.

CSSWG Approval: w3c#9237#issuecomment-2160730855

Fixes w3c#9237.
@emilio
emilio merged commit 2be3d9a into w3c:main Aug 19, 2024
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 20, 2024
… property

from window.visualViewport to the newly added window.viewport.

See w3c/csswg-drafts#9237 (comment)
for the full IRC log of the conversation.

w3c/csswg-drafts#10564 is the PR adding the segments
property part of the CSS Viewport Level 1 specification.

There is no functional changes in how the segments property works, tests
are updated to reflect the new position.

Right now the viewport object is tied to the runtime flag of
Viewport Segments because we expect the feature to ship before
the viewport attribute receive more fields.

Bug: 40113439
Change-Id: Ic0624314ee4300899e9e6e98f009e0b4f1fe9655
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 20, 2024
… property

from window.visualViewport to the newly added window.viewport.

See w3c/csswg-drafts#9237 (comment)
for the full IRC log of the conversation.

w3c/csswg-drafts#10564 is the PR adding the segments
property part of the CSS Viewport Level 1 specification.

There is no functional changes in how the segments property works, tests
are updated to reflect the new position.

Right now the viewport object is tied to the runtime flag of
Viewport Segments because we expect the feature to ship before
the viewport attribute receive more fields.

Bug: 40113439
Change-Id: Ic0624314ee4300899e9e6e98f009e0b4f1fe9655
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5783999
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344484}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 21, 2024
… property

from window.visualViewport to the newly added window.viewport.

See w3c/csswg-drafts#9237 (comment)
for the full IRC log of the conversation.

w3c/csswg-drafts#10564 is the PR adding the segments
property part of the CSS Viewport Level 1 specification.

There is no functional changes in how the segments property works, tests
are updated to reflect the new position.

Right now the viewport object is tied to the runtime flag of
Viewport Segments because we expect the feature to ship before
the viewport attribute receive more fields.

Bug: 40113439
Change-Id: Ic0624314ee4300899e9e6e98f009e0b4f1fe9655
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5783999
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344484}
Westbrook pushed a commit to Westbrook/wpt that referenced this pull request Aug 21, 2024
… property

from window.visualViewport to the newly added window.viewport.

See w3c/csswg-drafts#9237 (comment)
for the full IRC log of the conversation.

w3c/csswg-drafts#10564 is the PR adding the segments
property part of the CSS Viewport Level 1 specification.

There is no functional changes in how the segments property works, tests
are updated to reflect the new position.

Right now the viewport object is tied to the runtime flag of
Viewport Segments because we expect the feature to ship before
the viewport attribute receive more fields.

Bug: 40113439
Change-Id: Ic0624314ee4300899e9e6e98f009e0b4f1fe9655
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5783999
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344484}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 22, 2024
…n move the JavaScript segment property from window.visualViewport to the newly added window.viewport., a=testonly

Automatic update from web-platform-tests
[Viewport Segments] Per CSS WG resolution move the JavaScript segment property
from window.visualViewport to the newly added window.viewport.

See w3c/csswg-drafts#9237 (comment)
for the full IRC log of the conversation.

w3c/csswg-drafts#10564 is the PR adding the segments
property part of the CSS Viewport Level 1 specification.

There is no functional changes in how the segments property works, tests
are updated to reflect the new position.

Right now the viewport object is tied to the runtime flag of
Viewport Segments because we expect the feature to ship before
the viewport attribute receive more fields.

Bug: 40113439
Change-Id: Ic0624314ee4300899e9e6e98f009e0b4f1fe9655
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5783999
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344484}

--

wpt-commits: 9f659d69e19db662afbe89a0b9d056eb1c5fa0f4
wpt-pr: 47696
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…n move the JavaScript segment property from window.visualViewport to the newly added window.viewport., a=testonly

Automatic update from web-platform-tests
[Viewport Segments] Per CSS WG resolution move the JavaScript segment property
from window.visualViewport to the newly added window.viewport.

See w3c/csswg-drafts#9237 (comment)
for the full IRC log of the conversation.

w3c/csswg-drafts#10564 is the PR adding the segments
property part of the CSS Viewport Level 1 specification.

There is no functional changes in how the segments property works, tests
are updated to reflect the new position.

Right now the viewport object is tied to the runtime flag of
Viewport Segments because we expect the feature to ship before
the viewport attribute receive more fields.

Bug: 40113439
Change-Id: Ic0624314ee4300899e9e6e98f009e0b4f1fe9655
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5783999
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344484}

--

wpt-commits: 9f659d69e19db662afbe89a0b9d056eb1c5fa0f4
wpt-pr: 47696
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[css-viewport-1] Bring the segments property into viewport

4 participants