Changeset 19282 for S60/trunk/WebCore

Show
Ignore:
Timestamp:
01/30/07 19:03:03 (2 years ago)
Author:
brmorris
Message:

yaharon, reviewed by zalan.

DESC: BrowserNG: Redundant password manager notification on secure pages (MLIO-6XXEVU)
http://bugs.webkit.org/show_bug.cgi?id=12484


Location:
S60/trunk/WebCore
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • S60/trunk/WebCore/ChangeLog

    r19241 r19282  
     1yaharon, 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 
    162007-01-29  bujtas  <zbujtas@gmail.com> 
    27 
  • S60/trunk/WebCore/bridge/WebCoreFormDataElement.h

    r14720 r19282  
    6666  HBufC* iValue; 
    6767  TBool isPassword; 
     68  TBool isAutoComplete; 
    6869 
    6970}; 
  • S60/trunk/WebCore/khtml/html/html_formimpl.cpp

    r14549 r19282  
    154154 
    155155    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); 
    159159    } 
    160160 
     
    170170{ 
    171171    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); 
    175175    } 
    176176 
     
    182182    int len = 0; 
    183183    for (unsigned i = 0; i < formElements.count(); ++i) 
    184         if (formElements[i]->isEnumeratable()) 
    185             ++len; 
     184    if (formElements[i]->isEnumeratable()) 
     185        ++len; 
    186186 
    187187    return len; 
     
    539539 
    540540    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? 
    542542 
    543543#if APPLE_CHANGES 
     
    557557                KWQ(part)->recordFormValue(input->name().string(), input->value().string(), 
    558558#ifdef NOKIA_CHANGES 
    559                 (input->inputType() ==  HTMLInputElementImpl::PASSWORD)); 
     559                (input->inputType() ==  HTMLInputElementImpl::PASSWORD), input->autoComplete()); 
    560560#else 
    561561                this); 
     
    679679    case ATTR_ONSUBMIT: 
    680680        setHTMLEventListener(EventImpl::SUBMIT_EVENT, 
    681             getDocument()->createHTMLEventListener(attr->value().string(), this)); 
     681        getDocument()->createHTMLEventListener(attr->value().string(), this)); 
    682682        break; 
    683683    case ATTR_ONRESET: 
    684684        setHTMLEventListener(EventImpl::RESET_EVENT, 
    685             getDocument()->createHTMLEventListener(attr->value().string(), this)); 
     685        getDocument()->createHTMLEventListener(attr->value().string(), this)); 
    686686        break; 
    687687    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; 
    698698    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 through 
     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 through 
    709709    default: 
    710710        HTMLElementImpl::parseHTMLAttribute(attr); 
     
    792792 
    793793    if (f) 
    794         m_form = f; 
     794    m_form = f; 
    795795    else 
    796         m_form = getForm(); 
     796    m_form = getForm(); 
    797797    if (m_form) 
    798798        m_form->registerFormElement(this); 
     
    839839    // be removed from that form's element list. 
    840840    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); 
    844844    } 
    845845 
     
    967967                (static_cast<RenderWidget*>(m_render)->widget()->focusPolicy() & QWidget::TabFocus); 
    968968        } 
    969         if (getDocument()->part()) 
    970             return getDocument()->part()->tabsToAllControls(); 
     969    if (getDocument()->part()) 
     970        return getDocument()->part()->tabsToAllControls(); 
    971971    } 
    972972    return false; 
     
    10051005 
    10061006#if APPLE_CHANGES 
    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. 
     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. 
    10091009#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 select 
    1026             // 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    } 
    10281028    } 
    10291029    HTMLElementImpl::defaultEventHandler(evt); 
     
    11301130{ 
    11311131    if(getDocument()->focusNode() == this) 
    1132         getDocument()->setFocusNode(0); 
     1132    getDocument()->setFocusNode(0); 
    11331133} 
    11341134 
     
    13861386QString HTMLInputElementImpl::state( ) 
    13871387{ 
    1388     assert(m_type != PASSWORD);         // should never save/restore password fields 
     1388    assert(m_type != PASSWORD);     // should never save/restore password fields 
    13891389 
    13901390    QString state = HTMLGenericFormElementImpl::state(); 
     
    14001400void HTMLInputElementImpl::restoreState(QStringList &states) 
    14011401{ 
    1402     assert(m_type != PASSWORD);         // should never save/restore password fields 
     1402    assert(m_type != PASSWORD);     // should never save/restore password fields 
    14031403 
    14041404    QString state = HTMLGenericFormElementImpl::findMatchingState(states); 
     
    21772177{ 
    21782178    if(getDocument()->focusNode() == this) 
    2179         getDocument()->setFocusNode(0); 
     2179    getDocument()->setFocusNode(0); 
    21802180} 
    21812181 
     
    22042204            yPos = me->clientY() - offsetY; 
    22052205        } 
    2206                 me->setDefaultHandled(); 
     2206        me->setDefaultHandled(); 
    22072207    } 
    22082208 
     
    25202520{ 
    25212521    if(getDocument()->focusNode() == this) 
    2522         getDocument()->setFocusNode(0); 
     2522    getDocument()->setFocusNode(0); 
    25232523} 
    25242524 
     
    27722772            // ### what if optgroup contains just comments? don't want one of no options in it... 
    27732773#if NOKIA_CHANGES  
    2774                         // OOM handling 
     2774            // OOM handling 
    27752775            if( !m_listItems.resize(m_listItems.size()+1) ) 
    2776                         { 
    2777                                 m_listItems.resize( 1 );        // avoid no options in a select element 
    2778                                 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            } 
    27822782#endif 
    27832783            m_listItems[m_listItems.size()-1] = static_cast<HTMLElementImpl*>(current); 
     
    27862786        if (current->id() == ID_OPTION) { 
    27872787#if NOKIA_CHANGES  
    2788                         // OOM handling 
     2788            // OOM handling 
    27892789            if( !m_listItems.resize(m_listItems.size()+1) ) 
    2790                         { 
    2791                                 m_listItems.resize( 1 );        // avoid no options in a select element 
    2792                                 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            } 
    27962796#endif 
    27972797            m_listItems[m_listItems.size()-1] = static_cast<HTMLElementImpl*>(current); 
     
    32883288    case ATTR_ONFOCUS: 
    32893289        setHTMLEventListener(EventImpl::FOCUS_EVENT, 
    3290             getDocument()->createHTMLEventListener(attr->value().string(), this)); 
     3290        getDocument()->createHTMLEventListener(attr->value().string(), this)); 
    32913291        break; 
    32923292    case ATTR_ONBLUR: 
    32933293        setHTMLEventListener(EventImpl::BLUR_EVENT, 
    3294             getDocument()->createHTMLEventListener(attr->value().string(), this)); 
     3294        getDocument()->createHTMLEventListener(attr->value().string(), this)); 
    32953295        break; 
    32963296    case ATTR_ONSELECT: 
    32973297        setHTMLEventListener(EventImpl::SELECT_EVENT, 
    3298             getDocument()->createHTMLEventListener(attr->value().string(), this)); 
     3298        getDocument()->createHTMLEventListener(attr->value().string(), this)); 
    32993299        break; 
    33003300    case ATTR_ONCHANGE: 
    33013301        setHTMLEventListener(EventImpl::CHANGE_EVENT, 
    3302             getDocument()->createHTMLEventListener(attr->value().string(), this)); 
     3302        getDocument()->createHTMLEventListener(attr->value().string(), this)); 
    33033303        break; 
    33043304    default: 
     
    33973397{ 
    33983398    if(getDocument()->focusNode() == this) 
    3399         getDocument()->setFocusNode(0); 
     3399    getDocument()->setFocusNode(0); 
    34003400} 
    34013401 
     
    34593459    { 
    34603460    case ATTR_PROMPT: 
    3461         setValue(attr->value()); 
     3461    setValue(attr->value()); 
    34623462    default: 
    34633463        // don't call HTMLInputElement::parseHTMLAttribute here, as it would 
  • S60/trunk/WebCore/kwq/KWQKHTMLPart.cpp

    r19198 r19282  
    719719 
    720720//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) 
     721void KWQKHTMLPart::recordFormValue(const QString &name, const QString &value, TBool isPassword, TBool isAutoComplete) 
     722{ 
     723    TRAP_IGNORE(recordFormValueL(name, value, isPassword, isAutoComplete)); 
     724} 
     725 
     726void KWQKHTMLPart::recordFormValueL(const QString &name, const QString &value, TBool isPassword, TBool isAutoComplete) 
    727727  { 
    728728  if (!_formValuesAboutToBeSubmitted) { 
     
    732732    CWebCoreFormDataElement* fDataElem = new (ELeave) CWebCoreFormDataElement(); 
    733733    fDataElem->isPassword = isPassword; 
     734    fDataElem->isAutoComplete = isAutoComplete; 
    734735    // copy name and value since they get deleted before being saved 
    735736    fDataElem->iKey = name.Des().AllocLC(); 
  • S60/trunk/WebCore/kwq/KWQKHTMLPart.h

    r18807 r19282  
    261261    void clearRecordedFormValues(); 
    262262    //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); 
    264264    DOM::HTMLFormElementImpl *currentForm() const; 
    265265 
     
    368368    int calculateZoomFactor() const; 
    369369  // 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); 
    371371 
    372372    virtual void khtmlMousePressEvent(khtml::MousePressEvent *);