Community
Participate
Working Groups
Build Identifier: 3.6.2 M20110210-1200 For accessibility, when user navigate to the SWT Mozilla browser widget via keyboard Tab/Shift+Tab, a dot-style rectangle is required to indicate current focus. On the other hand, we can see dot-Style rectangle on other widgets like button and tab header, or a blink caret in text input. Reproducible: Always Steps to Reproduce: 1. On windows platform, launch a simple SWT application with SWT Mozilla browser. 2. User keyboard to navigate to SWT Mozilla browser widget
Stand-alone Firefox (7) shows the same behaviour, so this behaviour appears to come from the embedded control. Pages like google.com do show focus on links, while pages like eclipse.org do not. If you have a case where focus is shown in stand-alone Firefox but is not shown in a Mozilla-based Browser then please provide it here. In the meantime, closing report as NOT_ECLIPSE.
Hi Grant, It is not necessary to navigate to any website. You can reproduce the problem with about:blank. When I mentioned there is no focus indicator in above comments, I mean the dot-style rectangle around the whole browser client area, but not those around html element inside page. I tested with Firefox3.6, 7, 8, and found that all firefox can show up a rectangle when navigate from address bar to browser client area. But not for SWT browser. Meanwhile, we make a workaround at our browser like below. ------------- + if("win32".equals(SWT.getPlatform())){ + focusInListener = new Listener(){ + public void handleEvent(Event event) { + try { + focusManager = getFocusManager(); + int rc=0; + int[] retVal = new int[1]; + rc = focusManager.GetFocusedElement(retVal); + if(rc != 0) return; + // not get the focused element + if(retVal[0]==0){ + JHTMLDocument doc = (JHTMLDocument)getDocument(); + if(doc != null){ + JHTMLHtmlElement htmlElement = (JHTMLHtmlElement)doc.getDocumentElement(); + if(htmlElement != null){ + // set focus to htmlelement to let xulrunner draw the focus + focusManager.SetFocus(htmlElement.getDOMNode().getAddress(), nsIFocusManager.FLAG_BYKEY); + } + } + } + } catch (Exception e) { + if(logger.isLoggable(Level.FINEST)){ + logger.logp(Level.FINEST, CLZ_NAME, "DOMMozillaBrowser Focusin event", "set focus to JHTMLHtmlElement failed!"); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + } + + }; + addListener(SWT.FocusIn, focusInListener); + } -----------------------
Thanks for the further explaination. This is fixed > 20111124, changes are at http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=108b9dd38cc7c1124205fb1899f8aad5ad317989 .