Ticket #5210 (closed Bug: fixed)

Opened 6 years ago

Last modified 3 years ago

Accessibility of adjacent links

Reported by: Christophe Owned by: optilude
Priority: minor Milestone: 2.5.1
Component: Templates/CSS Version:
Keywords: newbie Cc:

Description

According to : WCAG 1.0  http://www.w3.org/TR/WCAG10/#gl-interim-accessibility

10.5 Until user agents (including assistive technologies) render adjacent links distinctly, include non-link, printable characters (surrounded by spaces) between adjacent links.

code causing error:

<div id="portal-header">

<a class="hiddenStructure" accesskey="2"

href=" http://plone.org//#documentContent">Skip to content.</a>

<a class="hiddenStructure" accesskey="6"

href=" http://plone.org//#portlet-navigation-tree">Skip to navigation</a>

Should be something like:

<div id="portal-header">

<a class="hiddenStructure" accesskey="2"

href=" http://plone.org//#documentContent">Skip to content</a> |

<a class="hiddenStructure" accesskey="6"

href=" http://plone.org//#portlet-navigation-tree">Skip to navigation</a>

or

<div id="portal-header">

<p class="hiddenStructure">

<a accesskey="2"

href=" http://plone.org//#documentContent">Skip to content</a> |

<a accesskey="6"

href=" http://plone.org//#portlet-navigation-tree">Skip to navigation</a>

</p>

Attachments

bug5210.diff Download (2.6 KB) - added by jonstahl 6 years ago.
Patch that implements the suggested fix

Change History

comment:1 Changed 6 years ago by alecm

  • Keywords newbie added; accessibility adjacent links removed

Changed 6 years ago by jonstahl

Patch that implements the suggested fix

comment:2 Changed 6 years ago by jonstahl

  • Status changed from new to assigned
  • Owner changed from somebody to jonstahl

i attached a patch that implements the second recommended fix.

comment:3 Changed 6 years ago by alecm

  • Owner changed from jonstahl to optilude
  • Status changed from assigned to new

I'd like to apply this patch, however it causes some odd test failures in testBrowserDefault.py. The problem is likely with the tests as it seems to have to do with some overly strict whitespace handling. Somebody who is more familiar with those tests and/or the ways in which template rendering produces whitespace should take a look. Assigning to optilude for now as he wrote those crazy tests.

comment:4 Changed 6 years ago by optilude

Could you please attach the test failures you get?

comment:5 Changed 6 years ago by alecm

Trivial issues, but very odd IMO:

{{{Failure in test testBrowserDefaultMixinFileViewMethodGetsTemplate (Products.CMFPlone.tests.testBrowserDefault.TestPloneToolBrowserDefault) Traceback (most recent call last):

File "/Users/alec/Development/2.9-write/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in call

testMethod()

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 171, in testBrowserDefaultMixinFileViewMethodGetsTemplate

self.compareLayoutVsView(self.portal.atctfile, path="/view")

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 71, in compareLayoutVsView

self.fail("\n".join([line for line in diff]))

File "/opt/local/lib/python2.4/unittest.py", line 301, in fail

raise self.failureException, msg

AssertionError: ---

+++

@@ -164,8 +164,7 @@

<div id="portal-header">

<p class="hiddenStructure">

  • <a accesskey="2"
  • >Skip to content.</a> |

+ <a accesskey="2" >Skip to content.</a> |

<a accesskey="6"

Skip to navigation</a>

.........

Failure in test testCallWithBrowserDefaultMixinGetsSelectedLayout (Products.CMFPlone.tests.testBrowserDefault.TestPloneToolBrowserDefault) Traceback (most recent call last):

File "/Users/alec/Development/2.9-write/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in call

testMethod()

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 160, in testCallWithBrowserDefaultMixinGetsSelectedLayout

self.compareLayoutVsView(self.portal.atctdocument, path="")

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 71, in compareLayoutVsView

self.fail("\n".join([line for line in diff]))

File "/opt/local/lib/python2.4/unittest.py", line 301, in fail

raise self.failureException, msg

AssertionError: ---

+++

@@ -164,8 +164,7 @@

<div id="portal-header">

<p class="hiddenStructure">

  • <a accesskey="2"
  • >Skip to content.</a> |

+ <a accesskey="2" >Skip to content.</a> |

<a accesskey="6"

Skip to navigation</a>

.

Failure in test testCallWithoutBrowserDefaultMixinGetsViewAction (Products.CMFPlone.tests.testBrowserDefault.TestPloneToolBrowserDefault) Traceback (most recent call last):

File "/Users/alec/Development/2.9-write/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in call

testMethod()

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 166, in testCallWithoutBrowserDefaultMixinGetsViewAction

viewaction=viewAction)

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 71, in compareLayoutVsView

self.fail("\n".join([line for line in diff]))

File "/opt/local/lib/python2.4/unittest.py", line 301, in fail

raise self.failureException, msg

AssertionError: ---

+++

@@ -164,8 +164,7 @@

<div id="portal-header">

<p class="hiddenStructure">

  • <a accesskey="2"
  • >Skip to content.</a> |

+ <a accesskey="2" >Skip to content.</a> |

<a accesskey="6"

Skip to navigation</a>

.....

Failure in test testNonBrowserDefaultMixinFileViewMethodGetsTemplateFromViewAction (Products.CMFPlone.tests.testBrowserDefault.TestPloneToolBrowserDefault) Traceback (most recent call last):

File "/Users/alec/Development/2.9-write/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in call

testMethod()

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 174, in testNonBrowserDefaultMixinFileViewMethodGetsTemplateFromViewAction

self.compareLayoutVsView(self.portal.cmffile, path="/view")

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 71, in compareLayoutVsView

self.fail("\n".join([line for line in diff]))

File "/opt/local/lib/python2.4/unittest.py", line 301, in fail

raise self.failureException, msg

AssertionError: ---

+++

@@ -164,8 +164,7 @@

<div id="portal-header">

<p class="hiddenStructure">

  • <a accesskey="2"
  • >Skip to content.</a> |

+ <a accesskey="2" >Skip to content.</a> |

<a accesskey="6"

Skip to navigation</a>

......

Failure in test testViewMethodWithBrowserDefaultMixinGetsSelectedLayout (Products.CMFPlone.tests.testBrowserDefault.TestPloneToolBrowserDefault) Traceback (most recent call last):

File "/Users/alec/Development/2.9-write/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in call

testMethod()

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 151, in testViewMethodWithBrowserDefaultMixinGetsSelectedLayout

self.compareLayoutVsView(self.portal.atctdocument, path="/view")

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 71, in compareLayoutVsView

self.fail("\n".join([line for line in diff]))

File "/opt/local/lib/python2.4/unittest.py", line 301, in fail

raise self.failureException, msg

AssertionError: ---

+++

@@ -164,8 +164,7 @@

<div id="portal-header">

<p class="hiddenStructure">

  • <a accesskey="2"
  • >Skip to content.</a> |

+ <a accesskey="2" >Skip to content.</a> |

<a accesskey="6"

Skip to navigation</a>

.

Failure in test testViewMethodWithoutBrowserDefaultMixinGetsViewAction (Products.CMFPlone.tests.testBrowserDefault.TestPloneToolBrowserDefault) Traceback (most recent call last):

File "/Users/alec/Development/2.9-write/lib/python/Testing/ZopeTestCase/profiler.py", line 98, in call

testMethod()

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 157, in testViewMethodWithoutBrowserDefaultMixinGetsViewAction

viewaction=viewAction)

File "/Users/alec/Development/2.9-write/Products/CMFPlone/tests/testBrowserDefault.py", line 71, in compareLayoutVsView

self.fail("\n".join([line for line in diff]))

File "/opt/local/lib/python2.4/unittest.py", line 301, in fail

raise self.failureException, msg

AssertionError: ---

+++

@@ -164,8 +164,7 @@

<div id="portal-header">

<p class="hiddenStructure">

  • <a accesskey="2"
  • >Skip to content.</a> |

+ <a accesskey="2" >Skip to content.</a> |

<a accesskey="6"

Skip to navigation</a>}}}

comment:6 Changed 6 years ago by alecm

Sorry about the messed up formatting, I guess I needed to put spaces after my {{{'s

comment:7 Changed 6 years ago by optilude

Those errors are strange indeed. I can't really tell why they occur. The relevant code just tries to render the page from two different sources and verifies that they are the same.

Can you fiddle the template in the diff to make it not have that whitespace? I'm afraid I don't have time to chase this right now, so perhaps you can put some print statements in testBrowserDefault and see what it's comparing?

comment:8 Changed 6 years ago by alecm

I tried my best to do so on Friday, to no avail, sorry.

comment:9 Changed 6 years ago by hannosch

  • Status changed from new to closed
  • Resolution set to fixed

(In [10391]) Enhanced accessibility of adjacent links in main_template. This fixes #5210.

comment:10 Changed 6 years ago by hannosch

  • Milestone changed from 2.5.x to 2.5.1

The test failures where most likely due to some excessive added whitespace which might have resulted in a line break in the diff viewer. The tests are a bit complicated for those two links as the line containing the href is filtered out (see those regexp's), as the base url used in those links differs in those tests... tests are working fine here now.

comment:11 Changed 3 years ago by hannosch

  • Component changed from Usability to Templates/CSS
Note: See TracTickets for help on using tickets.