Changeset 21403

Show
Ignore:
Timestamp:
05/11/07 08:02:08 (3 years ago)
Author:
zbujtas
Message:

2007-05-11 bujtas < zbujtas@gmail.com>

Reviewed by Sriram.
DESC: disabled widgets should not get activated. add dimmed checkbox and radiobutton.
 http://bugs.webkit.org/show_bug.cgi?id=13678

WARNING: NO TEST CASES ADDED OR CHANGED

  • bridge/WebCoreBridge.cpp: (CWebCoreBridge::NavigableNodeUnderCursor): (CWebCoreBridge::NodeTypeB):
  • kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::activateNodeAtPoint):
Location:
S60/branches/3.1m
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • S60/branches/3.1m/WebCore/ChangeLog

    r21305 r21403  
     12007-05-11  bujtas  <zbujtas@gmail.com> 
     2 
     3        Reviewed by Sriram. 
     4        DESC: disabled widgets should not get activated. add dimmed checkbox and radiobutton. 
     5        http://bugs.webkit.org/show_bug.cgi?id=13678 
     6 
     7        WARNING: NO TEST CASES ADDED OR CHANGED 
     8 
     9        * bridge/WebCoreBridge.cpp: 
     10        (CWebCoreBridge::NavigableNodeUnderCursor): 
     11        (CWebCoreBridge::NodeTypeB): 
     12        * kwq/KWQKHTMLPart.cpp: 
     13        (KWQKHTMLPart::activateNodeAtPoint): 
     14 
    1152007-05-07  yadavall  <sriram.yadavalli@nokia.com> 
    216 
  • S60/branches/3.1m/WebCore/bridge/WebCoreBridge.cpp

    r21305 r21403  
    26802680                    { 
    26812681                    aElType = NodeTypeB( navNode ); 
     2682                    // focus node could be disabled 
     2683                    if (aElType == EWebCoreElementNone) { 
     2684                        iPart->xmlDocImpl()->setFocusNode( 0 ); 
     2685                        aFocusRect = TRect(); 
     2686                        return EFalse; 
     2687                    } 
    26822688                    aFocusRect = navNode->getRect().Rect(); 
    26832689                    return ETrue; 
     
    27662772      { 
    27672773            HTMLInputElementImpl* inputElement = static_cast<HTMLInputElementImpl *>(aFocusNode); 
     2774            // do not focus disabled widgets 
     2775            if (inputElement->disabled()) 
     2776                return EWebCoreElementNone; 
     2777 
    27682778            TInt type = inputElement->inputType(); 
    27692779            switch(inputElement->inputType()) 
  • S60/branches/3.1m/WebCore/kwq/KWQKHTMLPart.cpp

    r20450 r21403  
    19541954        if(navNode->renderer() && navNode->renderer()->isWidget()) { 
    19551955            QWidget* w = static_cast<RenderWidget*>(navNode->renderer())->widget(); 
    1956             if (w) { 
     1956            if (w && w->isEnabled()) { 
    19571957                w->clicked(); 
    19581958                xmlDocImpl()->setFocusNode( navNode ); 
  • S60/branches/3.1m/WebKit/BrowserCore/Formcontrols/inc/FControlCheckBoxSkin.h

    r14549 r21403  
    1010*    All rights reserved. 
    1111 
    12      Redistribution and use in source and binary forms, with or without 
    13      modification, are permitted provided that the following conditions 
    14      are met: 
     12 Redistribution and use in source and binary forms, with or without 
     13 modification, are permitted provided that the following conditions 
     14 are met: 
    1515 
    1616*      * Redistributions of source code must retain the above copyright 
     
    2424*        from this software without specific prior written permission. 
    2525 
    26      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    27      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    28      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
    29      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    30      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    31      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    32      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
    33      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
    34      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    35      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
    36      USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
    37      DAMAGE. 
     26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
     27 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
     28 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
     29 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
     30 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
     31 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
     32 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
     34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
     35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
     36 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
     37 DAMAGE. 
    3838 
    3939*    Please see file patentlicense.txt for further grants. 
     
    8282  public: 
    8383 
    84         /** 
    85         * Constructor 
    86         */ 
    87         CFormCheckBoxSkin( CCannedImages& aCannedImages,  
     84    /** 
     85    * Constructor 
     86    */ 
     87    CFormCheckBoxSkin( CCannedImages& aCannedImages,  
    8888                           TCheckBoxType aCheckBoxType); 
    8989 
    9090    // CWebCoreFormWidget methods 
    91          
    92         /** 
     91     
     92    /** 
    9393    * Returns the size of the check box bitmap 
    9494    * @return TSize 
     
    9696    TSize SizeHint() const; 
    9797     
    98         /** 
     98    /** 
    9999    * Rapaints the Rect with the new/current bitmap 
    100100    */ 
    101         void Draw( CWebCoreGraphicsContext& aPainter,  
     101    void Draw( CWebCoreGraphicsContext& aPainter,  
    102102                   const TRect& aRect ); 
    103          
    104         /** 
    105         * Saves the Visible State (Not Used) 
    106         */ 
    107         void MakeVisible(TBool aVisible) ; 
    108      
    109         /** 
    110         * SetFocus modifies the button apperence by changing the bitmap 
    111         */ 
    112         void SetFocus(TBool aFocus) ; 
    113      
    114         /** 
    115         * Activate - called when the button is clicked 
    116         */ 
    117         void Activate(); 
    118          
    119         /** 
    120         * Sets the Rect 
    121         */ 
    122         void SetRect(const TRect& aRect) ; 
     103     
     104    /** 
     105    * Saves the Visible State (Not Used) 
     106    */ 
     107    void MakeVisible(TBool aVisible) ; 
     108     
     109    /** 
     110    * SetFocus modifies the button apperence by changing the bitmap 
     111    */ 
     112    void SetFocus(TBool aFocus) ; 
     113     
     114    /** 
     115    * Activate - called when the button is clicked 
     116    */ 
     117    void Activate(); 
     118     
     119    /** 
     120    * Sets the Rect 
     121    */ 
     122    void SetRect(const TRect& aRect) ; 
    123123 
    124124    /** 
     
    149149    // MWebCoreCheckBoxControl related methods 
    150150 
    151         /** 
    152         * Sets the Checked state 
    153         */ 
     151    /** 
     152    * Sets the Checked state 
     153    */ 
    154154    void SetChecked(TBool aIsChecked); 
    155155 
    156156    TBool IsChecked() {return iIsChecked;} 
    157157 
    158         /** 
    159         * Saves pointer to the event handler 
    160         */ 
     158    /** 
     159    * Saves pointer to the event handler 
     160    */ 
    161161    void SetEventHandler(MWebCoreFormEventHandler* aActivateEventHandler) ; 
    162162     
    163         /** 
    164         * Saves pointer to the browser control parent 
    165         */ 
     163    /** 
     164    * Saves pointer to the browser control parent 
     165    */ 
    166166    void SetParent( MWebCoreScrollView* aParent ); 
    167167 
    168         void Close(){ delete this;} 
     168    void Close(){ delete this;} 
    169169 
    170170    ~CFormCheckBoxSkin(); 
     171     
     172    /** 
     173    * Creates a dimmed mask for the current bitmap 
     174    */ 
     175    void CreateDimmedMaskL(); 
    171176 
    172177  private: 
    173178 
    174         // private methods 
    175      
    176         /** 
    177         *  Default constructor 
    178         */ 
    179         CFormCheckBoxSkin(); 
    180  
    181         TCannedImageData& GetImage() const; 
    182         void InvalidateRect(); 
     179    // private methods 
     180     
     181    /** 
     182    *  Default constructor 
     183    */ 
     184    CFormCheckBoxSkin(); 
     185 
     186    TCannedImageData& GetImage() const; 
     187    void InvalidateRect(); 
    183188 
    184189    // private member data  
    185190 
    186         // Check Box Type 
    187         TCheckBoxType iCheckBoxType; 
    188         // Checked state 
     191    // Check Box Type 
     192    TCheckBoxType iCheckBoxType; 
     193    // Checked state 
    189194    TBool iIsChecked; 
    190         // widget Rect 
     195    // widget Rect 
    191196    TRect iRect; 
    192         // Focused state 
    193         TBool iFocused; 
    194         // Visible state (Not Used) 
     197    // Focused state 
     198    TBool iFocused; 
     199    // Visible state (Not Used) 
    195200    TBool iVisible; 
    196         // pointer to event handler 
     201    // pointer to event handler 
    197202    MWebCoreFormEventHandler* iCheckBoxEventHandler; 
    198         // pointer to parent view 
     203    // pointer to parent view 
    199204    MWebCoreScrollView* iParent; 
    200205 
    201         // Image bitmaps 
     206    // Image bitmaps 
    202207    CCannedImages& iCannedImages; 
    203   }; 
     208    CFbsBitmap* iDimmedBitmapMask;  // owned 
     209}; 
    204210#endif //WEBCORE_CHECKBOX_WIDGET_CONTROL_H_ 
  • S60/branches/3.1m/WebKit/BrowserCore/Formcontrols/src/FControlCheckBoxSkin.cpp

    r14725 r21403  
    8787void CFormCheckBoxSkin::SetChecked(TBool aIsChecked) 
    8888    { 
     89    // delete dimmed mask when the status changes. recreate it when it is needed 
     90    if (iDimmedBitmapMask && iIsChecked != aIsChecked ) 
     91        { 
     92        delete iDimmedBitmapMask; 
     93        iDimmedBitmapMask = NULL; 
     94        } 
    8995    iIsChecked = aIsChecked; 
    90   InvalidateRect(); 
     96    InvalidateRect(); 
    9197    } 
    9298 
     
    120126    TRect r(image.iImage->SizeInPixels()); 
    121127    gcContext->SetBrushStyle(CGraphicsContext::ENullBrush); 
    122     gcContext->BitBltMasked(imagePoint, image.iImage, r, image.iMask, ETrue); 
     128    TInt err(KErrNone); 
     129    if (!iVisible && !iDimmedBitmapMask)  
     130        { 
     131        TRAP(err, CreateDimmedMaskL()); 
     132        } 
     133    gcContext->BitBltMasked(imagePoint, image.iImage, r, (!iVisible && err == KErrNone) ? iDimmedBitmapMask : image.iMask, ETrue); 
    123134    } 
    124135 
     
    161172void CFormCheckBoxSkin::MakeVisible(TBool aVisible) 
    162173    { 
     174    // delete dimmed mask when the status changes. recreate it when it is needed 
     175    if (iDimmedBitmapMask && iVisible != aVisible) 
     176        { 
     177        delete iDimmedBitmapMask; 
     178        iDimmedBitmapMask = NULL; 
     179        } 
    163180    iVisible = aVisible; 
    164181    } 
     
    251268//----------------------------------------------------------------------------- 
    252269CFormCheckBoxSkin::~CFormCheckBoxSkin() 
    253     {} 
    254  
     270    { 
     271    delete iDimmedBitmapMask; 
     272    } 
     273 
     274void CFormCheckBoxSkin::CreateDimmedMaskL()  
     275    { 
     276    TCannedImageData image = GetImage(); 
     277    TSize s = image.iMask->SizeInPixels(); 
     278    iDimmedBitmapMask = new (ELeave) CFbsBitmap(); 
     279    iDimmedBitmapMask->Create(s,image.iMask->DisplayMode()); 
     280    CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(iDimmedBitmapMask); 
     281    CleanupStack::PushL(dev); 
     282    CFbsBitGc* gc; 
     283    User::LeaveIfError(dev->CreateContext(gc)); 
     284    gc->BitBlt(TPoint(0,0),image.iMask); 
     285    iDimmedBitmapMask->LockHeap(); 
     286    TUint8* data = (TUint8*)iDimmedBitmapMask->DataAddress(); 
     287    TUint8* end = data + s.iWidth*s.iHeight; 
     288    // divide all pixels by 3 
     289    while ( data<end ) 
     290        { 
     291        *(data++) /= 3; 
     292        } 
     293    iDimmedBitmapMask->UnlockHeap(); 
     294    delete gc; 
     295    CleanupStack::PopAndDestroy(); 
     296    } 
  • S60/branches/3.1m/WebKit/ChangeLog

    r21400 r21403  
     12007-05-11  bujtas  <zbujtas@gmail.com> 
     2 
     3        Reviewed by Sriram 
     4        DESC: disabled widgets should not get activated. add dimmed checkbox and radiobutton. 
     5        http://bugs.webkit.org/show_bug.cgi?id=13678 
     6 
     7        * BrowserCore/Formcontrols/inc/FControlCheckBoxSkin.h: 
     8        * BrowserCore/Formcontrols/src/FControlCheckBoxSkin.cpp: 
     9        (CFormCheckBoxSkin::SetChecked): 
     10        (CFormCheckBoxSkin::Draw): 
     11        (CFormCheckBoxSkin::MakeVisible): 
     12        (CFormCheckBoxSkin::~CFormCheckBoxSkin): 
     13        (CFormCheckBoxSkin::CreateFadeBitmapL): 
     14 
    1152007-05-09  vbradley  <vincent.bradley@nokia.com> 
    216