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

RESOLVED FIXED

Status

()

RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: surkov, Assigned: surkov)

Tracking

(Blocks: 1 bug, {access})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
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.
(Assignee)

Comment 1

10 years ago
Created attachment 386263 [details] [diff] [review]
patch
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+
(Assignee)

Comment 4

10 years ago
(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
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.