Closed Bug 501635 Opened 15 years ago Closed 15 years ago

nsHTMLTableAccessible::GetSelectedCells contains index duplicates for spanned rows or columns

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file)

If HTML table has row or column spans and spanned row or column is selected then GetSelectedCells returns an array containing number of identical indexes equaled to extent of spans.
Attached patch patchSplinter Review
Attachment #386263 - Flags: review?(marco.zehe)
Attachment #386263 - Flags: review?(bolterbugz)
Comment on attachment 386263 [details] [diff] [review]
patch

r=me for the test part. Thanks!
Attachment #386263 - Flags: review?(marco.zehe) → review+
Comment on attachment 386263 [details] [diff] [review]
patch

r=me with questions answered:

>+      rv = tableLayout->GetCellDataAt(rowIndex, columnIndex,
>+                                      *getter_AddRefs(domElement),
>+                                      startRowIndex, startColIndex,
>+                                      rowSpan, colSpan,
>+                                      actualRowSpan, actualColSpan,
>+                                      isSelected);
> 
>-      if (state)
>+      if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
>+          startColIndex == columnIndex && isSelected) {

Can you remind me when startColIndex != columnIndex?

>   // isCellSelected test
>   for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
>     for (var colIdx = 0; colIdx < colsCount; colIdx++) {
>+      if (aCellsArray[rowIdx][colIdx] == undefined)
>+        continue;

When does this happen?


>   is(accTable.selectedColumnsCount, 0, "no column should be selected");
>   ok(!accTable.isProbablyForLayout(), "table is not for layout");
>   SimpleTest.finish();
>-}
>+    }

nit: indent looks wrong?
Attachment #386263 - Flags: review?(bolterbugz) → review+
(In reply to comment #3)
> (From update of attachment 386263 [details] [diff] [review])

> Can you remind me when startColIndex != columnIndex?

when col or row is spanned by another row or col

> When does this happen?

when we pass undefined there :) see html test file.

> 
> nit: indent looks wrong?

right, I just saved existing indents to avoid hg changes, later when I fix all related bugs then I'll replace them on more suitable testing.
Pushed on Surkov's behalf in changeset:
http://hg.mozilla.org/mozilla-central/rev/6d2ad89d3afa
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: