TinyMCE recommend that for accessibility purposes content_css needs to be set to false so that any system colour settings (Operating System level) override any existing styles.

*sorry first real issue and patch, so I'm hear to learn not be burned down please...

Comments

waako’s picture

This should patch it, option is called "accessible"

waako’s picture

Status: Active » Needs review

oups need to set needs review, sorry!

Everett Zufelt’s picture

@waako

I haven't taken a look at your patch. Can you please explain what exactly the problem is, and what your patch does in order to solve the problem?

If this allows for a TinyMCE setting to be modified in the WYSIWYG profile UI can you please provie a link to the TinyMCE documentation where this setting is documented?

waako’s picture

Hi Everett,
Sorry I obviously didn't make anything, or even explain. I was trying to get out to the pub as quick as possible.

When you download TinyMCE, amongst the examples is the accessible.html and in that the content_css = false
That option doesn't currently exist in the tinyMCE settings in the Wysiwyg module.
This option allows the operating system to override any styles for the editor window.
Strangely enough it is not documented in the content_css page on moxiecode website, however client emailed them concerning this issue and were told to set content_css = false.

All I've done is add that to the TinyMCE.inc file and add an "accessible" option to the wysiwyg profile settings page.

I hope it's alright and helps some people, I'm sure it needs some tweaking or changes though.

Everett Zufelt’s picture

Title: Editor CSS to ensure Accessibility of TinyMCE » Expose content_css setting for improved TinyMCE accessibility
Assigned: waako » Unassigned
Priority: Major » Normal

Changing title

twod’s picture

Status: Needs review » Closed (duplicate)

First, the patch is based either on a really old version of Wysiwyg and/or the wrong branch.

Second, all it does is set TinyMCE's content_css to false, which in essence means don't load any CSS into the editor. If you need this you probably need to tweak other settings as well - like those mentioned on the examples page, so you might as well set them all by implementing hook_wysiwyg_editor_settings_alter().

Third, the new "Accessibility" option will be unrecognized by all the other implementations of our supported editors.

We aim to provide better per-editor customization to the profile GUI in: #313497: Allow configuration of advanced editor settings. Once that is taken care of, tweaking these settings should be possible via the GUI.

waako’s picture

It was based on version 7.x-2.0, sorry I stupidly didn't check the project I was involved in had the latest Wysiwyg version.

Yes, all it does is set content_css to false, I thought I made that clear above, I'm sorry if I didn't. The feedback from TinyMCE was that for accessibility, as reviewed by the Shaw Trust and others is simply that content_css be set to false, allowing the editor to pass AAA accessibilty validation.
Currently there is no option to set content_css to false, and this has been raised as a serious accessibility issue.

But I agree that as in the example there seems no reason why the other options in accessible.html example should not be also set.
I understand that this module aims to be generic accross all supported editors, I admittedly was only looking at TinyMCE in this instance.

So should I be looking at hook_wysiwyg_editor_settings_alter() in order to apply content_css to false and other settings?

I'm sorry, I was just trying to help ensure that the main wysiwyg editor in Drupal was capable of being made as accessible as possible, maybe next time I should just raise a ticket to point out this issue and let the developers who know the module actually integrate it or at least read up more, rather than giving it a go myself.

twod’s picture

No problem, I did not mean to sound offensive so I'm sorry if it felt that way.

A simple implementation of the hook with some of the mentioned settings would look something like this:

function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
 if ($context->profile['editor'] == 'tinymce') {
  $settings['content_css'] = FALSE;
  $settings['use_native_selects'] = TRUE;
 }
}

I love to see people contributing patches, so please don't stop doing that! ;)

waako’s picture

Hey, thank you TwoD for the example, very useful!

I'll definitely look at that. Thank you for running someone like me through it!!