Skip to content

Removal of an orphaned "alt"#32587

Merged
infograf768 merged 1 commit intojoomla:4.0-devfrom
ahotzler:4.0-dev
Mar 6, 2021
Merged

Removal of an orphaned "alt"#32587
infograf768 merged 1 commit intojoomla:4.0-devfrom
ahotzler:4.0-dev

Conversation

@ahotzler
Copy link
Contributor

@ahotzler ahotzler commented Mar 4, 2021

Pull Request for Issue # .

Summary of Changes

Removal of an orphaned "alt"

Testing Instructions

Füge ein "Full Image" zu einem Artikel hinzu und schau Dir den HTML Code oder benutze einen Syntax-Checker

Actual result BEFORE applying this Pull Request

Error: Duplicate attribute alt.
'alt="" alt itemprop="'

Expected result AFTER applying this Pull Request

No Error while HTML Syntax Checking

Documentation Changes Required

None

@ahotzler ahotzler changed the title Removal of an orphaned "alt Removal of an orphaned "alt" Mar 4, 2021
@particthistle
Copy link
Member

I have tested this item ✅ successfully on ea3c2a0

Works correctly. Stray alt introduced in #30784 removed.

Question though for @dgrammatiko regarding the changes in #30784 that led to this.

  • https://www.w3.org/WAI/tutorials/images/decorative/ and other sources shows that all images should have an alt tag, and if it's just a decorative image, the alt tag should be alt="" for improved A11y
  • so rather than having to specify specifically "No Description" for the image, why doesn't it just default to alt="" if there's no alt text supplied? One less thing the user then has to do when adding an image.

So much looked to go on in #30784 this might have been something overlooked.

Another PR would be needed as a result to modify line 26 to change the generation of $alt and further change the implementation of $images->image_fulltext_alt_empty which then becomes redundant as the fallback will always be alt="" if there's no alt text.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32587.

@brianteeman
Copy link
Contributor

so rather than having to specify specifically "No Description" for the image, why doesn't it just default to alt="" if there's no alt text supplied? One less thing the user then has to do when adding an image.

That is absolutely the opposite of what should be done. The author must make a conscious decision if an image is decorative or not and if it is not then they must enter a suitable description.

You dont make your website accessible by simply ignoring (and therefore hiding) images.

Previously Joomla did exactly what you suggest and defaulted to alt=""

The problem with that is that its not a conscious decision and perhaps more importantly will pass any accessibility checker so you will never be prompted to fix your site and to make it accessible for all.

Responsible web design is making your content available for everyone and not, as in your suggestion, just to those with vision.

Please read https://magazine.joomla.org/all-issues/october-2020/an-image-is-worth-a-thousand-words

@brianteeman
Copy link
Contributor

In summary. If the image is not decorative and you "forget" to add an alt description then no accessibility checker will ever be able to tell you that you "forgot". Hence the bugfix

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 5, 2021

Can someone tell me what I need to do so that no height/width information is output? I have not discovered a way to do this in the backend. I then created an override, which was the reason why I looked into the code in the first place.

@dgrammatiko
Copy link
Contributor

regarding the changes in #30784 that led to this.

Actually @brianteeman initiated those changes (if you cared reading the responses on the PR you linked you would have seen it) and I think he's explained it in details also here in the above comments

I then created an override

Override is always the right answer in joomla (adding options is always the wrong one!!!)

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 5, 2021

Does this really mean that height/width is always output by default and this behavior cannot be turned off via backend? I find the size assignment with these attributes directly in the source code under aspects of the image scaling in certain constelations very obstructive, at least if I can't turn it off.

@dgrammatiko
Copy link
Contributor

dgrammatiko commented Mar 5, 2021

Does this really mean that height/width is always output by default and this behavior cannot be turned off via backend

YES, the reason is that browsers actually require the exact width and height of any image! It can be disabled by overriding OR when choosing an image deselect the lazyload checkbox (but don't do that, will affect the performance of your site).

I find the size assignment with these attributes directly in the source code under aspects of the image scaling in certain constelations

Use CSS something like this

.someClass {
  max-width: 100%;
  height: auto;
}

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 5, 2021

OR when choosing an image deselect the lazyload checkbox (but don't do that, will affect the performance of your site).

I search and search, but can't find it. Can you give me a hint where to find the lazyload checkbox?

@dgrammatiko
Copy link
Contributor

I search and search, but can't find it. Can you give me a hint where to find the lazyload checkbox?

Select a new image and check all the options before closing the Modal, it's there

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 5, 2021

No, there is no such option!

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 5, 2021

And please dont forget: We are talking about "Full Image", The image selection dialog behaves differently here than when inserting an image normally

@dgrammatiko
Copy link
Contributor

Screenshot 2021-03-05 at 10 00 54

@dgrammatiko
Copy link
Contributor

For the full image and intro image ALL the changes can be done with an override

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 5, 2021

Than the comments in the code doesnt make sense

@dgrammatiko
Copy link
Contributor

Than the comments in the code doesnt make sense

??? Context?

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 5, 2021

There is a comment:

"// Set lazyloading only for images which have width and height attributes"

It suggests that you as a user have a choice, which you don't have with "Full-Image

@dgrammatiko
Copy link
Contributor

It suggests that you as a user have a choice, which you don't have with "Full-Image

As a site visitor you get whatever was decided by the author of the site.
As an author you have the option to Override the default behaviour and do the 2010 version of an image, eg without width, height and an empty alt. If you're asking for more switches, sorry I'm the wrong guy for this, bye

@particthistle
Copy link
Member

Thanks for updating my POV on it @dgrammatiko and @brianteeman

#30874 had so much going on the discussion you're referring to I think might have been in amongst clusters of comments that GitHub closed up while I was trying to find it.

I'll go add a note to add concepts of lazyloading and the new alt text features to https://docs.joomla.org/Adding_an_image_to_an_article.

Meanwhile, another test is needed to allow this to be merged and take the excess alt out of the rendered code.

@ahotzler
Copy link
Contributor Author

ahotzler commented Mar 6, 2021

Can the PR creator, i.e. me, also test or does that violate guidelines?

@alikon
Copy link
Contributor

alikon commented Mar 6, 2021

the PR creator is supposed to have already tested it
it needs 2 other testers

@joomdonation
Copy link
Contributor

I have tested this item ✅ successfully on ea3c2a0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32587.

@infograf768
Copy link
Member

In fact we already have 2 testers.

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32587.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 6, 2021
@infograf768 infograf768 merged commit d14dcd9 into joomla:4.0-dev Mar 6, 2021
@joomla-cms-bot joomla-cms-bot added PR-4.0-dev and removed RTC This Pull Request is Ready To Commit labels Mar 6, 2021
@infograf768
Copy link
Member

Tks.

@infograf768 infograf768 added this to the Joomla 4.0 milestone Mar 6, 2021
dgrammatiko pushed a commit to dgrammatiko/joomla-cms that referenced this pull request Mar 17, 2021
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

Successfully merging this pull request may close these issues.

8 participants