Changeset 21403
- Timestamp:
- 05/11/07 08:02:08 (3 years ago)
- Location:
- S60/branches/3.1m
- Files:
-
- 6 modified
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/bridge/WebCoreBridge.cpp (modified) (2 diffs)
-
WebCore/kwq/KWQKHTMLPart.cpp (modified) (1 diff)
-
WebKit/BrowserCore/Formcontrols/inc/FControlCheckBoxSkin.h (modified) (5 diffs)
-
WebKit/BrowserCore/Formcontrols/src/FControlCheckBoxSkin.cpp (modified) (4 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
S60/branches/3.1m/WebCore/ChangeLog
r21305 r21403 1 2007-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 1 15 2007-05-07 yadavall <sriram.yadavalli@nokia.com> 2 16 -
S60/branches/3.1m/WebCore/bridge/WebCoreBridge.cpp
r21305 r21403 2680 2680 { 2681 2681 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 } 2682 2688 aFocusRect = navNode->getRect().Rect(); 2683 2689 return ETrue; … … 2766 2772 { 2767 2773 HTMLInputElementImpl* inputElement = static_cast<HTMLInputElementImpl *>(aFocusNode); 2774 // do not focus disabled widgets 2775 if (inputElement->disabled()) 2776 return EWebCoreElementNone; 2777 2768 2778 TInt type = inputElement->inputType(); 2769 2779 switch(inputElement->inputType()) -
S60/branches/3.1m/WebCore/kwq/KWQKHTMLPart.cpp
r20450 r21403 1954 1954 if(navNode->renderer() && navNode->renderer()->isWidget()) { 1955 1955 QWidget* w = static_cast<RenderWidget*>(navNode->renderer())->widget(); 1956 if (w ) {1956 if (w && w->isEnabled()) { 1957 1957 w->clicked(); 1958 1958 xmlDocImpl()->setFocusNode( navNode ); -
S60/branches/3.1m/WebKit/BrowserCore/Formcontrols/inc/FControlCheckBoxSkin.h
r14549 r21403 10 10 * All rights reserved. 11 11 * 12 * Redistribution and use in source and binary forms, with or without13 * modification, are permitted provided that the following conditions14 * 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: 15 15 * 16 16 * * Redistributions of source code must retain the above copyright … … 24 24 * from this software without specific prior written permission. 25 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH37 * 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. 38 38 * 39 39 * Please see file patentlicense.txt for further grants. … … 82 82 public: 83 83 84 /**85 * Constructor86 */87 CFormCheckBoxSkin( CCannedImages& aCannedImages,84 /** 85 * Constructor 86 */ 87 CFormCheckBoxSkin( CCannedImages& aCannedImages, 88 88 TCheckBoxType aCheckBoxType); 89 89 90 90 // CWebCoreFormWidget methods 91 92 /**91 92 /** 93 93 * Returns the size of the check box bitmap 94 94 * @return TSize … … 96 96 TSize SizeHint() const; 97 97 98 /**98 /** 99 99 * Rapaints the Rect with the new/current bitmap 100 100 */ 101 void Draw( CWebCoreGraphicsContext& aPainter,101 void Draw( CWebCoreGraphicsContext& aPainter, 102 102 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 bitmap111 */112 void SetFocus(TBool aFocus) ;113 114 /**115 * Activate - called when the button is clicked116 */117 void Activate();118 119 /**120 * Sets the Rect121 */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) ; 123 123 124 124 /** … … 149 149 // MWebCoreCheckBoxControl related methods 150 150 151 /**152 * Sets the Checked state153 */151 /** 152 * Sets the Checked state 153 */ 154 154 void SetChecked(TBool aIsChecked); 155 155 156 156 TBool IsChecked() {return iIsChecked;} 157 157 158 /**159 * Saves pointer to the event handler160 */158 /** 159 * Saves pointer to the event handler 160 */ 161 161 void SetEventHandler(MWebCoreFormEventHandler* aActivateEventHandler) ; 162 162 163 /**164 * Saves pointer to the browser control parent165 */163 /** 164 * Saves pointer to the browser control parent 165 */ 166 166 void SetParent( MWebCoreScrollView* aParent ); 167 167 168 void Close(){ delete this;}168 void Close(){ delete this;} 169 169 170 170 ~CFormCheckBoxSkin(); 171 172 /** 173 * Creates a dimmed mask for the current bitmap 174 */ 175 void CreateDimmedMaskL(); 171 176 172 177 private: 173 178 174 // private methods175 176 /**177 * Default constructor178 */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(); 183 188 184 189 // private member data 185 190 186 // Check Box Type187 TCheckBoxType iCheckBoxType;188 // Checked state191 // Check Box Type 192 TCheckBoxType iCheckBoxType; 193 // Checked state 189 194 TBool iIsChecked; 190 // widget Rect195 // widget Rect 191 196 TRect iRect; 192 // Focused state193 TBool iFocused;194 // Visible state (Not Used)197 // Focused state 198 TBool iFocused; 199 // Visible state (Not Used) 195 200 TBool iVisible; 196 // pointer to event handler201 // pointer to event handler 197 202 MWebCoreFormEventHandler* iCheckBoxEventHandler; 198 // pointer to parent view203 // pointer to parent view 199 204 MWebCoreScrollView* iParent; 200 205 201 // Image bitmaps206 // Image bitmaps 202 207 CCannedImages& iCannedImages; 203 }; 208 CFbsBitmap* iDimmedBitmapMask; // owned 209 }; 204 210 #endif //WEBCORE_CHECKBOX_WIDGET_CONTROL_H_ -
S60/branches/3.1m/WebKit/BrowserCore/Formcontrols/src/FControlCheckBoxSkin.cpp
r14725 r21403 87 87 void CFormCheckBoxSkin::SetChecked(TBool aIsChecked) 88 88 { 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 } 89 95 iIsChecked = aIsChecked; 90 InvalidateRect();96 InvalidateRect(); 91 97 } 92 98 … … 120 126 TRect r(image.iImage->SizeInPixels()); 121 127 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); 123 134 } 124 135 … … 161 172 void CFormCheckBoxSkin::MakeVisible(TBool aVisible) 162 173 { 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 } 163 180 iVisible = aVisible; 164 181 } … … 251 268 //----------------------------------------------------------------------------- 252 269 CFormCheckBoxSkin::~CFormCheckBoxSkin() 253 {} 254 270 { 271 delete iDimmedBitmapMask; 272 } 273 274 void 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 1 2007-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 1 15 2007-05-09 vbradley <vincent.bradley@nokia.com> 2 16