diff options
author | Kristian Monsen <kristianm@google.com> | 2010-07-30 10:46:49 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-08-04 13:01:34 +0100 |
commit | 0617145a89917ae7735fe1c9538688ab9a577df5 (patch) | |
tree | 56206078694427c37ed7bdf27eb5221398b833c0 /WebCore/wml | |
parent | ef1adcdfc805d4d13103f6f15cc5b4d96828a60f (diff) | |
download | external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.zip external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.gz external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.bz2 |
Merge WebKit at r64264 : Initial merge by git.
Change-Id: Ic42bef02efef8217a0f84c47176a9c617c28d1f1
Diffstat (limited to 'WebCore/wml')
-rw-r--r-- | WebCore/wml/WMLGoElement.cpp | 33 | ||||
-rw-r--r-- | WebCore/wml/WMLGoElement.h | 4 | ||||
-rw-r--r-- | WebCore/wml/WMLInputElement.h | 1 |
3 files changed, 20 insertions, 18 deletions
diff --git a/WebCore/wml/WMLGoElement.cpp b/WebCore/wml/WMLGoElement.cpp index db4880c..9b329d7 100644 --- a/WebCore/wml/WMLGoElement.cpp +++ b/WebCore/wml/WMLGoElement.cpp @@ -25,6 +25,7 @@ #include "Attribute.h" #include "FormData.h" +#include "FormSubmission.h" #include "Frame.h" #include "FrameLoader.h" #include "HTMLNames.h" @@ -64,11 +65,11 @@ void WMLGoElement::deregisterPostfieldElement(WMLPostfieldElement* postfield) void WMLGoElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == HTMLNames::methodAttr) - m_formDataBuilder.parseMethodType(attr->value()); + m_formAttributes.parseMethodType(attr->value()); else if (attr->name() == HTMLNames::enctypeAttr) - m_formDataBuilder.parseEncodingType(parseValueSubstitutingVariableReferences(attr->value())); + m_formAttributes.parseEncodingType(parseValueSubstitutingVariableReferences(attr->value())); else if (attr->name() == HTMLNames::accept_charsetAttr) - m_formDataBuilder.setAcceptCharset(parseValueForbiddingVariableReferences(attr->value())); + m_formAttributes.setAcceptCharset(parseValueForbiddingVariableReferences(attr->value())); else WMLTaskElement::parseMappedAttribute(attr); } @@ -126,7 +127,7 @@ void WMLGoElement::executeTask() String cacheControl = getAttribute(cache_controlAttr); - if (m_formDataBuilder.isPostMethod()) + if (m_formAttributes.method() == FormSubmission::PostMethod) preparePOSTRequest(request, inSameDeck, cacheControl); else prepareGETRequest(request, url); @@ -153,14 +154,14 @@ void WMLGoElement::preparePOSTRequest(ResourceRequest& request, bool inSameDeck, RefPtr<FormData> data; - if (m_formDataBuilder.isMultiPartForm()) { // multipart/form-data - Vector<char> boundary = m_formDataBuilder.generateUniqueBoundaryString(); + if (m_formAttributes.isMultiPartForm()) { // multipart/form-data + Vector<char> boundary = FormDataBuilder::generateUniqueBoundaryString(); data = createFormData(boundary.data()); - request.setHTTPContentType(m_formDataBuilder.encodingType() + "; boundary=" + boundary.data()); + request.setHTTPContentType(m_formAttributes.encodingType() + "; boundary=" + boundary.data()); } else { // text/plain or application/x-www-form-urlencoded data = createFormData(CString()); - request.setHTTPContentType(m_formDataBuilder.encodingType()); + request.setHTTPContentType(m_formAttributes.encodingType()); } request.setHTTPBody(data.get()); @@ -171,7 +172,7 @@ void WMLGoElement::prepareGETRequest(ResourceRequest& request, const KURL& url) request.setHTTPMethod("GET"); // Eventually display error message? - if (m_formDataBuilder.isMultiPartForm()) + if (m_formAttributes.isMultiPartForm()) return; RefPtr<FormData> data = createFormData(CString()); @@ -187,7 +188,7 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary) CString value; Vector<char> encodedData; - TextEncoding encoding = m_formDataBuilder.dataEncoding(document()).encodingForFormSubmission(); + TextEncoding encoding = FormDataBuilder::encodingFromAcceptCharset(m_formAttributes.acceptCharset(), document()).encodingForFormSubmission(); Vector<WMLPostfieldElement*>::iterator it = m_postfieldElements.begin(); Vector<WMLPostfieldElement*>::iterator end = m_postfieldElements.end(); @@ -196,10 +197,10 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary) for (; it != end; ++it) { (*it)->encodeData(encoding, key, value); - if (m_formDataBuilder.isMultiPartForm()) { + if (m_formAttributes.isMultiPartForm()) { Vector<char> header; - m_formDataBuilder.beginMultiPartHeader(header, boundary, key); - m_formDataBuilder.finishMultiPartHeader(header); + FormDataBuilder::beginMultiPartHeader(header, boundary, key); + FormDataBuilder::finishMultiPartHeader(header); result->appendData(header.data(), header.size()); if (size_t dataSize = value.length()) @@ -207,11 +208,11 @@ PassRefPtr<FormData> WMLGoElement::createFormData(const CString& boundary) result->appendData("\r\n", 2); } else - m_formDataBuilder.addKeyValuePairAsFormData(encodedData, key, value); + FormDataBuilder::addKeyValuePairAsFormData(encodedData, key, value); } - if (m_formDataBuilder.isMultiPartForm()) - m_formDataBuilder.addBoundaryToMultiPartHeader(encodedData, boundary, true); + if (m_formAttributes.isMultiPartForm()) + FormDataBuilder::addBoundaryToMultiPartHeader(encodedData, boundary, true); result->appendData(encodedData.data(), encodedData.size()); return result; diff --git a/WebCore/wml/WMLGoElement.h b/WebCore/wml/WMLGoElement.h index f602a39..d7f8991 100644 --- a/WebCore/wml/WMLGoElement.h +++ b/WebCore/wml/WMLGoElement.h @@ -22,7 +22,7 @@ #define WMLGoElement_h #if ENABLE(WML) -#include "FormDataBuilder.h" +#include "FormSubmission.h" #include "WMLTaskElement.h" namespace WebCore { @@ -48,7 +48,7 @@ private: PassRefPtr<FormData> createFormData(const CString& boundary); Vector<WMLPostfieldElement*> m_postfieldElements; - FormDataBuilder m_formDataBuilder; + FormSubmission::Attributes m_formAttributes; }; } diff --git a/WebCore/wml/WMLInputElement.h b/WebCore/wml/WMLInputElement.h index b8748fd..fe1ae89 100644 --- a/WebCore/wml/WMLInputElement.h +++ b/WebCore/wml/WMLInputElement.h @@ -96,6 +96,7 @@ private: friend class WMLCardElement; void initialize(); + virtual bool supportsMaxLength() const { return true; } String validateInputMask(const String&); unsigned cursorPositionToMaskIndex(unsigned); String constrainValue(const String&) const; |