| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
| 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 10 * | 10 * |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 if (!option) | 935 if (!option) |
| 936 return; | 936 return; |
| 937 if (usesMenuList()) | 937 if (usesMenuList()) |
| 938 return; | 938 return; |
| 939 bool hasPendingTask = m_optionToScrollTo; | 939 bool hasPendingTask = m_optionToScrollTo; |
| 940 // We'd like to keep an HTMLOptionElement reference rather than the index of | 940 // We'd like to keep an HTMLOptionElement reference rather than the index of |
| 941 // the option because the task should work even if unselected option is | 941 // the option because the task should work even if unselected option is |
| 942 // inserted before executing scrollToOptionTask(). | 942 // inserted before executing scrollToOptionTask(). |
| 943 m_optionToScrollTo = option; | 943 m_optionToScrollTo = option; |
| 944 if (!hasPendingTask) | 944 if (!hasPendingTask) |
| 945 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLSelectEle
ment::scrollToOptionTask, this)); | 945 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLSelectEle
ment::scrollToOptionTask, wrapCrossThreadPersistent(this))); |
| 946 } | 946 } |
| 947 | 947 |
| 948 void HTMLSelectElement::scrollToOptionTask() | 948 void HTMLSelectElement::scrollToOptionTask() |
| 949 { | 949 { |
| 950 HTMLOptionElement* option = m_optionToScrollTo.release(); | 950 HTMLOptionElement* option = m_optionToScrollTo.release(); |
| 951 if (!option || !inShadowIncludingDocument()) | 951 if (!option || !inShadowIncludingDocument()) |
| 952 return; | 952 return; |
| 953 // optionRemoved() makes sure m_optionToScrollTo doesn't have an option with | 953 // optionRemoved() makes sure m_optionToScrollTo doesn't have an option with |
| 954 // another owner. | 954 // another owner. |
| 955 ASSERT(option->ownerSelectElement() == this); | 955 ASSERT(option->ownerSelectElement() == this); |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 } | 2075 } |
| 2076 | 2076 |
| 2077 void HTMLSelectElement::didMutateSubtree() | 2077 void HTMLSelectElement::didMutateSubtree() |
| 2078 { | 2078 { |
| 2079 DCHECK(popupIsVisible()); | 2079 DCHECK(popupIsVisible()); |
| 2080 DCHECK(m_popup); | 2080 DCHECK(m_popup); |
| 2081 m_popup->updateFromElement(PopupMenu::ByDOMChange); | 2081 m_popup->updateFromElement(PopupMenu::ByDOMChange); |
| 2082 } | 2082 } |
| 2083 | 2083 |
| 2084 } // namespace blink | 2084 } // namespace blink |
| OLD | NEW |