| OLD | NEW |
| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 { | 344 { |
| 345 if (!element->isHTMLElement() || !toHTMLElement(element)->isLabelable()) | 345 if (!element->isHTMLElement() || !toHTMLElement(element)->isLabelable()) |
| 346 return 0; | 346 return 0; |
| 347 | 347 |
| 348 const AtomicString& id = element->getIdAttribute(); | 348 const AtomicString& id = element->getIdAttribute(); |
| 349 if (!id.isEmpty()) { | 349 if (!id.isEmpty()) { |
| 350 if (HTMLLabelElement* label = element->treeScope().labelElementForId(id)
) | 350 if (HTMLLabelElement* label = element->treeScope().labelElementForId(id)
) |
| 351 return label; | 351 return label; |
| 352 } | 352 } |
| 353 | 353 |
| 354 for (Element* parent = element->parentElement(); parent; parent = parent->pa
rentElement()) { | 354 return Traversal<HTMLLabelElement>::firstAncestor(*element); |
| 355 if (isHTMLLabelElement(*parent)) | |
| 356 return toHTMLLabelElement(parent); | |
| 357 } | |
| 358 | |
| 359 return 0; | |
| 360 } | 355 } |
| 361 | 356 |
| 362 AXObject* AXNodeObject::menuButtonForMenu() const | 357 AXObject* AXNodeObject::menuButtonForMenu() const |
| 363 { | 358 { |
| 364 Element* menuItem = menuItemElementForMenu(); | 359 Element* menuItem = menuItemElementForMenu(); |
| 365 | 360 |
| 366 if (menuItem) { | 361 if (menuItem) { |
| 367 // ARIA just has generic menu items. AppKit needs to know if this is a t
op level items like MenuBarButton or MenuBarItem | 362 // ARIA just has generic menu items. AppKit needs to know if this is a t
op level items like MenuBarButton or MenuBarItem |
| 368 AXObject* menuItemAX = axObjectCache()->getOrCreate(menuItem); | 363 AXObject* menuItemAX = axObjectCache()->getOrCreate(menuItem); |
| 369 if (menuItemAX && menuItemAX->isMenuButton()) | 364 if (menuItemAX && menuItemAX->isMenuButton()) |
| (...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 float range = maxValueForRange() - minValueForRange(); | 1699 float range = maxValueForRange() - minValueForRange(); |
| 1705 float value = valueForRange(); | 1700 float value = valueForRange(); |
| 1706 | 1701 |
| 1707 value += range * (percentChange / 100); | 1702 value += range * (percentChange / 100); |
| 1708 setValue(String::number(value)); | 1703 setValue(String::number(value)); |
| 1709 | 1704 |
| 1710 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); | 1705 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); |
| 1711 } | 1706 } |
| 1712 | 1707 |
| 1713 } // namespace blink | 1708 } // namespace blink |
| OLD | NEW |