Closed Bug 687393 Opened 13 years ago Closed 13 years ago

HTML select options gets relation from containing label

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

Example:

<label>Hello
<select>
  <option>option</option>
</select>

Example in web: http://harkin.senate.gov/contact_opinion.cfm
Attached patch patch (obsolete) — Splinter Review
based on bug 673958
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #560861 - Flags: review?(trev.saunders)
Attached patch patch2Splinter Review
Attachment #560861 - Attachment is obsolete: true
Attachment #560861 - Flags: review?(trev.saunders)
Attachment #560864 - Flags: review?(trev.saunders)
Comment on attachment 560864 [details] [diff] [review]
patch2


>+  // document.
>+  nsAccessible* walkUp = mAcc->Parent();
>+  while (walkUp->IsElement()) {
>+    nsIContent* walkUpElm = walkUp->GetContent();

If we really care about pef we should move the nsIContent* local var out of the loop so we can call  the GetContent() vfunc once per loop instead of twice.  (we call it twice here once explicitly and once in IsElement()).
Attachment #560864 - Flags: review?(trev.saunders) → review+
(In reply to Trevor Saunders (:tbsaunde) from comment #3)
> Comment on attachment 560864 [details] [diff] [review] [diff] [details] [review]
> patch2
> 
> 
> >+  // document.
> >+  nsAccessible* walkUp = mAcc->Parent();
> >+  while (walkUp->IsElement()) {
> >+    nsIContent* walkUpElm = walkUp->GetContent();
> 
> If we really care about pef we should move the nsIContent* local var out of
> the loop so we can call  the GetContent() vfunc once per loop instead of
> twice.  (we call it twice here once explicitly and once in IsElement()).

I'll replace walkUp->IsElement() on !walkUp->IsDoc() that should be more pref and more clear what is it for.
https://hg.mozilla.org/mozilla-central/rev/da2b4e883854
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Target Milestone: --- → mozilla10
Comment on attachment 560864 [details] [diff] [review]
patch2

>--- a/accessible/src/base/AccIterator.cpp
>+++ b/accessible/src/base/AccIterator.cpp
> HTMLLabelIterator::Next()
> {
>   // Get either <label for="[id]"> element which explicitly points to given
>   // element, or <label> ancestor which implicitly point to it.
>   nsAccessible* label = nsnull;
>   while ((label = mRelIter.Next())) {
>     if (label->GetContent()->Tag() == nsGkAtoms::label)
>+    if (walkUpElm->Tag() == nsGkAtoms::label) {
>+    if (walkUpElm->Tag() == nsGkAtoms::form)

Is it safe to assume that these are in the HTML namespace? If so, I'd appreciate assertions.
(In reply to Ms2ger from comment #7)

> Is it safe to assume that these are in the HTML namespace? If so, I'd
> appreciate assertions.

It's sort of assumption it never happens in real life. It makes sense to keep HTML namespace for correctness.
Depends on: 690828
No longer depends on: 690828
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: