Context Menus and Focus in Opera
July 17, 2008 at 4:46 pm by Todd Kloots | In Accessibility, Design, Development | As a JavaScript toolkit developer, there are two features lacking in Opera that have frustrated me for a while: support for the contextmenu DOM event and the ability to override the default rendering of focus via CSS. When Opera released version 9.5, I was disappointed to see that neither of these features were implemented. As frontend engineers, we spend a lot of time responding to decisions made by browser manufacturers, but we don’t get much opportunity to learn the specific thought process behind those decisions. After exchanging some emails with the Opera team, I now have some insight into their decisions and the perspective that perhaps withholding such features could be beneficial to the user.
Background
Although the capabilities of the browser have evolved significantly in recent years, the user’s perception of the browser hasn’t necessarily evolved with it. After the launch of Yahoo! Photos 3.0, I remember a friend of mine emailing me because she was having trouble viewing the large version of her photos. She was repeatedly clicking on each thumbnail without success. Eventually she figured out that she needed to double click on the thumbnails to view the full size image. Double clicking to open a folder or a file is, of course, a natural interaction on the desktop, but for years users were trained not to expect this interaction in the context of web applications.
Some users still don’t expect desktop-like interaction from web applications. I remember logging into my Yahoo! Mail not long ago and seeing checkboxes next to each message. I paused. What were these checkboxes, these artifacts of Web 1.0, doing in my Web 2.0 application? I had been using the new DHTML, Outlook-like version of Yahoo! Mail since its early beta and had become used to dragging and dropping in order to move and delete messages. But the reappearance of these checkboxes was another sign that not every user’s expectations had evolved with the capabilities of the browser.
As the browser has matured it has evolved it into a platform for rich application development, making it possible to deliver applications with a level of interactivity and visual fidelity of those found on the desktop. And while the browser is now a platform, it also continues to play its original Web 1.0 role of an application, a content viewer that enables users to surf all of the news sites, blogs, etc. scattered across the eclectic Web. But as the browser now plays these dual roles of being an application and an application development and delivery platform, how does this duality impact the user in terms of usability and accessibility? And what user-centric features and functionality can consumers expect of a browser, especially one battling with duality? I suspect that Opera’s answer to these questions is that not all users understand the modern browser’s dual role, and that is it necessary to render some fundamental things consistently across experiences within the browser.
Context Menus
Consider context menu functionality. By not implementing the contextmenu event, Opera does not allow frontend engineers to override the
default context menu provided by the browser; all other A-Grade browsers support this feature. What benefit could there be to not implementing the contextmenu event?
If some users perceive everything inside the scope of the browser as a web page, that influences the user’s expectation of what functionality will be surfaced in a context menu. Over the years many users have come to expect that raising a context menu in the scope of a browser will surface browser-centric functionality relative to HTML content (i.e. “Open Link in New Window”), rather than functionality of the web application running within the browser. Therefore, providing a custom context menu for a web application might not be expected or seen as helpful for users who have come to rely on functionality in the browser’s context menu.
The downside is that, by not allowing the developer to provide custom context menu implementations (such as those provided by the YUI Menu Control), Opera is in a small way preventing the user from understanding the browser as a platform for rich application development.
Focus
Focus could be considered as sacred as the context menu. Knowing what element has focus is fundamental to keyboard accessibility. And while most modern browsers support customization of the rendering of focus, is it a good idea to do so? The presentation and behavior is of HTML is now so completely customizable via CSS and JavaScript that the user experience can differ drastically across sites and applications on the web. Keeping something as fundamental as focus consistent means one less thing the user has to re-learn when navigating the across the web. Consider the following example:
Example 1: Anchor Elements (The Good)
| Focused anchor in Opera 9.5 (Mac) | |
| Focused anchor styled as a button in Opera 9.5 (Mac) |
This example illustrates how the focused state of an anchor element is rendered consistently in Opera regardless of how it is styled. This consistency can be considered helpful to the user in that the familiarity of the focus outline conveys the element’s role. Therefore, the user knows what to expect when the element is clicked regardless of how it is styled. However, as illustrated in the following example, this benefit breaks down a little as the focus model for buttons isn’t the same as it is for anchor elements.
Example 2: Buttons (The Bad)
| Focused, unstyled button in Opera 9.5 (Mac) | |
| Focused, styled button in Opera 9.5 (Mac) |
This example illustrates a potential flaw in Opera’s rendering of focus in version 9.5: unlike anchor elements, unstyled and styled buttons get two different renderings of focus, both of which are completely different, and different from the focus style applied to anchor elements. So, in Opera 9.5 there are three different focus implementations for the user to learn: the system default, the Wii-style focus and the dotted border. Compare Opera’s focus implementation to that of Safari or Internet Explorer, where by default focus is rendered consistently across elements of various types.
| Opera | Safari | Description |
|---|---|---|
| Focused, unstyled acnhor | ||
| Focused anchor styled as a button | ||
| Focused, unstyled button | ||
| Focused, styled button |
Since the default implementation of focus can be customized in other browsers, perhaps Opera users still fair better since learning Opera’s three, fixed focus models is ultimately better than having to learn potentially infinitely more. That said, if Opera is going to prevent customization of focus in the interest of usability and accessibility, they could further improve the user experience by providing a consistent implementation of focus across elements. As it stands in Opera 9.5, the following mixed styles can appear together, presenting a confusing set of visual cues:
Example 3: Mixed types together (The Ugly)
| Focused anchor styled as a button in Opera 9.5 (Mac) | |
| Focused, styled button in Opera 9.5 (Mac) |
As illustrated by the first and second examples, Opera has three different, yet fixed implementations of focus. While Opera’s implementation of focus can be considered good insofar as the user only has a limited number of focus models to learn, it might also be considered bad in that it makes it harder to provide a consistent user experience within a single site or web application. For example, if you wanted to place an anchor and button next to each other in a toolbar, but style them consistently so that they both look like buttons, each would still render focus differently in Opera, leaving the user to wonder how the difference is significant.
Conclusion
In Opera designers and developers lose a degree of customization, but the user gains a slightly more consistent browsing experience. In some ways this consistency benefits the user in that fundamental interactions like focus and context menus remain the same regardless of the site or web application in use. However, by limiting certain types of customization designers and developers will find it just a bit harder to provide a consistent user experience within their site or application and to train the user to expect more from Web 2.0.
Share and extend: Bookmark with Yahoo! My Web | Bookmark with del.icio.us | digg it! | reddit!
10 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment

