Skip to content

Add dir global attribute feature - #4533

Merged
ddbeck merged 2 commits into
web-platform-dx:mainfrom
xfq:html-dir
Oct 21, 2026
Merged

ddbeck merged 2 commits into
web-platform-dx:mainfrom
xfq:html-dir

Conversation

@xfq

@xfq xfq commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the feature definition Creating or defining new features or groups of features. label Oct 15, 2026

@ddbeck ddbeck 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.

Thank you for opening this PR, @xfq. A few optional suggestions, before we merge this. Thank you!

Comment thread features/dir.yml Outdated
Comment thread features/dir.yml
description: The `dir` global HTML attribute sets an element's text direction to left to right (`ltr`) or right to left (`rtl`), or determines it from the content (`auto`). Elements generally inherit their parent's direction when the attribute is omitted.
spec: https://html.spec.whatwg.org/multipage/dom.html#the-dir-attribute
compat_features:
- html.global_attributes.dir

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.

It would be nice to bring over the API from the dom feature. This suggestion would add the key, but it would still need to be dropped from the other feature. (Run npm run undist -- features/dom.yml first, to make that list editable.)

(If this is too much hassle, let me know and I can open a follow up PR.)

Suggested change
- html.global_attributes.dir
- api.HTMLElement.dir
- html.global_attributes.dir

Comment thread features/dir.yml.dist
Comment on lines +6 to +7
baseline_low_date: ≤2017-04-05
baseline_high_date: ≤2019-10-05

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.

The uncertainty in the data here is a little bit annoying, so I sent mdn/browser-compat-data#30915 upstream to resolve it. It's not a blocker, though.

@xfq

xfq commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thank you!

@ddbeck ddbeck 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.

Thank you!

@ddbeck
ddbeck merged commit a1e9894 into web-platform-dx:main Oct 21, 2026
3 checks passed
@ddbeck ddbeck changed the title Add dir global attribute Add dir global attribute feature Oct 21, 2026
@xfq
xfq deleted the html-dir branch October 22, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants