| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the select element renderer in WebCore. | 2 * This file is part of the select element renderer in WebCore. |
| 3 * | 3 * |
| 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 void RenderMenuList::listBoxSelectItem(int listIndex, bool allowMultiplySelectio
ns, bool shift, bool fireOnChangeNow) | 379 void RenderMenuList::listBoxSelectItem(int listIndex, bool allowMultiplySelectio
ns, bool shift, bool fireOnChangeNow) |
| 380 { | 380 { |
| 381 selectElement()->listBoxSelectItem(listIndex, allowMultiplySelections, shift
, fireOnChangeNow); | 381 selectElement()->listBoxSelectItem(listIndex, allowMultiplySelections, shift
, fireOnChangeNow); |
| 382 } | 382 } |
| 383 | 383 |
| 384 bool RenderMenuList::multiple() const | 384 bool RenderMenuList::multiple() const |
| 385 { | 385 { |
| 386 return selectElement()->multiple(); | 386 return selectElement()->multiple(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 IntRect RenderMenuList::elementRectRelativeToRootView() const | |
| 390 { | |
| 391 return selectElement()->document().view()->contentsToRootView(pixelSnappedIn
tRect(absoluteBoundingBoxRect())); | |
| 392 } | |
| 393 | |
| 394 Element& RenderMenuList::ownerElement() const | |
| 395 { | |
| 396 return *selectElement(); | |
| 397 } | |
| 398 | |
| 399 RenderStyle* RenderMenuList::renderStyleForItem(Element& element) const | |
| 400 { | |
| 401 return element.renderStyle() ? element.renderStyle() : element.computedStyle
(); | |
| 402 } | |
| 403 | |
| 404 void RenderMenuList::didSetSelectedIndex(int listIndex) | 389 void RenderMenuList::didSetSelectedIndex(int listIndex) |
| 405 { | 390 { |
| 406 didUpdateActiveOption(selectElement()->listToOptionIndex(listIndex)); | 391 didUpdateActiveOption(selectElement()->listToOptionIndex(listIndex)); |
| 407 } | 392 } |
| 408 | 393 |
| 409 void RenderMenuList::didUpdateActiveOption(int optionIndex) | 394 void RenderMenuList::didUpdateActiveOption(int optionIndex) |
| 410 { | 395 { |
| 411 if (!document().existingAXObjectCache()) | 396 if (!document().existingAXObjectCache()) |
| 412 return; | 397 return; |
| 413 | 398 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 HTMLElement* element = listItems[listIndex]; | 584 HTMLElement* element = listItems[listIndex]; |
| 600 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 585 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
| 601 } | 586 } |
| 602 | 587 |
| 603 void RenderMenuList::setTextFromItem(unsigned listIndex) | 588 void RenderMenuList::setTextFromItem(unsigned listIndex) |
| 604 { | 589 { |
| 605 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 590 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
| 606 } | 591 } |
| 607 | 592 |
| 608 } // namespace blink | 593 } // namespace blink |
| OLD | NEW |