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

Derive direction from document element too #956

Merged
merged 5 commits into from
May 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1139,20 +1139,21 @@ <h2>
Present a user interface that will allow the user to interact
with the |handlers|. The user agent SHOULD prioritize the user's
preference when presenting payment methods. The user interface
SHOULD be presented using the language and locale-based
formatting that matches the |document|'s [=document
element|document element's=] [=Node/language=], if any, or an
appropriate fallback locale if that is not available.
SHOULD be presented using the language, base direction, and
locale-based formatting that matches the |document|'s [=document
element|document element's=] [=Node/language=] and
{{Document/dir}} attribute, if any, or an appropriate fallback

Choose a reason for hiding this comment

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

The direction should also be at the Node level, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should, but there is no such thing on Node unfortunately:
https://dom.spec.whatwg.org/#node

The only "dir"s in the platform are:
https://respec.org/xref/?term=dir

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, wait... we might be able to use https://html.spec.whatwg.org/multipage/dom.html#the-directionality ... but I'll need to get it "exported" so we can use it in our spec.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sent whatwg/html#6676 ...

Choose a reason for hiding this comment

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

@marcoscaceres Thanks. I squinted at {{HTMLElement/dir}} and it wasn't clear to me if it included inherited direction. [^html-global/dir^] is the definition of the dir attribute and includes inheritance, but doesn't seem quite to match our needs here. Exporting directionality is a better solution--not just here but generally! I may take whatwg/html#6676 to expedite ;-).

Choose a reason for hiding this comment

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

LOL. I thought 6676 was an issue, but it's a PR...

Copy link
Member Author

@marcoscaceres marcoscaceres May 13, 2021

Choose a reason for hiding this comment

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

@aphillips, take a look at @annevk's comments at whatwg/html#6676 ... I think they make a lot of sense.

My feeling is that we punt on the direction for now, and solve this with "localizable" in a future version of the spec.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@aphillips, would that work for you?

Choose a reason for hiding this comment

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

LGTM.

@marcoscaceres I'm pondering a reply to @annevk: I think he is right, although I18N does want to promote using the document's context when it is available and is appropriate.

locale if that is not available.
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
</p>
<aside class="note" title="Localization of the payment sheet">
<p>
The API does not provide a way for developers to specify the
language in which the payment sheet is presented to end users.
As such, user agents will generally present the payment sheet
using the user agent's default language. The working group is
contemplating adding the ability for developers to specify the
language of the payment sheet, and of specific
{{PaymentItems}}, in a future version of this API.
The API does not currently provide a way for developers to
specify the language and base direction in which the payment
sheet is presented to end users. As such, user agents will
generally present the payment sheet using the user agent's
default language. Future versions of this specification may add
support for language and direction metadata via mechanism
specified in [[STRING-META]] and [[INTERNATIONAL-SPECS]].
</p>
</aside>
</li>
Expand Down