WebCore:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2006 18:27:54 +0000 (18:27 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2006 18:27:54 +0000 (18:27 +0000)
        Reviewed by Alice.

        Added code to draw Cocoa-like border for textareas instead of just using CSS.

        * WebCore.exp:
        * css/html4.css: Sets a 1px solid border.
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * rendering/RenderThemeMac.h: Formatting changes.
        * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextArea):
        Uses new wkDrawBezeledTextArea to draw border.

WebKit:

        Reviewed by Alice.

        Added initialization for WKDrawBezeledTextArea.

        * WebCoreSupport/WebSystemInterface.m:
        (InitWebCoreSystemInterface):

WebKitLibraries:

        Reviewed by Alice.

        * WebKitSystemInterface.h: Added WKDrawBezeledTextArea().
        * libWebKitSystemInterface.a: ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14889 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/css/html4.css
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm
WebCore/rendering/RenderThemeMac.h
WebCore/rendering/RenderThemeMac.mm
WebKit/ChangeLog
WebKit/WebCoreSupport/WebSystemInterface.m
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterface.a

index 196f62cd0ac665c91dca19c80862e248f4981962..c0db95e7e31717894a73fbfb9e776dda1d9599f8 100644 (file)
@@ -1,3 +1,17 @@
+2006-06-16  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Alice.
+
+        Added code to draw Cocoa-like border for textareas instead of just using CSS.
+
+        * WebCore.exp:
+        * css/html4.css: Sets a 1px solid border.
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+        * rendering/RenderThemeMac.h: Formatting changes.
+        * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextArea):
+        Uses new wkDrawBezeledTextArea to draw border.
+
 2006-06-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by hyatt.
index c7fb2497242dca5d39eee45a376f22298966b950..f82a33b8085d4a73ae0cdb37277833774c939d31 100644 (file)
@@ -129,6 +129,7 @@ _wkCGContextGetShouldSmoothFonts
 _wkClearGlyphVector
 _wkConvertCharToGlyphs
 _wkDrawBezeledTextFieldCell
+_wkDrawBezeledTextArea
 _wkDrawFocusRing
 _wkFontSmoothingModeIsLCD
 _wkGetATSStyleGroup
index 7d3a6c15e0b6e476fbe224210f490d882eb6e9f8..9050545d93d3023bba2496db20c6b11a9dcac0f9 100644 (file)
@@ -325,8 +325,7 @@ textarea {
 //  FIXME: Uncomment these when we flip the switch for the new textarea implementation
 //  -webkit-appearance: textarea;
 //   background-color: white;
-    border: solid #999999 1px;
-    border-top-color: #737373;
+    border: 1px solid;
     -webkit-rtl-ordering: logical;
     -webkit-user-select: text;
     -webkit-box-orient: vertical;
index 64c4311841c637f34735bf234e1b83dd1a57e86e..002586cd2d1c923fb82ad0d016c6f4aacbb723aa 100644 (file)
@@ -67,6 +67,7 @@ extern BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
 extern void (*wkClearGlyphVector)(void* glyphs);
 extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
+extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
 extern void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
 extern BOOL (*wkFontSmoothingModeIsLCD)(int mode);
 extern OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
index 675f5c3d961dc442774bef10cd62d6c139b30765..5a52451498d32e433892985ec3f371c6934edfdc 100644 (file)
@@ -30,6 +30,7 @@ BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
 void (*wkClearGlyphVector)(void* glyphs);
 OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
 void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
+void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
 void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
 BOOL (*wkFontSmoothingModeIsLCD)(int mode);
 OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
index 4422d419742ff8370a572d86f9258a898a554bd3..875f61d83467aac3ab08d74dc5a91772c8e55d95 100644 (file)
@@ -37,15 +37,15 @@ public:
     // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
     // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
     // controls that need to do this.
-    virtual short baselinePosition(const RenderObject* o) const;
+    virtual short baselinePosition(const RenderObject*) const;
 
     // A method asking if the control changes its tint when the window has focus or not.
-    virtual bool controlSupportsTints(const RenderObject* o) const;
+    virtual bool controlSupportsTints(const RenderObject*) const;
 
     // A general method asking if any control tinting is supported at all.
     virtual bool supportsControlTints() const { return true; }
 
-    virtual void adjustRepaintRect(const RenderObject* o, IntRect& r);
+    virtual void adjustRepaintRect(const RenderObject*, IntRect&);
 
     virtual bool isControlStyled(const RenderStyle* style, const BorderData& border, 
                                  const BackgroundLayer& background, const Color& backgroundColor) const;
@@ -57,51 +57,52 @@ public:
 
 protected:
     // Methods for each appearance value.
-    virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    virtual void setCheckboxSize(RenderStyle* style) const;
+    virtual bool paintCheckbox(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual void setCheckboxSize(RenderStyle*) const;
     
-    virtual bool paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    virtual void setRadioSize(RenderStyle* style) const;
+    virtual bool paintRadio(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual void setRadioSize(RenderStyle*) const;
     
-    virtual void adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const;
-    virtual bool paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    virtual void setButtonSize(RenderStyle* style) const;
+    virtual void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, WebCore::Element*) const;
+    virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual void setButtonSize(RenderStyle*) const;
     
-    virtual bool paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
-    virtual void adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
+    virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
-    virtual void adjustTextAreaStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const;
+    virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
 private:
-    IntRect inflateRect(const IntRect& r, const IntSize& size, const int* margins) const;
+    IntRect inflateRect(const IntRect&, const IntSize&, const int* margins) const;
 
     // Get the control size based off the font.  Used by some of the controls (like buttons).
-    NSControlSize controlSizeForFont(RenderStyle* style) const;
-    void setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize);
-    void setSizeFromFont(RenderStyle* style, const IntSize* sizes) const;
-    IntSize sizeForFont(RenderStyle* style, const IntSize* sizes) const;
-    void setFontFromControlSize(CSSStyleSelector* selector, RenderStyle* style, NSControlSize size) const;
+    NSControlSize controlSizeForFont(RenderStyle*) const;
+    void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize);
+    void setSizeFromFont(RenderStyle*, const IntSize* sizes) const;
+    IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const;
+    void setFontFromControlSize(CSSStyleSelector*, RenderStyle*, NSControlSize) const;
     
