HTML and CSS Reference
In-Depth Information
9.3.2.1 How to Avoid
Check the required markup using script before applying a given feature. It is par-
ticularly important to verify that the complete structure required is available when
initializing widgets, so we don't accidentally start initializing a widget only to abort
halfway because of unexpected changes in the document structure, effectively leav-
ing the user with a broken page.
9.3.3 Don't Assume All Users Are Created Equal
Reaching a wide audience means meeting a lot of different needs. The web content
accessibility guidelines (WCAG) instruct us not to tie functionality to a single input
mechanism, such as the mouse. Triggering functionality using the mouseover
event effectively removes the feature for users unable to handle a mouse, or handle
it well enough . Besides, mouseover doesn't make any sense on touch devices, which
are becoming increasingly popular.
9.3.3.1 How to Avoid
WCAG advices to use redundant input methods, i.e., provide keyboard alternatives
for mouse-specific events. This is a good piece of advice, but there is more to
keyboard accessibility than adding a focus event handler with every mouseover
event handler (not even possible on some elements). Ultimately, the only way to
create truly keyboard accessible websites is to test, test, and test. Ideally, those tests
are carried out by actual users, both the mouse, keyboard, and possibly even the
touch inclined.
9.3.4 Don't Assume Support
Never use features that may not be available; test for the existence of features before
using them. This is also known as feature detection or feature testing, and we will
deal with it in more detail in Chapter 10, Feature Detection.
9.4 When Do the Rules Apply?
Although most of the principles presented in this chapter are general characteristics
of solid craftsmanship, some rules can be challenging in given cases. For instance, a
JavaScript intense application such as Gmail could prove difficult to develop using
progressive enhancement. Gmail has solved this problem by providing a scriptless
environment completely detached from its main interface. This solution certainly
 
 
Search WWH ::




Custom Search