-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix Incorrect buttons labels in High Contrast mode #4436
Conversation
Add padding and space in text. Space alone doesn't give any results. But it could be helpfull for screen readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bug fix so changelog entry should not be skipped here.
Also added an empty character before shortcut, but it doesn't give any effect.
I keep this empty character, because of conversation with @Comandeer . He says that it's better for readers - to see separate words.
The space doesn't have any effect since it's a space on the beginning/end of an inline-block
element and is trimmed by the browser.
Added
padding
left for shortcut descriptionspan
element in High Contrast Mode.
Added this inmoono
,moono-lisa
andkama
.
I'm not sure if this is the best approach for this issue since:
- There are more skins available and it won't work for them.
- Adding spacing with padding is fine for layout purposes. Here, I have some difficulties deciding if we should treat it as layouting or just text formatting - if the later, using padding looks like not a valid approach.
Based on the above we could simply use non breaking space here (
) which will be preserved and rendered correctly and also is handled same as space by screen readers AFAIR (cc @Comandeer?).
Also it could be added directly in the template (instead of ariaShortcut
label) because it is specific for this one usage (and ariaShortcut
could be reused somewhere else).
I revert a previous proposal. I added As I check with JAWS in FF - the reader doesn't read the second Also, add a changelog entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
@sculpt0r could you add manual test here (which forces CKEDITOR.env.hc=true
so it can be easily tested on all OSes)?
I added the manual test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
That's interesting in fact how to force HC mode. Normally, it would be quite easy - one can listen to CKEDITOR.loaded
event which is fired right after HC detection logic or even better - force same color for div
borders to trick our detection mechanism.
However... all this logic (from _bootstrap.js
) is done before bender loads any manual tests content - this means it's not possible to alter the above with anything placed in manual test files. And there is no other place in fact to hook into without modifying bender or CKEditor 4 files.
Still it can be done a little more elegant than it was proposed with:
CKEDITOR.on( 'instanceCreated', function( evt ) {
CKEDITOR.env.hc = true;
CKEDITOR.env.cssClass += ' cke_hc';
} );
as this code is executed before plugins code. Also CKEDITOR.env.hc
should be correctly overwritten because some stuff in plugins code depends on it too.
Add padding and space in text.
Space alone doesn't give any results. But it could be helpfull for screen readers.
What is the purpose of this pull request?
Bug fix
Does your PR contain necessary tests?
All patches that change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
Did you follow the CKEditor 4 code style guide?
Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.
What is the proposed changelog entry for this pull request?
What changes did you make?
Give an overview…
Added
padding
left for shortcut descriptionspan
element in High Contrast Mode.Added this in
moono
,moono-lisa
andkama
.Also added an empty character before shortcut, but it doesn't give any effect.
I keep this empty character, because of conversation with @Comandeer . He says that it's better for readers - to see separate words.
Which issues does your PR resolve?
Closes #4422.