-    void addIntrinsicMargins(RenderStyle* style, NSControlSize size) const;
+    void addIntrinsicMargins(RenderStyle*, NSControlSize) const;
     
-    void updateCheckedState(NSCell* cell, const RenderObject* o);
-    void updateEnabledState(NSCell* cell, const RenderObject* o);
-    void updateFocusedState(NSCell* cell, const RenderObject* o);
-    void updatePressedState(NSCell* cell, const RenderObject* o);
+    void updateCheckedState(NSCell*, const RenderObject*);
+    void updateEnabledState(NSCell*, const RenderObject*);
+    void updateFocusedState(NSCell*, const RenderObject*);
+    void updatePressedState(NSCell*, const RenderObject*);
 
     // Helpers for adjusting appearance and for painting
     const IntSize* checkboxSizes() const;
     const int* checkboxMargins() const;
-    void setCheckboxCellState(const RenderObject* o, const IntRect& r);
+    void setCheckboxCellState(const RenderObject*, const IntRect&);
 
     const IntSize* radioSizes() const;
     const int* radioMargins() const;
-    void setRadioCellState(const RenderObject* o, const IntRect& r);
+    void setRadioCellState(const RenderObject*, const IntRect&);
 
-    void setButtonPaddingFromControlSize(RenderStyle* style, NSControlSize size) const;
+    void setButtonPaddingFromControlSize(RenderStyle*, NSControlSize) const;
     const IntSize* buttonSizes() const;
     const int* buttonMargins() const;
-    void setButtonCellState(const RenderObject* o, const IntRect& r);
+    void setButtonCellState(const RenderObject*, const IntRect&);
 
 private:
     NSButtonCell* checkbox;
index 6ecb5744efcc5ced1905f4acf0e8e832048eb2bd..aeff2133b0b65cf3650332c8538ab9e380b1af8a 100644 (file)
@@ -561,6 +561,14 @@ void RenderThemeMac::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyl
         addIntrinsicMargins(style, NSRegularControlSize);
 }
 
+bool RenderThemeMac::paintTextArea(RenderObject* o, const RenderObject::PaintInfo&, const IntRect& r)
+{
+    // FIXME: Ignores the GraphicsContext in the PaintInfo and always draws into the current
+    // NSGraphicsContext instead.
+    wkDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o));
+    return false;
+}
+
 void RenderThemeMac::adjustTextAreaStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
 {
     // Add in intrinsic margins if the font size isn't too small
index 1932a38c0cc700b12eb90be24720e4af6c97fd41..998609abb7e064a9a62c25657d7f957e07b7ef59 100644 (file)
@@ -1,3 +1,12 @@
+2006-06-16  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Alice.
+
+        Added initialization for WKDrawBezeledTextArea.
+
+        * WebCoreSupport/WebSystemInterface.m:
+        (InitWebCoreSystemInterface):
+
 2006-06-15  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Geoff and Darin.
index d93994d2751964a515921d7bcb68e03323bd72c2..0df3c8a1995661793b43f2f10e963d53b5867105 100644 (file)
@@ -43,6 +43,7 @@ void InitWebCoreSystemInterface(void)
     INIT(ClearGlyphVector);
     INIT(ConvertCharToGlyphs);
     INIT(DrawBezeledTextFieldCell);
+    INIT(DrawBezeledTextArea);
     INIT(DrawFocusRing);
     INIT(FontSmoothingModeIsLCD);
     INIT(GetATSStyleGroup);
index ea7b80c063b9508b065c1ec98788ab5075a260d6..0a45417f6c4d275fd33ae0fbf674bc74690eab2f 100644 (file)
@@ -1,3 +1,10 @@
+2006-06-16  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Alice.
+
+        * WebKitSystemInterface.h: Added WKDrawBezeledTextArea().
+        * libWebKitSystemInterface.a: ditto.
+
 2006-04-01  Eric Seidel  <eseidel@apple.com>
 
         * libWebKitSystemInterface.a: commit a universal binary.
index f7ea5accdd1dbdf6795cd27ad063305d36bc1897..64120c822c22d24451896b4ad6820c6522dc56b7 100644 (file)
@@ -99,6 +99,7 @@ void WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *co
 void WKSetDragImage(NSImage *image, NSPoint offset);
 
 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
+void WKDrawBezeledTextArea(NSRect, BOOL enabled);
 
 void WKSendUserChangeNotifications(void);
 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
index 120e927e4185c906f49522dad69f62858f98a341..9511793fdab8d3fe3241510e8d4d2e6bf25e078a 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterface.a and b/WebKitLibraries/libWebKitSystemInterface.a differ