Last Comment Bug 331346 - @accesskey appended after label cannot be hidden with CSS
: @accesskey appended after label cannot be hidden with CSS
Status: RESOLVED FIXED
: fixed1.8.0.5, fixed1.8.1
Product: Core
Classification: Components
Component: XForms (show other bugs)
: Trunk
: All All
: -- minor (vote)
: ---
Assigned To: Allan Beaufour
: Stephen Pride
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-22 08:06 PST by Victor Engmark
Modified: 2006-06-06 07:01 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (3.07 KB, patch)
2006-05-29 08:14 PDT, Allan Beaufour
no flags Details | Diff | Review
Patch w/jst nits fixed (3.16 KB, patch)
2006-05-29 08:16 PDT, Allan Beaufour
doronr: review+
bugs: review+
Details | Diff | Review
Testcase for proposed patch (1.66 KB, application/xhtml+xml)
2006-05-29 08:19 PDT, Allan Beaufour
no flags Details

Description Victor Engmark 2006-03-22 08:06:21 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

Using the following XForms, "(1)" is appended after the label.

<xf:trigger accesskey="1" id="show-slotid-form-trigger">
  <xf:label>Slot by ID</xf:label>
  <xf:action ev:event="DOMActivate">
    <xf:toggle case="show-slotid-form"/>
  </xf:action>
</xf:trigger>

I've tried hiding it with the following CSS rules, without success:
trigger:after {content: ""; display: none;}
label:after {content: ""; display: none;}

Using !important with the rules doesn't work either.

Reproducible: Always

Steps to Reproduce:
1. Add an @accesskey to an XForms control which does not match any letters in the label
2. Add CSS to hide the automatically generated :after contents
3. Load XForms in Firefox with the XForms 0.4 extension installed

Actual Results:  
The @accesskey contents is appended in parentheses after the label.

Expected Results:  
The @accesskey contents should be hidden.

AFAIK, the following is the correct minimal CSS to do this:
label:after {display: none;}
Comment 1 Doron Rosenberg (IBM) 2006-03-22 09:36:03 PST
We create a html:u for the accesskey, so :

xforms|label html|u {
  display: none;
}

probably will work.
Comment 2 alexander :surkov 2006-03-22 18:00:21 PST
(In reply to comment #1)
> We create a html:u for the accesskey, so :
> 
> xforms|label html|u {
>   display: none;
> }
> 
> probably will work.
> 

Not always. Parenthesis will be threre :)

There are two issues. The first we should provide a ability to hide additional accesskey label. Though I can't see a usecase when it's needed. The second issue is related with generated text of css. Should the example work at all? Btw how is generated text supporting realized?
Comment 3 Doron Rosenberg (IBM) 2006-03-22 18:44:55 PST
We could remove the () stuff if the accesskey isn't found in the value.  Mozilla UI does the (_accesskey) stuff so I automatically added it.
Comment 4 Allan Beaufour 2006-05-29 08:14:57 PDT
Created attachment 223694 [details] [diff] [review]
Patch

Another approach on accesskeys. Instead of using a "u" element, I create spans for both the case where the key is found in the label (inline) and where it is appended.

I then set the classes xf-accesskey-inline and xf-accessley-appended. These are are then styled per default (with underline and ()), and it is possible for the form author to style them as she pleases.
Comment 5 Allan Beaufour 2006-05-29 08:16:43 PDT
Created attachment 223695 [details] [diff] [review]
Patch w/jst nits fixed
Comment 6 Allan Beaufour 2006-05-29 08:19:38 PDT
Created attachment 223696 [details]
Testcase for proposed patch
Comment 7 Allan Beaufour 2006-05-30 01:41:40 PDT
Fixed on trunk

Note You need to log in before you can comment on or make changes to this bug.