Skip to content
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

Update dom-focus to specify the inline and block arguments to scroll a target into view #9527

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

dlrobertson
Copy link
Member

@dlrobertson dlrobertson commented Jul 17, 2023

Summary

  • All browsers currently use "center" for both inline and block (after bug 1842679). Update the definition of dom-focus to explicitly specify this. In addition, some web-platform-tests are written in a way that expects Element.focus() to focus an element to a certain scroll position.
  • Update usage of #scroll-an-element-into-view to scroll-a-target-into-view.

Checklist

FIxes: #9518


/browsing-the-web.html ( diff )
/canvas.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )

The "scroll an element into view definition" to "scroll a target into
view"
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

Nice work, thanks! We can count on this having multi-implementer interest since it just specifies what people are already doing.

set to an <span>implementation-defined</span> value.</p></li>
<var>options</var> is false, then <span data-x="scroll a target into view">scroll the element
into view</span> with <var>behavior</var> set to "auto", <var>block</var> set to "center", and
<var>inline</var> set to "center".</p></li>
Copy link
Member

Choose a reason for hiding this comment

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

While you're here you could update this to modern style, which would be given "auto", "center", and "center". (Since the algorithm is not declared with named parameters.)

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 good point

Remove the implementation defined behavior in the definition of the
block and inline arguments passed to scroll a target into view.

Fixes: whatwg#9518
@dlrobertson
Copy link
Member Author

Thanks for the feedback! Updated to use positional parameters

@domenic domenic merged commit 3f59ce2 into whatwg:main Jul 19, 2023
2 checks passed
domenic pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 19, 2023
@dlrobertson dlrobertson deleted the dom-focus branch July 19, 2023 10:58
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 22, 2023
…element., a=testonly

Automatic update from web-platform-tests
Test that element.focus() centers the element

Follows whatwg/html#9527.
--

wpt-commits: 58c50ca94c3cdfd1932352df691ee632fed20145
wpt-pr: 41029
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jul 24, 2023
…element., a=testonly

Automatic update from web-platform-tests
Test that element.focus() centers the element

Follows whatwg/html#9527.
--

wpt-commits: 58c50ca94c3cdfd1932352df691ee632fed20145
wpt-pr: 41029

UltraBlame original commit: ebcfbf73b81b0a8f2ebba07509f092700c9c690b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jul 24, 2023
…element., a=testonly

Automatic update from web-platform-tests
Test that element.focus() centers the element

Follows whatwg/html#9527.
--

wpt-commits: 58c50ca94c3cdfd1932352df691ee632fed20145
wpt-pr: 41029

UltraBlame original commit: ebcfbf73b81b0a8f2ebba07509f092700c9c690b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jul 24, 2023
…element., a=testonly

Automatic update from web-platform-tests
Test that element.focus() centers the element

Follows whatwg/html#9527.
--

wpt-commits: 58c50ca94c3cdfd1932352df691ee632fed20145
wpt-pr: 41029

UltraBlame original commit: ebcfbf73b81b0a8f2ebba07509f092700c9c690b
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this pull request Jul 24, 2023
…element., a=testonly

Automatic update from web-platform-tests
Test that element.focus() centers the element

Follows whatwg/html#9527.
--

wpt-commits: 58c50ca94c3cdfd1932352df691ee632fed20145
wpt-pr: 41029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Define the block flow and inline base directions for dom-focus
2 participants