Copyright © 2007 Yahoo! Inc. All rights reserved. Privacy Policy - Terms of Service
Powered by WordPress on Yahoo! Web Hosting.

I might have to disagree with your concerns about the lack of context menu control. In Firefox, for example, I’ve disabled a site’s ability to control the context menu (for example, to prevent sites suppressing the context menu to save images, etc). Consider further that we’re seeing interfaces like the iPhone that don’t have a way (that I know of) to invoke a context menu.
With that in mind, I’ve long given up on ever trying to build context menu support into an application and try to solve the problem through other means (like a menu invoked from an icon or drop down menu, etc.)
Comment by Jonathan Snook — July 17, 2008 #
I very much agree with Jonathan’s comment above. Please remember, that while sites like Gmail or Yahoo Mail are de-facto applications, the user is also, or perhaps above all, using another application — a web browser.
If you want to “cleanly” provide OS-native, “real” application-like interactions to your web apps, how about using Prism (http://wiki.mozilla.org/WebRunner)? I think many users would appreciate it, if only because they’d get their ‘E-mail’ icon back on the desktop :)
Comment by Michal Tatarynowicz — July 17, 2008 #
I’m not sure this is the right place to ask those questions, but I guess I’ve got nothing to loose by asking here.
1) Why does Yahoo Mail have a Home tab? As far as I can tell it serves no real purpose, and it’s there only because you’ve tried to copy every failed idea implemented in Microsoft Outlook Express.
2) Why can’t I open an e-mail in a new window from the context menu? That’s about the only reason I would right-click a message, and it’s not even possible.
Comment by Michal Tatarynowicz — July 17, 2008 #
I’ve checked display of both styled and unstyled buttons in Opera9.5/Linux and Windows, and it appears to display all of them consistently - with blue outline. I think that difference of styles in Opera/Mac arises from attempts to look like native MacOSX application, and thus is platform-specific.
Comment by arty — July 18, 2008 #
Good points Todd.
I agree that removing the ability to override the context menu limits the web as an application, but I’ve also experienced frustration personally when a custom context menu has prevented me from accessing some basic browser functionality.
What about appending custom menu items to the browser’s default context menu? Thus the functionality users expect to see will be preserved, but web application developers are still given the freedom to customize their apps.
Comment by Raine — July 18, 2008 #
I think that app authors should be able to provide custom context menus in their apps. It does limit user functionality due to lack of access to the default functionality, but hopefully app authors will use this wisely. And the choice is better than no choice at all.
Comment by Jess Sightler — July 18, 2008 #
Opera could improve „allow sites to receive right clicks” option to be able to prevent context menu.
But it’s good that access to right click is off by default. There are too many webmasters who are trying to re-implement browser within browser (custom buttons, custom dropdowns, custom ajax navigation) and I at least want context menu to work.
I hate the focus outline though. It’s too heavy and obscures content too often.
Comment by kL — July 18, 2008 #
Ok, I was a bit wrong about focus rendering. This article suggests you focus elements with Tab button, however Opera has much more convenient and powerful “spatial navigation” activated with Ctrl+Arrows. Spatial navigation renders focused elements consistently, but being selected with Tab button, they are rendered inconsistently.
Comment by arty — July 19, 2008 #
Apple Macs lived without right button for a years. So why don’t you use in Opera Alt+Click or Ctrl+Click?
This is number one.
Number two. Context menu in a good hands - good thing for user. In bad hands - deadly weapon of a maniac :^)
I vote for appending custom menu to browser’s one.
Number three. If a designer using a styled button he takes resposibility for it’s look _including_ focused appearance. So use onfocus property.
Comment by Eldarado — August 5, 2008 #
In general I use context menus only for shortcuts to functionality which is available in other places. For example you can edit a customer record directly from a table showing all customers using the context menu. The other way is too click the user and click the edit button there. (I never got my users to accept double click either… Also because YUI doesn’t support both single & double click event handlers at the same time)
So the lack of a context menu is minor annoyance. But I think Opera forgets about the different audiences using their browser. For website visitors affordance and their expectations are the most important things. But my applications are used by ‘power users’ which take the time to learn the little tricks like context menus which save them a mouse click and a page reload.
In my opinion the decision to deviate from standards is one which should be made by the developer not the browser.
Comment by Willem Joosten — August 8, 2008 #