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

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

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | Source/core/css/SelectorChecker.cpp » ('j') | 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, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 498 }
499 499
500 return parent; 500 return parent;
501 } 501 }
502 502
503 AccessibilityObject* AccessibilityObject::firstAccessibleObjectFromNode(const No de* node) 503 AccessibilityObject* AccessibilityObject::firstAccessibleObjectFromNode(const No de* node)
504 { 504 {
505 if (!node) 505 if (!node)
506 return 0; 506 return 0;
507 507
508 Document* document = node->document(); 508 AXObjectCache* cache = node->document()->axObjectCache();
509 if (!document)
510 return 0;
511
512 AXObjectCache* cache = document->axObjectCache();
513
514 AccessibilityObject* accessibleObject = cache->getOrCreate(node->renderer()) ; 509 AccessibilityObject* accessibleObject = cache->getOrCreate(node->renderer()) ;
515 while (accessibleObject && accessibleObject->accessibilityIsIgnored()) { 510 while (accessibleObject && accessibleObject->accessibilityIsIgnored()) {
516 node = NodeTraversal::next(node); 511 node = NodeTraversal::next(node);
517 512
518 while (node && !node->renderer()) 513 while (node && !node->renderer())
519 node = NodeTraversal::nextSkippingChildren(node); 514 node = NodeTraversal::nextSkippingChildren(node);
520 515
521 if (!node) 516 if (!node)
522 return 0; 517 return 0;
523 518
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 982
988 for (AccessibilityObject* object = parentObject(); object; object = object-> parentObject()) { 983 for (AccessibilityObject* object = parentObject(); object; object = object-> parentObject()) {
989 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) 984 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
990 return true; 985 return true;
991 } 986 }
992 987
993 return false; 988 return false;
994 } 989 }
995 990
996 } // namespace WebCore 991 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/SelectorChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698