| 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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 collection->invalidateCache(); | 777 collection->invalidateCache(); |
| 778 } | 778 } |
| 779 | 779 |
| 780 void HTMLSelectElement::setRecalcListItems() | 780 void HTMLSelectElement::setRecalcListItems() |
| 781 { | 781 { |
| 782 // FIXME: This function does a bunch of confusing things depending on if it | 782 // FIXME: This function does a bunch of confusing things depending on if it |
| 783 // is in the document or not. | 783 // is in the document or not. |
| 784 | 784 |
| 785 m_shouldRecalcListItems = true; | 785 m_shouldRecalcListItems = true; |
| 786 setOptionsChangedOnLayoutObject(); | 786 setOptionsChangedOnLayoutObject(); |
| 787 if (!inDocument()) { | 787 if (!inShadowIncludingDocument()) { |
| 788 if (HTMLOptionsCollection* collection = cachedCollection<HTMLOptionsColl
ection>(SelectOptions)) | 788 if (HTMLOptionsCollection* collection = cachedCollection<HTMLOptionsColl
ection>(SelectOptions)) |
| 789 collection->invalidateCache(); | 789 collection->invalidateCache(); |
| 790 invalidateSelectedItems(); | 790 invalidateSelectedItems(); |
| 791 } | 791 } |
| 792 | 792 |
| 793 if (layoutObject()) { | 793 if (layoutObject()) { |
| 794 if (AXObjectCache* cache = layoutObject()->document().existingAXObjectCa
che()) | 794 if (AXObjectCache* cache = layoutObject()->document().existingAXObjectCa
che()) |
| 795 cache->childrenChanged(this); | 795 cache->childrenChanged(this); |
| 796 } | 796 } |
| 797 } | 797 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 // the option because the task should work even if unselected option is | 939 // the option because the task should work even if unselected option is |
| 940 // inserted before executing scrollToOptionTask(). | 940 // inserted before executing scrollToOptionTask(). |
| 941 m_optionToScrollTo = option; | 941 m_optionToScrollTo = option; |
| 942 if (!hasPendingTask) | 942 if (!hasPendingTask) |
| 943 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLSelectEle
ment::scrollToOptionTask, RawPtr<HTMLSelectElement>(this))); | 943 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLSelectEle
ment::scrollToOptionTask, RawPtr<HTMLSelectElement>(this))); |
| 944 } | 944 } |
| 945 | 945 |
| 946 void HTMLSelectElement::scrollToOptionTask() | 946 void HTMLSelectElement::scrollToOptionTask() |
| 947 { | 947 { |
| 948 RawPtr<HTMLOptionElement> option = m_optionToScrollTo.release(); | 948 RawPtr<HTMLOptionElement> option = m_optionToScrollTo.release(); |
| 949 if (!option || !inDocument()) | 949 if (!option || !inShadowIncludingDocument()) |
| 950 return; | 950 return; |
| 951 // optionRemoved() makes sure m_optionToScrollTo doesn't have an option with | 951 // optionRemoved() makes sure m_optionToScrollTo doesn't have an option with |
| 952 // another owner. | 952 // another owner. |
| 953 ASSERT(option->ownerSelectElement() == this); | 953 ASSERT(option->ownerSelectElement() == this); |
| 954 document().updateLayoutIgnorePendingStylesheets(); | 954 document().updateLayoutIgnorePendingStylesheets(); |
| 955 if (!layoutObject() || !layoutObject()->isListBox()) | 955 if (!layoutObject() || !layoutObject()->isListBox()) |
| 956 return; | 956 return; |
| 957 LayoutRect bounds = option->boundingBox(); | 957 LayoutRect bounds = option->boundingBox(); |
| 958 toLayoutListBox(layoutObject())->scrollToRect(bounds); | 958 toLayoutListBox(layoutObject())->scrollToRect(bounds); |
| 959 } | 959 } |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 m_popupIsVisible = false; | 1985 m_popupIsVisible = false; |
| 1986 m_popup = nullptr; | 1986 m_popup = nullptr; |
| 1987 } | 1987 } |
| 1988 | 1988 |
| 1989 void HTMLSelectElement::resetTypeAheadSessionForTesting() | 1989 void HTMLSelectElement::resetTypeAheadSessionForTesting() |
| 1990 { | 1990 { |
| 1991 m_typeAhead.resetSession(); | 1991 m_typeAhead.resetSession(); |
| 1992 } | 1992 } |
| 1993 | 1993 |
| 1994 } // namespace blink | 1994 } // namespace blink |
| OLD | NEW |