Summary: | AX: Malformed tables exposing incorrect col and colSpans | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | chris fleizach <cfleizach> | ||||
Component: | Accessibility | Assignee: | chris fleizach <cfleizach> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | aboxhall, apinheiro, commit-queue, dmazzoni, jcraig, jdiggs, mario, samuel_white, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
chris fleizach
2014-04-17 09:36:16 PDT
The fix appears to be to use effectiveCols, available on RenderTableCell Created attachment 229555 [details]
patch
Comment on attachment 229555 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=229555&action=review > Source/WebCore/accessibility/AccessibilityTableCell.cpp:251 > RenderTableCell* renderCell = toRenderTableCell(m_renderer); I’d suggest using a reference rather than a pointer for this local variable. And I would name it cell. I don’t think a “render” prefix adds anything. > Source/WebCore/accessibility/AccessibilityTableCell.cpp:256 > + RenderTable* table = renderCell->table(); > + if (!table) > + return; Can this ever be null? In practice I don’t think it can, so the code above doesn’t matter. I was going to criticize sometimes returning col/colSpan directly from the element, but I’m not sure it matters. > Source/WebCore/accessibility/AccessibilityTableCell.cpp:258 > + columnRange.first = table->colToEffCol(columnRange.first); I think it’s strange to use columnRange.first here instead of renderCell->col(). Makes the code harder to read for me. (In reply to comment #4) > (From update of attachment 229555 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=229555&action=review > > > Source/WebCore/accessibility/AccessibilityTableCell.cpp:251 > > RenderTableCell* renderCell = toRenderTableCell(m_renderer); > > I’d suggest using a reference rather than a pointer for this local variable. And I would name it cell. I don’t think a “render” prefix adds anything. > > > Source/WebCore/accessibility/AccessibilityTableCell.cpp:256 > > + RenderTable* table = renderCell->table(); > > + if (!table) > > + return; > > Can this ever be null? In practice I don’t think it can, so the code above doesn’t matter. I was going to criticize sometimes returning col/colSpan directly from the element, but I’m not sure it matters. > > > Source/WebCore/accessibility/AccessibilityTableCell.cpp:258 > > + columnRange.first = table->colToEffCol(columnRange.first); > > I think it’s strange to use columnRange.first here instead of renderCell->col(). Makes the code harder to read for me. Thanks. I'll make all these changes |