Commit 8f35f0e6 authored by rniwa@webkit.org's avatar rniwa@webkit.org

fast/forms/suggested-value-crash.html crashes on Windows

https://bugs.webkit.org/show_bug.cgi?id=67688

Reviewed by Adam Barth.

Source/WebCore: 

The crash was caused because functions in internals were accessing uninitialized QualifiedNames.
Fixed the bug by avoiding to link to inputTag and textareaTag. Instead, we resort to toInputElement
and string comparison.

* testing/Internals.cpp:
(WebCore::Internals::wasLastChangeUserEdit):
(WebCore::Internals::suggestedValue):
(WebCore::Internals::setSuggestedValue):

Source/WebKit2: 

Removed sybmols for inputTag and textareaTag. Added the symbol for StringImpl::equal.

* win/WebKit2.def:
* win/WebKit2CFLite.def:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5c17ddf0
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
fast/forms/suggested-value-crash.html crashes on Windows
https://bugs.webkit.org/show_bug.cgi?id=67688
Reviewed by Adam Barth.
The crash was caused because functions in internals were accessing uninitialized QualifiedNames.
Fixed the bug by avoiding to link to inputTag and textareaTag. Instead, we resort to toInputElement
and string comparison.
* testing/Internals.cpp:
(WebCore::Internals::wasLastChangeUserEdit):
(WebCore::Internals::suggestedValue):
(WebCore::Internals::setSuggestedValue):
2011-09-06 Mark Hahnenberg <mhahnenberg@apple.com>
Unzip initialization lists and constructors in JSCell hierarchy (5/7)
......@@ -293,44 +293,47 @@ bool Internals::wasLastChangeUserEdit(Element* textField, ExceptionCode& ec)
return false;
}
if (textField->hasTagName(HTMLNames::inputTag))
return static_cast<HTMLInputElement*>(textField)->lastChangeWasUserEdit();
if (HTMLInputElement* inputElement = textField->toInputElement())
return inputElement->lastChangeWasUserEdit();
if (textField->hasTagName(HTMLNames::textareaTag))
// FIXME: We should be using hasTagName instead but Windows port doesn't link QualifiedNames properly.
if (textField->tagName() == "TEXTAREA")
return static_cast<HTMLTextAreaElement*>(textField)->lastChangeWasUserEdit();
ec = INVALID_NODE_TYPE_ERR;
return false;
}
String Internals::suggestedValue(Element* inputElement, ExceptionCode& ec)
String Internals::suggestedValue(Element* element, ExceptionCode& ec)
{
if (!inputElement) {
if (!element) {
ec = INVALID_ACCESS_ERR;
return String();
}
if (!inputElement->hasTagName(HTMLNames::inputTag)) {
HTMLInputElement* inputElement = element->toInputElement();
if (!inputElement) {
ec = INVALID_NODE_TYPE_ERR;
return String();
}
return static_cast<HTMLInputElement*>(inputElement)->suggestedValue();
return inputElement->suggestedValue();
}
void Internals::setSuggestedValue(Element* inputElement, const String& value, ExceptionCode& ec)
void Internals::setSuggestedValue(Element* element, const String& value, ExceptionCode& ec)
{
if (!inputElement) {
if (!element) {
ec = INVALID_ACCESS_ERR;
return;
}
if (!inputElement->hasTagName(HTMLNames::inputTag)) {
HTMLInputElement* inputElement = element->toInputElement();
if (!inputElement) {
ec = INVALID_NODE_TYPE_ERR;
return;
}
static_cast<HTMLInputElement*>(inputElement)->setSuggestedValue(value);
inputElement->setSuggestedValue(value);
}
}
2011-09-06 Ryosuke Niwa <rniwa@webkit.org>
fast/forms/suggested-value-crash.html crashes on Windows
https://bugs.webkit.org/show_bug.cgi?id=67688
Reviewed by Adam Barth.
Removed sybmols for inputTag and textareaTag. Added the symbol for StringImpl::equal.
* win/WebKit2.def:
* win/WebKit2CFLite.def:
2011-09-06 Mark Hahnenberg <mhahnenberg@apple.com>
Unzip initialization lists and constructors in JSCell hierarchy (5/7)
......
......@@ -151,11 +151,11 @@ EXPORTS
?create@ShadowContentElement@WebCore@@SA?AV?$PassRefPtr@VShadowContentElement@WebCore@@@WTF@@PAVDocument@2@@Z
?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
?equal@WTF@@YA_NPBVStringImpl@1@PBD@Z
?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@@Z
......@@ -169,7 +169,6 @@ EXPORTS
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
?textareaTag@HTMLNames@WebCore@@3VQualifiedName@2@B
?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z
......
......@@ -143,11 +143,11 @@ EXPORTS
?create@ShadowContentElement@WebCore@@SA?AV?$PassRefPtr@VShadowContentElement@WebCore@@@WTF@@PAVDocument@2@@Z
?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
?equal@WTF@@YA_NPBVStringImpl@1@PBD@Z
?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z
?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
......@@ -163,7 +163,6 @@ EXPORTS
?settings@Document@WebCore@@QBEPAVSettings@2@XZ
?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ
?textareaTag@HTMLNames@WebCore@@3VQualifiedName@2@B
?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment