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

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

Issue 428533006: Use ContainerNode::hasChildren() instead of firstChild() in conditionals (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fix Created 6 years, 4 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/dom/Node.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 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 // previous checks, so this should remain as one of the last. 742 // previous checks, so this should remain as one of the last.
743 // 743 //
744 // These checks are simplified in the interest of execution speed; 744 // These checks are simplified in the interest of execution speed;
745 // for example, any element having an alt attribute will make it 745 // for example, any element having an alt attribute will make it
746 // not ignored, rather than just images. 746 // not ignored, rather than just images.
747 if (!getAttribute(aria_helpAttr).isEmpty() || !getAttribute(aria_describedby Attr).isEmpty() || !getAttribute(altAttr).isEmpty() || !getAttribute(titleAttr). isEmpty()) 747 if (!getAttribute(aria_helpAttr).isEmpty() || !getAttribute(aria_describedby Attr).isEmpty() || !getAttribute(altAttr).isEmpty() || !getAttribute(titleAttr). isEmpty())
748 return false; 748 return false;
749 749
750 // Don't ignore generic focusable elements like <div tabindex=0> 750 // Don't ignore generic focusable elements like <div tabindex=0>
751 // unless they're completely empty, with no children. 751 // unless they're completely empty, with no children.
752 if (isGenericFocusableElement() && node->firstChild()) 752 if (isGenericFocusableElement() && node->hasChildren())
753 return false; 753 return false;
754 754
755 if (!ariaAccessibilityDescription().isEmpty()) 755 if (!ariaAccessibilityDescription().isEmpty())
756 return false; 756 return false;
757 757
758 // By default, objects should be ignored so that the AX hierarchy is not 758 // By default, objects should be ignored so that the AX hierarchy is not
759 // filled with unnecessary items. 759 // filled with unnecessary items.
760 return true; 760 return true;
761 } 761 }
762 762
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
2314 if (label && label->renderer()) { 2314 if (label && label->renderer()) {
2315 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2315 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2316 result.unite(labelRect); 2316 result.unite(labelRect);
2317 } 2317 }
2318 } 2318 }
2319 2319
2320 return result; 2320 return result;
2321 } 2321 }
2322 2322
2323 } // namespace blink 2323 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698