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

Side by Side Diff: third_party/WebKit/WebCore/page/AccessibilityTable.cpp

Issue 46097: WebKit merge 41660:41709 (WebKit side).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 RenderTable* table = static_cast<RenderTable*>(m_renderer); 379 RenderTable* table = static_cast<RenderTable*>(m_renderer);
380 RenderTableSection* tableSection = table->header(); 380 RenderTableSection* tableSection = table->header();
381 if (!tableSection) 381 if (!tableSection)
382 tableSection = table->firstBody(); 382 tableSection = table->firstBody();
383 383
384 RenderTableCell* cell = 0; 384 RenderTableCell* cell = 0;
385 unsigned rowCount = 0; 385 unsigned rowCount = 0;
386 unsigned rowOffset = 0; 386 unsigned rowOffset = 0;
387 while (tableSection) { 387 while (tableSection) {
388 388
389 rowCount += tableSection->numRows(); 389 unsigned numRows = tableSection->numRows();
390 unsigned numCols = tableSection->numColumns(); 390 unsigned numCols = tableSection->numColumns();
391 391
392 if (row < rowCount && column < numCols) { 392 rowCount += numRows;
393 int sectionSpecificRow = row - rowOffset; 393
394 unsigned sectionSpecificRow = row - rowOffset;
395 if (row < rowCount && column < numCols && sectionSpecificRow < numRows) {
394 cell = tableSection->cellAt(sectionSpecificRow, column).cell; 396 cell = tableSection->cellAt(sectionSpecificRow, column).cell;
395 397
396 // we didn't find the cell, which means there's spanning happening 398 // we didn't find the cell, which means there's spanning happening
397 // search backwards to find the spanning cell 399 // search backwards to find the spanning cell
398 if (!cell) { 400 if (!cell) {
399 401
400 // first try rows 402 // first try rows
401 for (int testRow = sectionSpecificRow-1; testRow >= 0; --testRow ) { 403 for (int testRow = sectionSpecificRow-1; testRow >= 0; --testRow ) {
402 cell = tableSection->cellAt(testRow, column).cell; 404 cell = tableSection->cellAt(testRow, column).cell;
403 // cell overlapped. use this one 405 // cell overlapped. use this one
(...skipping 11 matching lines...) Expand all
415 break; 417 break;
416 cell = 0; 418 cell = 0;
417 } 419 }
418 } 420 }
419 } 421 }
420 } 422 }
421 423
422 if (cell) 424 if (cell)
423 break; 425 break;
424 426
425 rowOffset += rowCount; 427 rowOffset += numRows;
426 // we didn't find anything between the rows we should have 428 // we didn't find anything between the rows we should have
427 if (row < rowOffset) 429 if (row < rowCount)
428 break; 430 break;
429 tableSection = table->sectionBelow(tableSection, true); 431 tableSection = table->sectionBelow(tableSection, true);
430 } 432 }
431 433
432 if (!cell) 434 if (!cell)
433 return 0; 435 return 0;
434 436
435 AccessibilityObject* cellObject = axObjectCache()->getOrCreate(cell); 437 AccessibilityObject* cellObject = axObjectCache()->getOrCreate(cell);
436 ASSERT(cellObject->isTableCell()); 438 ASSERT(cellObject->isTableCell());
437 439
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 482
481 bool AccessibilityTable::isDataTable() const 483 bool AccessibilityTable::isDataTable() const
482 { 484 {
483 if (!m_renderer) 485 if (!m_renderer)
484 return false; 486 return false;
485 487
486 return m_isAccessibilityTable; 488 return m_isAccessibilityTable;
487 } 489 }
488 490
489 } // namespace WebCore 491 } // namespace WebCore
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/make-generated-sources.sh ('k') | third_party/WebKit/WebCore/page/Chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698