Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: Source/core/accessibility/AXTable.cpp

Issue 189963007: Use isHTML*Element() helpers more in the accessibility code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/accessibility/AXRenderObject.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 if (node() && node()->rendererIsEditable()) 99 if (node() && node()->rendererIsEditable())
100 return true; 100 return true;
101 101
102 // This employs a heuristic to determine if this table should appear. 102 // This employs a heuristic to determine if this table should appear.
103 // Only "data" tables should be exposed as tables. 103 // Only "data" tables should be exposed as tables.
104 // Unfortunately, there is no good way to determine the difference 104 // Unfortunately, there is no good way to determine the difference
105 // between a "layout" table and a "data" table. 105 // between a "layout" table and a "data" table.
106 106
107 RenderTable* table = toRenderTable(m_renderer); 107 RenderTable* table = toRenderTable(m_renderer);
108 Node* tableNode = table->node(); 108 Node* tableNode = table->node();
109 if (!tableNode || !tableNode->hasTagName(tableTag)) 109 if (!isHTMLTableElement(tableNode))
110 return false; 110 return false;
111 111
112 // if there is a caption element, summary, THEAD, or TFOOT section, it's mos t certainly a data table 112 // if there is a caption element, summary, THEAD, or TFOOT section, it's mos t certainly a data table
113 HTMLTableElement* tableElement = toHTMLTableElement(tableNode); 113 HTMLTableElement* tableElement = toHTMLTableElement(tableNode);
114 if (!tableElement->summary().isEmpty() || tableElement->tHead() || tableElem ent->tFoot() || tableElement->caption()) 114 if (!tableElement->summary().isEmpty() || tableElement->tHead() || tableElem ent->tFoot() || tableElement->caption())
115 return true; 115 return true;
116 116
117 // if someone used "rules" attribute than the table should appear 117 // if someone used "rules" attribute than the table should appear
118 if (!tableElement->rules().isEmpty()) 118 if (!tableElement->rules().isEmpty())
119 return true; 119 return true;
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 { 528 {
529 if (!isAXTable()) 529 if (!isAXTable())
530 return AXRenderObject::title(); 530 return AXRenderObject::title();
531 531
532 String title; 532 String title;
533 if (!m_renderer) 533 if (!m_renderer)
534 return title; 534 return title;
535 535
536 // see if there is a caption 536 // see if there is a caption
537 Node* tableElement = m_renderer->node(); 537 Node* tableElement = m_renderer->node();
538 if (tableElement && tableElement->hasTagName(tableTag)) { 538 if (isHTMLTableElement(tableElement)) {
539 HTMLTableCaptionElement* caption = toHTMLTableElement(tableElement)->cap tion(); 539 HTMLTableCaptionElement* caption = toHTMLTableElement(tableElement)->cap tion();
540 if (caption) 540 if (caption)
541 title = caption->innerText(); 541 title = caption->innerText();
542 } 542 }
543 543
544 // try the standard 544 // try the standard
545 if (title.isEmpty()) 545 if (title.isEmpty())
546 title = AXRenderObject::title(); 546 title = AXRenderObject::title();
547 547
548 return title; 548 return title;
549 } 549 }
550 550
551 } // namespace WebCore 551 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXRenderObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698