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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXTable.cpp

Issue 1547643002: ARIA 1.1: implementation for aria-col-* and aria-row-*. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds MODULES_EXPORT Created 5 years 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
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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 { 478 {
479 if (!m_layoutObject) 479 if (!m_layoutObject)
480 return; 480 return;
481 481
482 updateChildrenIfNecessary(); 482 updateChildrenIfNecessary();
483 unsigned rowCount = m_rows.size(); 483 unsigned rowCount = m_rows.size();
484 for (unsigned r = 0; r < rowCount; r++) 484 for (unsigned r = 0; r < rowCount; r++)
485 toAXTableRow(m_rows[r].get())->headerObjectsForRow(headers); 485 toAXTableRow(m_rows[r].get())->headerObjectsForRow(headers);
486 } 486 }
487 487
488 int AXTable::ariaColumnCount()
489 {
490 const AtomicString& colCountValue = getAttribute(aria_colcountAttr);
491 int colCountInt = colCountValue.toInt();
492
493 if (colCountInt > (int)columnCount())
494 return colCountInt;
495
496 // Spec says that if all of the columns are present in the DOM, it is not ne cessary to set
497 // this attribute as the user agent can automatically calculate the total nu mber of columns.
498 // It returns 0 in order not to set this attribute.
499 if (colCountInt == (int)columnCount() || colCountInt != -1)
500 return 0;
501
502 return -1;
503 }
504
505 int AXTable::ariaRowCount()
506 {
507 const AtomicString& rowCountValue = getAttribute(aria_rowcountAttr);
508 int rowCountInt = rowCountValue.toInt();
509
510 if (rowCountInt > (int)rowCount())
511 return rowCountInt;
512
513 // Spec says that If all of the rows are present in the DOM, it is not neces sary to set
514 // this attribute as the user agent can automatically calculate the total nu mber of rows. .
515 // It returns 0 in order not to set this attribute.
516 if (rowCountInt == (int)rowCount() || rowCountInt != -1)
517 return 0;
518
519 return -1;
520 }
521
488 unsigned AXTable::columnCount() 522 unsigned AXTable::columnCount()
489 { 523 {
490 updateChildrenIfNecessary(); 524 updateChildrenIfNecessary();
491 525
492 return m_columns.size(); 526 return m_columns.size();
493 } 527 }
494 528
495 unsigned AXTable::rowCount() 529 unsigned AXTable::rowCount()
496 { 530 {
497 updateChildrenIfNecessary(); 531 updateChildrenIfNecessary();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 591
558 DEFINE_TRACE(AXTable) 592 DEFINE_TRACE(AXTable)
559 { 593 {
560 visitor->trace(m_rows); 594 visitor->trace(m_rows);
561 visitor->trace(m_columns); 595 visitor->trace(m_columns);
562 visitor->trace(m_headerContainer); 596 visitor->trace(m_headerContainer);
563 AXLayoutObject::trace(visitor); 597 AXLayoutObject::trace(visitor);
564 } 598 }
565 599
566 } // namespace blink 600 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698