diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-23 09:28:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-23 09:28:44 +0200 |
commit | 815f1ed417bd26fbe2abbdf20ac5d3423b30796c (patch) | |
tree | 923c9a9e2834ccab60f5caecfb8f0ac410c1dd9e /Source/WebCore/html/HTMLOptionElement.cpp | |
parent | b4ad5d9d2b96baacd0180ead50de5195ca78af2d (diff) | |
download | qtwebkit-815f1ed417bd26fbe2abbdf20ac5d3423b30796c.tar.gz |
Imported WebKit commit e65cbc5b6ac32627c797e7fc7f46eb7794410c92 (http://svn.webkit.org/repository/webkit/trunk@123308)
New snapshot with better configure tests
Diffstat (limited to 'Source/WebCore/html/HTMLOptionElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLOptionElement.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/WebCore/html/HTMLOptionElement.cpp b/Source/WebCore/html/HTMLOptionElement.cpp index 3691e8241..bb68a9d32 100644 --- a/Source/WebCore/html/HTMLOptionElement.cpp +++ b/Source/WebCore/html/HTMLOptionElement.cpp @@ -30,6 +30,7 @@ #include "Attribute.h" #include "Document.h" #include "ExceptionCode.h" +#include "HTMLDataListElement.h" #include "HTMLNames.h" #include "HTMLParserIdioms.h" #include "HTMLSelectElement.h" @@ -187,6 +188,12 @@ int HTMLOptionElement::index() const void HTMLOptionElement::parseAttribute(const Attribute& attribute) { +#if ENABLE(DATALIST_ELEMENT) + if (attribute.name() == valueAttr) { + if (HTMLDataListElement* dataList = ownerDataListElement()) + dataList->optionElementChildrenChanged(); + } else +#endif if (attribute.name() == disabledAttr) { bool oldDisabled = m_disabled; m_disabled = !attribute.isNull(); @@ -252,11 +259,27 @@ void HTMLOptionElement::setSelectedState(bool selected) void HTMLOptionElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) { +#if ENABLE(DATALIST_ELEMENT) + if (HTMLDataListElement* dataList = ownerDataListElement()) + dataList->optionElementChildrenChanged(); + else +#endif if (HTMLSelectElement* select = ownerSelectElement()) select->optionElementChildrenChanged(); HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); } +#if ENABLE(DATALIST_ELEMENT) +HTMLDataListElement* HTMLOptionElement::ownerDataListElement() const +{ + for (ContainerNode* parent = parentNode(); parent ; parent = parent->parentNode()) { + if (parent->hasTagName(datalistTag)) + return static_cast<HTMLDataListElement*>(parent); + } + return 0; +} +#endif + HTMLSelectElement* HTMLOptionElement::ownerSelectElement() const { ContainerNode* select = parentNode(); |