Summary: | Use svg:title, not svg:desc for XHTML img alt attribute [accessibility] | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Christophe Strobbe <c_strobbe-fdo> |
Component: | Writer | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | c_strobbe-fdo, detective.conan.1412, rb.henschel, robinson.libreoffice, v_2e |
Priority: | medium | Keywords: | difficultyBeginner, easyHack |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Attachments: |
ODF test file with three images, one with only title, one with only description, one with both
Export of the test file to XHTML Patch as unified diff file Patch generated with git diff. |
Description
Christophe Strobbe
2011-07-26 09:40:34 UTC
Please attach the original odt-file. I get nothing, which fit to your description. If I insert an image, I get an img-Element and nothing with svg. If I insert a drawing object, for example a rectangle, in an odt-document, I get no element in xhtml at all. Are you sure, you are exporting to XHTML? Or do you save as HTML? In case of an image, the xhtml-text is indeed wrong. The alternative text in LO (given in the picture property dialog in the tab 'Option') should go to the alt-attribute, the title in LO should go to the title-attribute and the description in LO should go to a longdesc-attribute in xhtml. Created attachment 49607 [details]
ODF test file with three images, one with only title, one with only description, one with both
(In reply to comment #1) > Please attach the original odt-file. I get nothing, which fit to your > description. If I insert an image, I get an img-Element and nothing with svg. > If I insert a drawing object, for example a rectangle, in an odt-document, I > get no element in xhtml at all. When you create an ODT file following the procedure I described, the image is wrapped in a <draw:frame> element which contains: * a <draw:image> element for the image itself, * a <svg:title> element if the image has been given a title, * a <svg:desc> element if the image has been given a description. To verify this, unpack the ODT-file with an unzip utility, and view the file 'content.xml' in a source code editor. > > Are you sure, you are exporting to XHTML? Or do you save as HTML? In Writer, I went to File > Export...; in the Export dialog I chose the option "XHTML (.html,xhtml)". (When you choose File > Save as... and select "HTML Document (OpenOffice.org Writer) (.html)" in the Save As dialog, you get a different output, and <svg:title> is converted to the alt attribute of the img element. However, this bug is about the XHTML export.) > > In case of an image, the xhtml-text is indeed wrong. The alternative text > in LO > (given in the picture property dialog in the tab 'Option') should go to the > alt-attribute, the title in LO should go to the title-attribute and the > description in LO should go to a longdesc-attribute in xhtml. This is not correct: * <svg:title> should go to the alt attribute (consult the ODF and HTML specifications); * <svg:desc> cannot go to the longdesc attribute because the longdesc attribute must contain a URL or a fragment identifier, not plain text (so the content of <svg:desc> should go in a separate file or to a separate section in the same HTML file, the longdesc would then point to it) * the title attribute in HTML is not read by screen readers; it is not used for accessible text alternatives. PS: The alternative text in the 'Option' tab for an image is the same text as the Title in the Description dialog. Created attachment 49616 [details]
Export of the test file to XHTML
The attached file is the result of my export to XHTML. There is nothing with "svg". I have used LO3.4.2RC1 on WinXP.
(In reply to comment #4) > Created an attachment (id=49616) [details] > Export of the test file to XHTML > > The attached file is the result of my export to XHTML. There is nothing with > "svg". I have used LO3.4.2RC1 on WinXP. Indeed, there is no <svg:xxx> in the OUTPUT. I never made that claim. The issue is that <svg:title> in the INPUT (the content.xml that you can extract from ODF with an unzip tool) is not converted to img/@alt in the output. In other words: * the current XHTML export converts <svg:desc> from the INPUT into img/@alt in the OUTPUT, * the XHTML export should convert <svg:title> from the INPUT into img/@alt in the OUTPUT. Created attachment 49870 [details]
Patch as unified diff file
Patch for body.xsl as discussed in the original post. Changes just three lines.
Christophe, could you please send your patch, generated from git format-patch, to the developer mailing list instead? For the instruction, see http://wiki.documentfoundation.org/Development#Preparing_patches Thanks! Created attachment 49917 [details]
Patch generated with git diff.
Added a patch generated with git diff. This patch has been sent to the developer mailing list.
Shouldn't this problem be marked as resolved? As I see there is already a patch for it. I don't know the exact process. I assume the patch should be accepted before the bug is closed, and I have not received news about acceptance of the patch (although that should be trivial). fixed for 3.5 http://cgit.freedesktop.org/libreoffice/core/commit/?id=2eb2e571abdbfe143ba738a0dec0a4b73de7827c Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner) [NinjaEdit] |