summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLSelectElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
commit49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch)
tree5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebCore/html/HTMLSelectElement.cpp
parentb211c645d8ab690f713515dfdc84d80b11c27d2c (diff)
downloadqtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebCore/html/HTMLSelectElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLSelectElement.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index d066c9fb0..a5d8ad2bc 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -33,6 +33,7 @@
#include "Chrome.h"
#include "ChromeClient.h"
#include "EventNames.h"
+#include "FormController.h"
#include "FormDataList.h"
#include "Frame.h"
#include "HTMLFormElement.h"
@@ -349,13 +350,6 @@ bool HTMLSelectElement::childShouldCreateRenderer(const NodeRenderingContext& ch
return childContext.isOnUpperEncapsulationBoundary() && HTMLFormControlElementWithState::childShouldCreateRenderer(childContext);
}
-HTMLCollection* HTMLSelectElement::selectedOptions()
-{
- if (!m_selectedOptionsCollection)
- m_selectedOptionsCollection = HTMLCollection::create(this, SelectedOptions);
- return m_selectedOptionsCollection.get();
-}
-
HTMLOptionsCollection* HTMLSelectElement::options()
{
if (!m_optionsCollection)
@@ -921,7 +915,7 @@ void HTMLSelectElement::deselectItemsWithoutValidation(HTMLElement* excludeEleme
}
}
-bool HTMLSelectElement::saveFormControlState(String& value) const
+FormControlState HTMLSelectElement::saveFormControlState() const
{
const Vector<HTMLElement*>& items = listItems();
size_t length = items.size();
@@ -932,21 +926,21 @@ bool HTMLSelectElement::saveFormControlState(String& value) const
bool selected = element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected();
builder.append(selected ? 'X' : '.');
}
- value = builder.toString();
- return true;
+ return FormControlState(builder.toString());
}
-void HTMLSelectElement::restoreFormControlState(const String& state)
+void HTMLSelectElement::restoreFormControlState(const FormControlState& state)
{
recalcListItems();
const Vector<HTMLElement*>& items = listItems();
size_t length = items.size();
+ String mask = state.value();
for (size_t i = 0; i < length; ++i) {
HTMLElement* element = items[i];
if (element->hasTagName(optionTag))
- toHTMLOptionElement(element)->setSelectedState(state[i] == 'X');
+ toHTMLOptionElement(element)->setSelectedState(mask[i] == 'X');
}
setOptionsChangedOnRenderer();
@@ -964,7 +958,7 @@ void HTMLSelectElement::parseMultipleAttribute(const Attribute& attribute)
bool HTMLSelectElement::appendFormData(FormDataList& list, bool)
{
- const AtomicString& name = formControlName();
+ const AtomicString& name = this->name();
if (name.isEmpty())
return false;