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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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
OLDNEW
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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 } 742 }
743 743
744 void HTMLSelectElement::setRecalcListItems() 744 void HTMLSelectElement::setRecalcListItems()
745 { 745 {
746 // FIXME: This function does a bunch of confusing things depending on if it 746 // FIXME: This function does a bunch of confusing things depending on if it
747 // is in the document or not. 747 // is in the document or not.
748 748
749 m_shouldRecalcListItems = true; 749 m_shouldRecalcListItems = true;
750 750
751 setOptionsChangedOnLayoutObject(); 751 setOptionsChangedOnLayoutObject();
752 if (!inShadowIncludingDocument()) { 752 if (!isConnected()) {
753 if (HTMLOptionsCollection* collection = cachedCollection<HTMLOptionsColl ection>(SelectOptions)) 753 if (HTMLOptionsCollection* collection = cachedCollection<HTMLOptionsColl ection>(SelectOptions))
754 collection->invalidateCache(); 754 collection->invalidateCache();
755 invalidateSelectedItems(); 755 invalidateSelectedItems();
756 } 756 }
757 757
758 if (layoutObject()) { 758 if (layoutObject()) {
759 if (AXObjectCache* cache = layoutObject()->document().existingAXObjectCa che()) 759 if (AXObjectCache* cache = layoutObject()->document().existingAXObjectCa che())
760 cache->childrenChanged(this); 760 cache->childrenChanged(this);
761 } 761 }
762 } 762 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 // the option because the task should work even if unselected option is 898 // the option because the task should work even if unselected option is
899 // inserted before executing scrollToOptionTask(). 899 // inserted before executing scrollToOptionTask().
900 m_optionToScrollTo = option; 900 m_optionToScrollTo = option;
901 if (!hasPendingTask) 901 if (!hasPendingTask)
902 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLSelectEle ment::scrollToOptionTask, wrapPersistent(this))); 902 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLSelectEle ment::scrollToOptionTask, wrapPersistent(this)));
903 } 903 }
904 904
905 void HTMLSelectElement::scrollToOptionTask() 905 void HTMLSelectElement::scrollToOptionTask()
906 { 906 {
907 HTMLOptionElement* option = m_optionToScrollTo.release(); 907 HTMLOptionElement* option = m_optionToScrollTo.release();
908 if (!option || !inShadowIncludingDocument()) 908 if (!option || !isConnected())
909 return; 909 return;
910 // optionRemoved() makes sure m_optionToScrollTo doesn't have an option with 910 // optionRemoved() makes sure m_optionToScrollTo doesn't have an option with
911 // another owner. 911 // another owner.
912 ASSERT(option->ownerSelectElement() == this); 912 ASSERT(option->ownerSelectElement() == this);
913 document().updateStyleAndLayoutIgnorePendingStylesheets(); 913 document().updateStyleAndLayoutIgnorePendingStylesheets();
914 if (!layoutObject() || !layoutObject()->isListBox()) 914 if (!layoutObject() || !layoutObject()->isListBox())
915 return; 915 return;
916 LayoutRect bounds = option->boundingBox(); 916 LayoutRect bounds = option->boundingBox();
917 toLayoutListBox(layoutObject())->scrollToRect(bounds); 917 toLayoutListBox(layoutObject())->scrollToRect(bounds);
918 } 918 }
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 } 2063 }
2064 2064
2065 void HTMLSelectElement::didMutateSubtree() 2065 void HTMLSelectElement::didMutateSubtree()
2066 { 2066 {
2067 DCHECK(popupIsVisible()); 2067 DCHECK(popupIsVisible());
2068 DCHECK(m_popup); 2068 DCHECK(m_popup);
2069 m_popup->updateFromElement(PopupMenu::ByDOMChange); 2069 m_popup->updateFromElement(PopupMenu::ByDOMChange);
2070 } 2070 }
2071 2071
2072 } // namespace blink 2072 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLScriptElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLShadowElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698