RESOLVED FIXED 137899
Avoid confusion between AccessibilityObject::isTable() / isAccessibilityTable()
https://bugs.webkit.org/show_bug.cgi?id=137899
Summary Avoid confusion between AccessibilityObject::isTable() / isAccessibilityTable()
Chris Dumez
Reported 2014-10-20 17:06:36 PDT
Avoid confusion between AccessibilityObject::isTable() / isAccessibilityTable(). isTable() is equivalent to is<AccessibilityTable>(), while isAccessibilityTable() is an AccessibilityTable that is exposed as an AccessibilityTable to the platform. We should likely rename isAccessibilityTable() to something else (maybe isExposedThroughAccessibility()?), have it on AccessibilityTable class only and make it non-virtual.
Attachments
Patch (29.42 KB, patch)
2014-10-20 17:48 PDT, Chris Dumez
no flags
Patch (29.64 KB, patch)
2014-10-20 17:57 PDT, Chris Dumez
no flags
Patch (31.77 KB, patch)
2014-10-20 18:58 PDT, Chris Dumez
no flags
Patch (31.98 KB, patch)
2014-10-20 19:12 PDT, Chris Dumez
no flags
Patch (31.99 KB, patch)
2014-10-20 19:28 PDT, Chris Dumez
no flags
Patch (32.62 KB, patch)
2014-10-22 13:37 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2014-10-20 17:48:36 PDT
WebKit Commit Bot
Comment 2 2014-10-20 17:49:58 PDT
Attachment 240165 [details] did not pass style-queue: ERROR: Source/WebCore/accessibility/AccessibilityTable.cpp:585: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 1 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 3 2014-10-20 17:57:59 PDT
WebKit Commit Bot
Comment 4 2014-10-20 18:29:09 PDT
Attachment 240168 [details] did not pass style-queue: ERROR: Source/WebCore/accessibility/AccessibilityTable.cpp:585: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 1 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 5 2014-10-20 18:58:19 PDT
WebKit Commit Bot
Comment 6 2014-10-20 19:05:25 PDT
Attachment 240173 [details] did not pass style-queue: ERROR: Source/WebCore/accessibility/AccessibilityTable.cpp:585: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 7 2014-10-20 19:12:05 PDT
WebKit Commit Bot
Comment 8 2014-10-20 19:14:56 PDT
Attachment 240175 [details] did not pass style-queue: ERROR: Source/WebCore/accessibility/AccessibilityTable.cpp:585: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 9 2014-10-20 19:28:06 PDT
WebKit Commit Bot
Comment 10 2014-10-20 19:29:07 PDT
Attachment 240177 [details] did not pass style-queue: ERROR: Source/WebCore/accessibility/AccessibilityTable.cpp:585: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 11 2014-10-21 15:46:35 PDT
Comment on attachment 240177 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240177&action=review While I do think we are getting more clarity here, the really verbose repeated is && downcast dance is irritating. I wish there was a cleaner way to write all of those. > Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp:66 > + if (!is<AccessibilityTable>(parent) || !downcast<AccessibilityTable>(*parent).isExposableThroughAccessibility()) > return nullptr; Maybe this would read better as !(a && b) rather than !a || !b? > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1631 > + if (is<AccessibilityList>(*obj) > + || (is<AccessibilityTable>(*obj) && downcast<AccessibilityTable>(*obj).isExposableThroughAccessibility()) > + || obj->isTree() > + || obj->isCanvas()) > return false; How about 3 or 4 separate if statements? I don’t see why we need to use one with || here. > Source/WebCore/accessibility/AccessibilityTable.cpp:54 > + , m_isExposableThroughAccessibility(true) Seems a little strange to initialize this both here and in the init function. It seems like we’d have a problem if we looked at this before calling init. > Source/WebCore/accessibility/AccessibilityTable.h:63 > + virtual int tableLevel() const override final; Glad you marked this final. I’d like to see more of these public virtual override functions made private, protected, or final. > Source/WebCore/accessibility/AccessibilityTable.h:96 > + virtual bool computeIsTableExposableThroughAccessibility() const; Not sure why this is protected instead of private. Do derived classes call through to the base class? > Source/WebCore/accessibility/AccessibilityTableRow.cpp:79 > - if (!table || !table->isAccessibilityTable()) > + if (!is<AccessibilityTable>(table) || !downcast<AccessibilityTable>(*table).isExposableThroughAccessibility()) > return false; > > return true; This should be: return is<AccessibilityTable>(table) && downcast<AccessibilityTable>(*table).isExposableThroughAccessibility(); > Source/WebCore/accessibility/AccessibilityTableRow.cpp:110 > if (is<AccessibilityTable>(*parent)) > - return downcast<AccessibilityTable>(*parent).isAccessibilityTable() ? downcast<AccessibilityTable>(parent) : nullptr; > + return downcast<AccessibilityTable>(*parent).isExposableThroughAccessibility() ? downcast<AccessibilityTable>(parent) : nullptr; Seems like this goes out of its way to use ? : when it could just fall through to return nullptr.
Chris Dumez
Comment 12 2014-10-22 13:37:55 PDT
WebKit Commit Bot
Comment 13 2014-10-22 13:38:51 PDT
Attachment 240293 [details] did not pass style-queue: ERROR: Source/WebCore/accessibility/AccessibilityTable.cpp:585: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 14 2014-10-22 14:45:19 PDT
Comment on attachment 240293 [details] Patch Clearing flags on attachment: 240293 Committed r175068: <http://trac.webkit.org/changeset/175068>
WebKit Commit Bot
Comment 15 2014-10-22 14:45:25 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.