Changeset 19282 for S60/trunk/WebCore
- Timestamp:
- 01/30/07 19:03:03 (2 years ago)
- Location:
- S60/trunk/WebCore
- Files:
-
- 5 modified
-
ChangeLog (modified) (1 diff)
-
bridge/WebCoreFormDataElement.h (modified) (1 diff)
-
khtml/html/html_formimpl.cpp (modified) (21 diffs)
-
kwq/KWQKHTMLPart.cpp (modified) (2 diffs)
-
kwq/KWQKHTMLPart.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
S60/trunk/WebCore/ChangeLog
r19241 r19282 1 yaharon, reviewed by zalan. 2 DESC: BrowserNG: Redundant password manager notification on secure pages (MLIO-6XXEVU) 3 http://bugs.webkit.org/show_bug.cgi?id=12484 4 5 1 6 2007-01-29 bujtas <zbujtas@gmail.com> 2 7 -
S60/trunk/WebCore/bridge/WebCoreFormDataElement.h
r14720 r19282 66 66 HBufC* iValue; 67 67 TBool isPassword; 68 TBool isAutoComplete; 68 69 69 70 }; -
S60/trunk/WebCore/khtml/html/html_formimpl.cpp
r14549 r19282 154 154 155 155 if (getDocument()->isHTMLDocument()) { 156 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument());157 document->addNamedImageOrForm(oldNameAttr);158 document->addNamedImageOrForm(oldIdAttr);156 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument()); 157 document->addNamedImageOrForm(oldNameAttr); 158 document->addNamedImageOrForm(oldIdAttr); 159 159 } 160 160 … … 170 170 { 171 171 if (getDocument()->isHTMLDocument()) { 172 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument());173 document->removeNamedImageOrForm(oldNameAttr);174 document->removeNamedImageOrForm(oldIdAttr);172 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument()); 173 document->removeNamedImageOrForm(oldNameAttr); 174 document->removeNamedImageOrForm(oldIdAttr); 175 175 } 176 176 … … 182 182 int len = 0; 183 183 for (unsigned i = 0; i < formElements.count(); ++i) 184 if (formElements[i]->isEnumeratable())185 ++len;184 if (formElements[i]->isEnumeratable()) 185 ++len; 186 186 187 187 return len; … … 539 539 540 540 HTMLGenericFormElementImpl* firstSuccessfulSubmitButton = 0; 541 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?541 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button? 542 542 543 543 #if APPLE_CHANGES … … 557 557 KWQ(part)->recordFormValue(input->name().string(), input->value().string(), 558 558 #ifdef NOKIA_CHANGES 559 (input->inputType() == HTMLInputElementImpl::PASSWORD) );559 (input->inputType() == HTMLInputElementImpl::PASSWORD), input->autoComplete()); 560 560 #else 561 561 this); … … 679 679 case ATTR_ONSUBMIT: 680 680 setHTMLEventListener(EventImpl::SUBMIT_EVENT, 681 getDocument()->createHTMLEventListener(attr->value().string(), this));681 getDocument()->createHTMLEventListener(attr->value().string(), this)); 682 682 break; 683 683 case ATTR_ONRESET: 684 684 setHTMLEventListener(EventImpl::RESET_EVENT, 685 getDocument()->createHTMLEventListener(attr->value().string(), this));685 getDocument()->createHTMLEventListener(attr->value().string(), this)); 686 686 break; 687 687 case ATTR_NAME: 688 {689 QString newNameAttr = attr->value().string();690 if (attached() && getDocument()->isHTMLDocument()) {691 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument());692 document->removeNamedImageOrForm(oldNameAttr);693 document->addNamedImageOrForm(newNameAttr);694 }695 oldNameAttr = newNameAttr;696 }697 break;688 { 689 QString newNameAttr = attr->value().string(); 690 if (attached() && getDocument()->isHTMLDocument()) { 691 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument()); 692 document->removeNamedImageOrForm(oldNameAttr); 693 document->addNamedImageOrForm(newNameAttr); 694 } 695 oldNameAttr = newNameAttr; 696 } 697 break; 698 698 case ATTR_ID: 699 {700 QString newIdAttr = attr->value().string();701 if (attached() && getDocument()->isHTMLDocument()) {702 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument());703 document->removeNamedImageOrForm(oldIdAttr);704 document->addNamedImageOrForm(newIdAttr);705 }706 oldIdAttr = newIdAttr;707 }708 // fall through699 { 700 QString newIdAttr = attr->value().string(); 701 if (attached() && getDocument()->isHTMLDocument()) { 702 HTMLDocumentImpl *document = static_cast<HTMLDocumentImpl *>(getDocument()); 703 document->removeNamedImageOrForm(oldIdAttr); 704 document->addNamedImageOrForm(newIdAttr); 705 } 706 oldIdAttr = newIdAttr; 707 } 708 // fall through 709 709 default: 710 710 HTMLElementImpl::parseHTMLAttribute(attr); … … 792 792 793 793 if (f) 794 m_form = f;794 m_form = f; 795 795 else 796 m_form = getForm();796 m_form = getForm(); 797 797 if (m_form) 798 798 m_form->registerFormElement(this); … … 839 839 // be removed from that form's element list. 840 840 if (!m_form) { 841 m_form = getForm();842 if (m_form)843 m_form->registerFormElement(this);841 m_form = getForm(); 842 if (m_form) 843 m_form->registerFormElement(this); 844 844 } 845 845 … … 967 967 (static_cast<RenderWidget*>(m_render)->widget()->focusPolicy() & QWidget::TabFocus); 968 968 } 969 if (getDocument()->part())970 return getDocument()->part()->tabsToAllControls();969 if (getDocument()->part()) 970 return getDocument()->part()->tabsToAllControls(); 971 971 } 972 972 return false; … … 1005 1005 1006 1006 #if APPLE_CHANGES 1007 // We don't want this default key event handling, we'll count on1008 // Cocoa event dispatch if the event doesn't get blocked.1007 // We don't want this default key event handling, we'll count on 1008 // Cocoa event dispatch if the event doesn't get blocked. 1009 1009 #else 1010 if (evt->id()==EventImpl::KEYDOWN_EVENT ||1011 evt->id()==EventImpl::KEYUP_EVENT)1012 {1013 KeyboardEventImpl * k = static_cast<KeyboardEventImpl *>(evt);1014 if (k->keyVal() == QChar('\n').unicode() && m_render && m_render->isWidget() && k->qKeyEvent)1015 QApplication::sendEvent(static_cast<RenderWidget *>(m_render)->widget(), k->qKeyEvent);1016 }1017 #endif 1018 1019 if (evt->id()==EventImpl::DOMFOCUSOUT_EVENT && isEditable() && part && m_render && m_render->isWidget()) {1020 KHTMLPartBrowserExtension *ext = static_cast<KHTMLPartBrowserExtension *>(part->browserExtension());1021 QWidget *widget = static_cast<RenderWidget*>(m_render)->widget();1022 if (ext)1023 ext->editableWidgetBlurred(widget);1024 1025 // ### Don't count popup as a valid reason for losing the focus (example: opening the options of a select1026 // combobox shouldn't emit onblur)1027 }1010 if (evt->id()==EventImpl::KEYDOWN_EVENT || 1011 evt->id()==EventImpl::KEYUP_EVENT) 1012 { 1013 KeyboardEventImpl * k = static_cast<KeyboardEventImpl *>(evt); 1014 if (k->keyVal() == QChar('\n').unicode() && m_render && m_render->isWidget() && k->qKeyEvent) 1015 QApplication::sendEvent(static_cast<RenderWidget *>(m_render)->widget(), k->qKeyEvent); 1016 } 1017 #endif 1018 1019 if (evt->id()==EventImpl::DOMFOCUSOUT_EVENT && isEditable() && part && m_render && m_render->isWidget()) { 1020 KHTMLPartBrowserExtension *ext = static_cast<KHTMLPartBrowserExtension *>(part->browserExtension()); 1021 QWidget *widget = static_cast<RenderWidget*>(m_render)->widget(); 1022 if (ext) 1023 ext->editableWidgetBlurred(widget); 1024 1025 // ### Don't count popup as a valid reason for losing the focus (example: opening the options of a select 1026 // combobox shouldn't emit onblur) 1027 } 1028 1028 } 1029 1029 HTMLElementImpl::defaultEventHandler(evt); … … 1130 1130 { 1131 1131 if(getDocument()->focusNode() == this) 1132 getDocument()->setFocusNode(0);1132 getDocument()->setFocusNode(0); 1133 1133 } 1134 1134 … … 1386 1386 QString HTMLInputElementImpl::state( ) 1387 1387 { 1388 assert(m_type != PASSWORD); // should never save/restore password fields1388 assert(m_type != PASSWORD); // should never save/restore password fields 1389 1389 1390 1390 QString state = HTMLGenericFormElementImpl::state(); … … 1400 1400 void HTMLInputElementImpl::restoreState(QStringList &states) 1401 1401 { 1402 assert(m_type != PASSWORD); // should never save/restore password fields1402 assert(m_type != PASSWORD); // should never save/restore password fields 1403 1403 1404 1404 QString state = HTMLGenericFormElementImpl::findMatchingState(states); … … 2177 2177 { 2178 2178 if(getDocument()->focusNode() == this) 2179 getDocument()->setFocusNode(0);2179 getDocument()->setFocusNode(0); 2180 2180 } 2181 2181 … … 2204 2204 yPos = me->clientY() - offsetY; 2205 2205 } 2206 me->setDefaultHandled();2206 me->setDefaultHandled(); 2207 2207 } 2208 2208 … … 2520 2520 { 2521 2521 if(getDocument()->focusNode() == this) 2522 getDocument()->setFocusNode(0);2522 getDocument()->setFocusNode(0); 2523 2523 } 2524 2524 … … 2772 2772 // ### what if optgroup contains just comments? don't want one of no options in it... 2773 2773 #if NOKIA_CHANGES 2774 // OOM handling2774 // OOM handling 2775 2775 if( !m_listItems.resize(m_listItems.size()+1) ) 2776 {2777 m_listItems.resize( 1 );// avoid no options in a select element2778 m_recalcListItems = false;2779 2780 return;2781 }2776 { 2777 m_listItems.resize( 1 ); // avoid no options in a select element 2778 m_recalcListItems = false; 2779 2780 return; 2781 } 2782 2782 #endif 2783 2783 m_listItems[m_listItems.size()-1] = static_cast<HTMLElementImpl*>(current); … … 2786 2786 if (current->id() == ID_OPTION) { 2787 2787 #if NOKIA_CHANGES 2788 // OOM handling2788 // OOM handling 2789 2789 if( !m_listItems.resize(m_listItems.size()+1) ) 2790 {2791 m_listItems.resize( 1 );// avoid no options in a select element2792 m_recalcListItems = false;2793 2794 return;2795 }2790 { 2791 m_listItems.resize( 1 ); // avoid no options in a select element 2792 m_recalcListItems = false; 2793 2794 return; 2795 } 2796 2796 #endif 2797 2797 m_listItems[m_listItems.size()-1] = static_cast<HTMLElementImpl*>(current); … … 3288 3288 case ATTR_ONFOCUS: 3289 3289 setHTMLEventListener(EventImpl::FOCUS_EVENT, 3290 getDocument()->createHTMLEventListener(attr->value().string(), this));3290 getDocument()->createHTMLEventListener(attr->value().string(), this)); 3291 3291 break; 3292 3292 case ATTR_ONBLUR: 3293 3293 setHTMLEventListener(EventImpl::BLUR_EVENT, 3294 getDocument()->createHTMLEventListener(attr->value().string(), this));3294 getDocument()->createHTMLEventListener(attr->value().string(), this)); 3295 3295 break; 3296 3296 case ATTR_ONSELECT: 3297 3297 setHTMLEventListener(EventImpl::SELECT_EVENT, 3298 getDocument()->createHTMLEventListener(attr->value().string(), this));3298 getDocument()->createHTMLEventListener(attr->value().string(), this)); 3299 3299 break; 3300 3300 case ATTR_ONCHANGE: 3301 3301 setHTMLEventListener(EventImpl::CHANGE_EVENT, 3302 getDocument()->createHTMLEventListener(attr->value().string(), this));3302 getDocument()->createHTMLEventListener(attr->value().string(), this)); 3303 3303 break; 3304 3304 default: … … 3397 3397 { 3398 3398 if(getDocument()->focusNode() == this) 3399 getDocument()->setFocusNode(0);3399 getDocument()->setFocusNode(0); 3400 3400 } 3401 3401 … … 3459 3459 { 3460 3460 case ATTR_PROMPT: 3461 setValue(attr->value());3461 setValue(attr->value()); 3462 3462 default: 3463 3463 // don't call HTMLInputElement::parseHTMLAttribute here, as it would -
S60/trunk/WebCore/kwq/KWQKHTMLPart.cpp
r19198 r19282 719 719 720 720 //void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, HTMLFormElementImpl *element) 721 void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, TBool isPassword )722 { 723 TRAP_IGNORE(recordFormValueL(name, value, isPassword ));724 } 725 726 void KWQKHTMLPart::recordFormValueL(const QString &name, const QString &value, TBool isPassword )721 void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, TBool isPassword, TBool isAutoComplete) 722 { 723 TRAP_IGNORE(recordFormValueL(name, value, isPassword, isAutoComplete)); 724 } 725 726 void KWQKHTMLPart::recordFormValueL(const QString &name, const QString &value, TBool isPassword, TBool isAutoComplete) 727 727 { 728 728 if (!_formValuesAboutToBeSubmitted) { … … 732 732 CWebCoreFormDataElement* fDataElem = new (ELeave) CWebCoreFormDataElement(); 733 733 fDataElem->isPassword = isPassword; 734 fDataElem->isAutoComplete = isAutoComplete; 734 735 // copy name and value since they get deleted before being saved 735 736 fDataElem->iKey = name.Des().AllocLC(); -
S60/trunk/WebCore/kwq/KWQKHTMLPart.h
r18807 r19282 261 261 void clearRecordedFormValues(); 262 262 //void recordFormValue(const QString &name, const QString &value, DOM::HTMLFormElementImpl *element); 263 void recordFormValue(const QString &name, const QString &value,TBool isPassword );263 void recordFormValue(const QString &name, const QString &value,TBool isPassword, TBool isAutoComplete); 264 264 DOM::HTMLFormElementImpl *currentForm() const; 265 265 … … 368 368 int calculateZoomFactor() const; 369 369 // Leaving version of void recordFormValue(const QString &name, const QString &value,TBool isPassword); 370 void recordFormValueL(const QString &name, const QString &value,TBool isPassword );370 void recordFormValueL(const QString &name, const QString &value,TBool isPassword, TBool isAutoComplete); 371 371 372 372 virtual void khtmlMousePressEvent(khtml::MousePressEvent *);