[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:37:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 20fb83c7550ca23075b65ffda03c35c8d3fe02f5
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Apr 21 23:45:34 2003 +0000
Reviewed by Maciej.
- fixed bug 3159076 -- turbotax.intuit.com forms have text fields instead of radio buttons
* khtml/html/html_formimpl.cpp:
(HTMLInputElementImpl::setType): Implement; loosen rule about what type changes are allowed.
(HTMLInputElementImpl::parseAttribute): Call setType for ATTR_TYPE.
- unrelated tweak
* kwq/KWQSlot.mm: (KWQSlot::KWQSlot): Use a macro here to make it a little easier to add items.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index dd037b3..7f46469 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,8 +1,16 @@
-2003-04-21 Chris Blumenberg <cblu at apple.com>
+2003-04-21 Darin Adler <darin at apple.com>
+
+ Reviewed by Maciej.
- Fixed previous "Reviewed by".
+ - fixed bug 3159076 -- turbotax.intuit.com forms have text fields instead of radio buttons
- * ChangeLog:
+ * khtml/html/html_formimpl.cpp:
+ (HTMLInputElementImpl::setType): Implement; loosen rule about what type changes are allowed.
+ (HTMLInputElementImpl::parseAttribute): Call setType for ATTR_TYPE.
+
+ - unrelated tweak
+
+ * kwq/KWQSlot.mm: (KWQSlot::KWQSlot): Use a macro here to make it a little easier to add items.
2003-04-21 Chris Blumenberg <cblu at apple.com>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index dd037b3..7f46469 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,8 +1,16 @@
-2003-04-21 Chris Blumenberg <cblu at apple.com>
+2003-04-21 Darin Adler <darin at apple.com>
+
+ Reviewed by Maciej.
- Fixed previous "Reviewed by".
+ - fixed bug 3159076 -- turbotax.intuit.com forms have text fields instead of radio buttons
- * ChangeLog:
+ * khtml/html/html_formimpl.cpp:
+ (HTMLInputElementImpl::setType): Implement; loosen rule about what type changes are allowed.
+ (HTMLInputElementImpl::parseAttribute): Call setType for ATTR_TYPE.
+
+ - unrelated tweak
+
+ * kwq/KWQSlot.mm: (KWQSlot::KWQSlot): Use a macro here to make it a little easier to add items.
2003-04-21 Chris Blumenberg <cblu at apple.com>
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index 1aa5be9..a170ab7 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -1115,9 +1115,43 @@ NodeImpl::Id HTMLInputElementImpl::id() const
return ID_INPUT;
}
-void HTMLInputElementImpl::setType(const DOMString& /*t*/)
+void HTMLInputElementImpl::setType(const DOMString& t)
{
- // ###
+ typeEnum newType;
+
+ if ( strcasecmp( t, "password" ) == 0 )
+ newType = PASSWORD;
+ else if ( strcasecmp( t, "checkbox" ) == 0 )
+ newType = CHECKBOX;
+ else if ( strcasecmp( t, "radio" ) == 0 )
+ newType = RADIO;
+ else if ( strcasecmp( t, "submit" ) == 0 )
+ newType = SUBMIT;
+ else if ( strcasecmp( t, "reset" ) == 0 )
+ newType = RESET;
+ else if ( strcasecmp( t, "file" ) == 0 )
+ newType = FILE;
+ else if ( strcasecmp( t, "hidden" ) == 0 )
+ newType = HIDDEN;
+ else if ( strcasecmp( t, "image" ) == 0 )
+ newType = IMAGE;
+ else if ( strcasecmp( t, "button" ) == 0 )
+ newType = BUTTON;
+ else if ( strcasecmp( t, "khtml_isindex" ) == 0 )
+ newType = ISINDEX;
+ else
+ newType = TEXT;
+
+ // ### IMPORTANT: Don't allow the type to be changed to FILE after the first
+ // type change, otherwise a JavaScript programmer would be able to set a text
+ // field's value to something like /etc/passwd and then change it to a file field.
+ if (newType != FILE || !m_haveType) {
+ m_type = newType;
+ m_haveType = true;
+ }
+ else if (m_type != newType) {
+ setAttribute(ATTR_TYPE, type());
+ }
}
DOMString HTMLInputElementImpl::type() const
@@ -1190,48 +1224,13 @@ void HTMLInputElementImpl::click( )
void HTMLInputElementImpl::parseAttribute(AttributeImpl *attr)
{
- // ### IMPORTANT: check that the type can't be changed after the first time
- // otherwise a javascript programmer may be able to set a text field's value
- // to something like /etc/passwd and then change it to a file field
switch(attr->id())
{
case ATTR_AUTOCOMPLETE:
m_autocomplete = strcasecmp( attr->value(), "off" );
break;
- case ATTR_TYPE: {
- typeEnum newType;
-
- if ( strcasecmp( attr->value(), "password" ) == 0 )
- newType = PASSWORD;
- else if ( strcasecmp( attr->value(), "checkbox" ) == 0 )
- newType = CHECKBOX;
- else if ( strcasecmp( attr->value(), "radio" ) == 0 )
- newType = RADIO;
- else if ( strcasecmp( attr->value(), "submit" ) == 0 )
- newType = SUBMIT;
- else if ( strcasecmp( attr->value(), "reset" ) == 0 )
- newType = RESET;
- else if ( strcasecmp( attr->value(), "file" ) == 0 )
- newType = FILE;
- else if ( strcasecmp( attr->value(), "hidden" ) == 0 )
- newType = HIDDEN;
- else if ( strcasecmp( attr->value(), "image" ) == 0 )
- newType = IMAGE;
- else if ( strcasecmp( attr->value(), "button" ) == 0 )
- newType = BUTTON;
- else if ( strcasecmp( attr->value(), "khtml_isindex" ) == 0 )
- newType = ISINDEX;
- else
- newType = TEXT;
-
- if (!m_haveType) {
- m_type = newType;
- m_haveType = true;
- }
- else if (m_type != newType) {
- setAttribute(ATTR_TYPE,type());
- }
- }
+ case ATTR_TYPE:
+ setType(attr->value());
break;
case ATTR_VALUE:
case ATTR_CHECKED:
diff --git a/WebCore/kwq/KWQSlot.mm b/WebCore/kwq/KWQSlot.mm
index bffbeb1..817e332 100644
--- a/WebCore/kwq/KWQSlot.mm
+++ b/WebCore/kwq/KWQSlot.mm
@@ -70,70 +70,50 @@ enum FunctionNumber {
KWQSlot::KWQSlot(QObject *object, const char *member)
{
+ #define CASE(function, parameters, type) \
+ if (KWQNamesMatch(member, "SLOT:" #function #parameters)) { \
+ ASSERT(dynamic_cast<type *>(object)); \
+ m_function = function; \
+ } else
+
+ CASE(slotAutoScroll, (), KHTMLPart)
+ CASE(slotClicked, (), RenderFormElement)
+ CASE(slotChildCompleted, (), KHTMLPart)
+ CASE(slotChildStarted, (KIO::Job *), KHTMLPart)
+ CASE(slotFinishedParsing, (), KHTMLPart)
+ CASE(slotLoaderRequestDone, (khtml::DocLoader *, khtml::CachedObject *), KHTMLPart)
+ CASE(slotLoaderRequestStarted, (khtml::DocLoader *, khtml::CachedObject *), KHTMLPart)
+ CASE(slotParentCompleted, (), KHTMLPart)
+ CASE(slotRedirect, (), KHTMLPart)
+ CASE(slotReturnPressed, (), RenderLineEdit)
+ CASE(slotSelected, (int), RenderSelect)
+ CASE(slotSelectionChanged, (), RenderSelect)
+ CASE(slotStateChanged, (int), RenderCheckBox)
+ CASE(slotTextChanged, (), RenderTextArea)
+ CASE(slotWidgetDestructed, (), RenderWidget)
+
+ #undef CASE
+
if (KWQNamesMatch(member, SIGNAL(finishedParsing()))) {
ASSERT(dynamic_cast<DocumentImpl *>(object));
m_function = signalFinishedParsing;
- } else if (KWQNamesMatch(member, SLOT(slotAutoScroll()))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotAutoScroll;
- } else if (KWQNamesMatch(member, SLOT(slotClicked()))) {
- ASSERT(dynamic_cast<RenderFormElement *>(object));
- m_function = slotClicked;
- } else if (KWQNamesMatch(member, SLOT(slotChildCompleted()))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotChildCompleted;
} else if (KWQNamesMatch(member, SLOT(slotChildCompleted(bool)))) {
ASSERT(dynamic_cast<KHTMLPart *>(object));
m_function = slotChildCompletedWithBool;
- } else if (KWQNamesMatch(member, SLOT(slotChildStarted(KIO::Job *)))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotChildStarted;
- } else if (KWQNamesMatch(member, SLOT(slotFinishedParsing()))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotFinishedParsing;
- } else if (KWQNamesMatch(member, SLOT(slotLoaderRequestDone(khtml::DocLoader *, khtml::CachedObject *)))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotLoaderRequestDone;
- } else if (KWQNamesMatch(member, SLOT(slotLoaderRequestStarted(khtml::DocLoader *, khtml::CachedObject *)))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotLoaderRequestStarted;
- } else if (KWQNamesMatch(member, SLOT(slotParentCompleted()))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotParentCompleted;
} else if (KWQNamesMatch(member, SLOT(parentDestroyed()))) {
ASSERT(dynamic_cast<WindowQObject *>(object));
m_function = slotParentDestroyed;
- } else if (KWQNamesMatch(member, SLOT(slotRedirect()))) {
- ASSERT(dynamic_cast<KHTMLPart *>(object));
- m_function = slotRedirect;
- } else if (KWQNamesMatch(member, SLOT(slotReturnPressed()))) {
- ASSERT(dynamic_cast<RenderLineEdit *>(object));
- m_function = slotReturnPressed;
- } else if (KWQNamesMatch(member, SLOT(slotSelected(int)))) {
- ASSERT(dynamic_cast<RenderSelect *>(object));
- m_function = slotSelected;
- } else if (KWQNamesMatch(member, SLOT(slotSelectionChanged()))) {
- ASSERT(dynamic_cast<RenderSelect *>(object));
- m_function = slotSelectionChanged;
- } else if (KWQNamesMatch(member, SLOT(slotStateChanged(int)))) {
- ASSERT(dynamic_cast<RenderCheckBox *>(object));
- m_function = slotStateChanged;
} else if (KWQNamesMatch(member, SLOT(submitFormAgain()))) {
ASSERT(dynamic_cast<KHTMLPart *>(object));
m_function = slotSubmitFormAgain;
- } else if (KWQNamesMatch(member, SLOT(slotTextChanged()))) {
- ASSERT(dynamic_cast<RenderTextArea *>(object));
- m_function = slotTextChanged;
} else if (KWQNamesMatch(member, SLOT(slotTextChanged(const QString &)))) {
ASSERT(dynamic_cast<RenderLineEdit *>(object) || dynamic_cast<RenderFileButton *>(object));
m_function = slotTextChangedWithString;
- } else if (KWQNamesMatch(member, SLOT(slotWidgetDestructed()))) {
- ASSERT(dynamic_cast<RenderWidget *>(object));
- m_function = slotWidgetDestructed;
} else {
ERROR("trying to create a slot for unknown member %s", member);
return;
}
+
m_object = object;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list