Ticket #5210 (closed Bug: fixed)
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
Change History
Changed 6 years ago by jonstahl
-
attachment
bug5210.diff
added
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: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: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.
