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

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

Issue 482903002: Get rid of loops looking for the first Element ancestor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits 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/Element.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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return siblingWithAriaRole("menuitem", node()); 390 return siblingWithAriaRole("menuitem", node());
391 } 391 }
392 392
393 Element* AXNodeObject::mouseButtonListener() const 393 Element* AXNodeObject::mouseButtonListener() const
394 { 394 {
395 Node* node = this->node(); 395 Node* node = this->node();
396 if (!node) 396 if (!node)
397 return 0; 397 return 0;
398 398
399 // check if our parent is a mouse button listener 399 // check if our parent is a mouse button listener
400 while (node && !node->isElementNode()) 400 if (!node->isElementNode())
401 node = node->parentNode(); 401 node = node->parentElement();
402 402
403 if (!node) 403 if (!node)
404 return 0; 404 return 0;
405 405
406 // FIXME: Do the continuation search like anchorElement does 406 // FIXME: Do the continuation search like anchorElement does
407 for (Element* element = toElement(node); element; element = element->parentE lement()) { 407 for (Element* element = toElement(node); element; element = element->parentE lement()) {
408 if (element->getAttributeEventListener(EventTypeNames::click) || element ->getAttributeEventListener(EventTypeNames::mousedown) || element->getAttributeE ventListener(EventTypeNames::mouseup)) 408 if (element->getAttributeEventListener(EventTypeNames::click) || element ->getAttributeEventListener(EventTypeNames::mousedown) || element->getAttributeE ventListener(EventTypeNames::mouseup))
409 return element; 409 return element;
410 } 410 }
411 411
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 float range = maxValueForRange() - minValueForRange(); 1695 float range = maxValueForRange() - minValueForRange();
1696 float value = valueForRange(); 1696 float value = valueForRange();
1697 1697
1698 value += range * (percentChange / 100); 1698 value += range * (percentChange / 100);
1699 setValue(String::number(value)); 1699 setValue(String::number(value));
1700 1700
1701 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e); 1701 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e);
1702 } 1702 }
1703 1703
1704 } // namespace blink 1704 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698