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

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

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 HTMLInputElement::~HTMLInputElement() 169 HTMLInputElement::~HTMLInputElement()
170 { 170 {
171 #if !ENABLE(OILPAN) 171 #if !ENABLE(OILPAN)
172 // Need to remove form association while this is still an HTMLInputElement 172 // Need to remove form association while this is still an HTMLInputElement
173 // so that virtual functions are called correctly. 173 // so that virtual functions are called correctly.
174 setForm(0); 174 setForm(0);
175 // setForm(0) may register this to a TreeScope-level radio button group. 175 // setForm(0) may register this to a TreeScope-level radio button group.
176 // We should unregister it to avoid accessing a deleted object. 176 // We should unregister it to avoid accessing a deleted object.
177 if (type() == InputTypeNames::radio) 177 if (type() == InputTypeNames::radio)
178 treeScope().radioButtonGroupScope().removeButton(this); 178 treeScopeOrDocument().radioButtonGroupScope().removeButton(this);
179 179
180 // TODO(dtapuska): Make this passive touch listener see crbug.com/584438 180 // TODO(dtapuska): Make this passive touch listener see crbug.com/584438
181 if (m_hasTouchEventHandler && document().frameHost()) 181 if (m_hasTouchEventHandler && document().frameHost())
182 document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*th is, EventHandlerRegistry::TouchEventBlocking); 182 document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*th is, EventHandlerRegistry::TouchEventBlocking);
183 #endif 183 #endif
184 } 184 }
185 185
186 const AtomicString& HTMLInputElement::name() const 186 const AtomicString& HTMLInputElement::name() const
187 { 187 {
188 return m_name.isNull() ? emptyAtom : m_name; 188 return m_name.isNull() ? emptyAtom : m_name;
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 resetListAttributeTargetObserver(); 1539 resetListAttributeTargetObserver();
1540 } 1540 }
1541 1541
1542 void HTMLInputElement::didMoveToNewDocument(Document& oldDocument) 1542 void HTMLInputElement::didMoveToNewDocument(Document& oldDocument)
1543 { 1543 {
1544 if (imageLoader()) 1544 if (imageLoader())
1545 imageLoader()->elementDidMoveToNewDocument(); 1545 imageLoader()->elementDidMoveToNewDocument();
1546 1546
1547 // FIXME: Remove type check. 1547 // FIXME: Remove type check.
1548 if (type() == InputTypeNames::radio) 1548 if (type() == InputTypeNames::radio)
1549 treeScope().radioButtonGroupScope().removeButton(this); 1549 treeScopeOrDocument().radioButtonGroupScope().removeButton(this);
1550 1550
1551 updateTouchEventHandlerRegistry(); 1551 updateTouchEventHandlerRegistry();
1552 1552
1553 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument); 1553 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument);
1554 } 1554 }
1555 1555
1556 void HTMLInputElement::removeAllEventListeners() 1556 void HTMLInputElement::removeAllEventListeners()
1557 { 1557 {
1558 HTMLTextFormControlElement::removeAllEventListeners(); 1558 HTMLTextFormControlElement::removeAllEventListeners();
1559 m_hasTouchEventHandler = false; 1559 m_hasTouchEventHandler = false;
(...skipping 30 matching lines...) Expand all
1590 } 1590 }
1591 1591
1592 HTMLDataListElement* HTMLInputElement::dataList() const 1592 HTMLDataListElement* HTMLInputElement::dataList() const
1593 { 1593 {
1594 if (!m_hasNonEmptyList) 1594 if (!m_hasNonEmptyList)
1595 return nullptr; 1595 return nullptr;
1596 1596
1597 if (!m_inputType->shouldRespectListAttribute()) 1597 if (!m_inputType->shouldRespectListAttribute())
1598 return nullptr; 1598 return nullptr;
1599 1599
1600 Element* element = treeScope().getElementById(fastGetAttribute(listAttr)); 1600 Element* element = treeScopeOrDocument().getElementById(fastGetAttribute(lis tAttr));
1601 if (!element) 1601 if (!element)
1602 return nullptr; 1602 return nullptr;
1603 if (!isHTMLDataListElement(*element)) 1603 if (!isHTMLDataListElement(*element))
1604 return nullptr; 1604 return nullptr;
1605 1605
1606 return toHTMLDataListElement(element); 1606 return toHTMLDataListElement(element);
1607 } 1607 }
1608 1608
1609 bool HTMLInputElement::hasValidDataListOptions() const 1609 bool HTMLInputElement::hasValidDataListOptions() const
1610 { 1610 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 } 1754 }
1755 1755
1756 RadioButtonGroupScope* HTMLInputElement::radioButtonGroupScope() const 1756 RadioButtonGroupScope* HTMLInputElement::radioButtonGroupScope() const
1757 { 1757 {
1758 // FIXME: Remove type check. 1758 // FIXME: Remove type check.
1759 if (type() != InputTypeNames::radio) 1759 if (type() != InputTypeNames::radio)
1760 return nullptr; 1760 return nullptr;
1761 if (HTMLFormElement* formElement = form()) 1761 if (HTMLFormElement* formElement = form())
1762 return &formElement->radioButtonGroupScope(); 1762 return &formElement->radioButtonGroupScope();
1763 if (inShadowIncludingDocument()) 1763 if (inShadowIncludingDocument())
1764 return &treeScope().radioButtonGroupScope(); 1764 return &treeScopeOrDocument().radioButtonGroupScope();
1765 return nullptr; 1765 return nullptr;
1766 } 1766 }
1767 1767
1768 unsigned HTMLInputElement::sizeOfRadioGroup() const 1768 unsigned HTMLInputElement::sizeOfRadioGroup() const
1769 { 1769 {
1770 RadioButtonGroupScope* scope = radioButtonGroupScope(); 1770 RadioButtonGroupScope* scope = radioButtonGroupScope();
1771 if (!scope) 1771 if (!scope)
1772 return 0; 1772 return 0;
1773 return scope->groupSizeFor(this); 1773 return scope->groupSizeFor(this);
1774 } 1774 }
(...skipping 29 matching lines...) Expand all
1804 { 1804 {
1805 setUnsignedIntegralAttribute(widthAttr, width); 1805 setUnsignedIntegralAttribute(widthAttr, width);
1806 } 1806 }
1807 1807
1808 ListAttributeTargetObserver* ListAttributeTargetObserver::create(const AtomicStr ing& id, HTMLInputElement* element) 1808 ListAttributeTargetObserver* ListAttributeTargetObserver::create(const AtomicStr ing& id, HTMLInputElement* element)
1809 { 1809 {
1810 return new ListAttributeTargetObserver(id, element); 1810 return new ListAttributeTargetObserver(id, element);
1811 } 1811 }
1812 1812
1813 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement* element) 1813 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement* element)
1814 : IdTargetObserver(element->treeScope().idTargetObserverRegistry(), id) 1814 : IdTargetObserver(element->treeScopeOrDocument().idTargetObserverRegistry() , id)
1815 , m_element(element) 1815 , m_element(element)
1816 { 1816 {
1817 } 1817 }
1818 1818
1819 DEFINE_TRACE(ListAttributeTargetObserver) 1819 DEFINE_TRACE(ListAttributeTargetObserver)
1820 { 1820 {
1821 visitor->trace(m_element); 1821 visitor->trace(m_element);
1822 IdTargetObserver::trace(visitor); 1822 IdTargetObserver::trace(visitor);
1823 } 1823 }
1824 1824
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 void HTMLInputElement::ensurePrimaryContent() 1945 void HTMLInputElement::ensurePrimaryContent()
1946 { 1946 {
1947 m_inputTypeView->ensurePrimaryContent(); 1947 m_inputTypeView->ensurePrimaryContent();
1948 } 1948 }
1949 1949
1950 bool HTMLInputElement::hasFallbackContent() const 1950 bool HTMLInputElement::hasFallbackContent() const
1951 { 1951 {
1952 return m_inputTypeView->hasFallbackContent(); 1952 return m_inputTypeView->hasFallbackContent();
1953 } 1953 }
1954 } // namespace blink 1954 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLLabelElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698