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

There should be a way to distinguish between left-justifying content and left-aligning content #68

Closed
whsieh opened this issue Aug 25, 2017 · 8 comments

Comments

@whsieh
Copy link

whsieh commented Aug 25, 2017

On the newer touch bar MacBooks, there is UI for formatting rich text to be left-aligned, center-aligned, right-aligned, and justified; these apply text-align: {left|center|right|align} styles to the current selection. The current spec (link: https://w3c.github.io/input-events/index.html) enumerates "formatJustifyCenter", "formatJustifyRight" and "formatJustifyLeft" input types.

Is there any way in the current input events spec to distinguish between selecting a formatting option that justifies text, versus a formatting option that left-aligns text without justifying? It seems like we might benefit from having "formatAlign{Left|Center|Right}" input types, and a "formatJustify" input type for UI that just applies justified format (respecting LTR/RTL text direction).

touch-bar-formatting-options

(corresponding WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=168669)

@whsieh
Copy link
Author

whsieh commented Aug 25, 2017

@choniong @johanneswilm

@johanneswilm
Copy link
Contributor

Also in this case I believe it is something only Safari has and it can therefore still be changed. I will update the draft spec later today and I will put it on the agenda for the next call, so we can reverse the change in case it is being used somewhere else by now.

@johanneswilm
Copy link
Contributor

johanneswilm commented Aug 25, 2017

Or does Chrome's touchbar support also include support for the text formatting operations by now? In that case it will be more difficult to fix any of the types that were Safari-only until now. @choniong @whsieh

@johanneswilm
Copy link
Contributor

@whsieh I have tested Chrome and Safari on Mac OS X, and it looks like Chrome doesn't use the touchbar for operations related to contenteditable nor input, nor can I find any keyboard shortcuts to do so.

On Safari, the block-justify button emits an "formatJustifyLeft" beforeinput event, and that is clearly incorrect. Also, it looks like that button stays highlighted if the caret is inside justified content, which probably creates an entirely new category of issues because the highlighting will probably not work if the JS editor uses different markup to make the text be block justified.

As for naming: On various pages on the net I find "left justify" described as being synonymous with "left align" or "flush left" [1]. The term we have chosen here is maybe not the most common, but it seems to be correct. @whsieh Is ti really necessary to change the vocabulary for left and right justify, or would it be enough to add a "formatJustifyFull"?

[1] http://www.webopedia.com/TERM/L/left_justify.html
[2] https://www.collinsdictionary.com/dictionary/english/left-justify

@whsieh
Copy link
Author

whsieh commented Aug 25, 2017

@johanneswilm I see — if "{left|center|right} justification" is synonymous with "{left|center|right} alignment" in most contexts, then adding a new formatJustifyFull input type and having the justification formatting button (the rightmost button on the touch bar) emit this new input type sounds good to me.

@johanneswilm
Copy link
Contributor

Perfect. Thatwe can just add as it won't affect anything else.

@johanneswilm
Copy link
Contributor

approved by today's editing taskforce call, fixed in 95b1b48

@johanneswilm
Copy link
Contributor

level 1 fix in 88bb8ac

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

No branches or pull requests

2 participants