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

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

Issue 371413004: Fix for input/datalist failure when datalist is created outside document (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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) 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 } else if (name == disabledAttr) { 720 } else if (name == disabledAttr) {
721 HTMLTextFormControlElement::parseAttribute(name, value); 721 HTMLTextFormControlElement::parseAttribute(name, value);
722 m_inputTypeView->disabledAttributeChanged(); 722 m_inputTypeView->disabledAttributeChanged();
723 } else if (name == readonlyAttr) { 723 } else if (name == readonlyAttr) {
724 HTMLTextFormControlElement::parseAttribute(name, value); 724 HTMLTextFormControlElement::parseAttribute(name, value);
725 m_inputTypeView->readonlyAttributeChanged(); 725 m_inputTypeView->readonlyAttributeChanged();
726 } else if (name == listAttr) { 726 } else if (name == listAttr) {
727 m_hasNonEmptyList = !value.isEmpty(); 727 m_hasNonEmptyList = !value.isEmpty();
728 if (m_hasNonEmptyList) { 728 if (m_hasNonEmptyList) {
729 resetListAttributeTargetObserver(); 729 resetListAttributeTargetObserver();
730 listAttributeTargetChanged();
731 } 730 }
732 UseCounter::count(document(), UseCounter::ListAttribute); 731 UseCounter::count(document(), UseCounter::ListAttribute);
733 } else if (name == webkitdirectoryAttr) { 732 } else if (name == webkitdirectoryAttr) {
734 HTMLTextFormControlElement::parseAttribute(name, value); 733 HTMLTextFormControlElement::parseAttribute(name, value);
735 UseCounter::count(document(), UseCounter::PrefixedDirectoryAttribute); 734 UseCounter::count(document(), UseCounter::PrefixedDirectoryAttribute);
736 } 735 }
737 else 736 else
738 HTMLTextFormControlElement::parseAttribute(name, value); 737 HTMLTextFormControlElement::parseAttribute(name, value);
739 m_inputTypeView->attributeChanged(); 738 m_inputTypeView->attributeChanged();
740 } 739 }
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 1532
1534 void HTMLInputElement::setListAttributeTargetObserver(PassOwnPtrWillBeRawPtr<Lis tAttributeTargetObserver> newObserver) 1533 void HTMLInputElement::setListAttributeTargetObserver(PassOwnPtrWillBeRawPtr<Lis tAttributeTargetObserver> newObserver)
1535 { 1534 {
1536 if (m_listAttributeTargetObserver) 1535 if (m_listAttributeTargetObserver)
1537 m_listAttributeTargetObserver->unregister(); 1536 m_listAttributeTargetObserver->unregister();
1538 m_listAttributeTargetObserver = newObserver; 1537 m_listAttributeTargetObserver = newObserver;
1539 } 1538 }
1540 1539
1541 void HTMLInputElement::resetListAttributeTargetObserver() 1540 void HTMLInputElement::resetListAttributeTargetObserver()
1542 { 1541 {
1542 listAttributeTargetChanged();
1543 if (inDocument()) 1543 if (inDocument())
1544 setListAttributeTargetObserver(ListAttributeTargetObserver::create(fastG etAttribute(listAttr), this)); 1544 setListAttributeTargetObserver(ListAttributeTargetObserver::create(fastG etAttribute(listAttr), this));
1545 else 1545 else
1546 setListAttributeTargetObserver(nullptr); 1546 setListAttributeTargetObserver(nullptr);
1547 } 1547 }
1548 1548
1549 void HTMLInputElement::listAttributeTargetChanged() 1549 void HTMLInputElement::listAttributeTargetChanged()
1550 { 1550 {
1551 m_inputTypeView->listAttributeTargetChanged(); 1551 m_inputTypeView->listAttributeTargetChanged();
1552 } 1552 }
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); 1884 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer());
1885 } 1885 }
1886 #endif 1886 #endif
1887 1887
1888 bool HTMLInputElement::shouldDispatchFormControlChangeEvent(String& oldValue, St ring& newValue) 1888 bool HTMLInputElement::shouldDispatchFormControlChangeEvent(String& oldValue, St ring& newValue)
1889 { 1889 {
1890 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue) ; 1890 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue) ;
1891 } 1891 }
1892 1892
1893 } // namespace 1893 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698