Changeset 104240 in webkit
- Timestamp:
- Jan 5, 2012 4:30:50 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104236 r104240 1 2012-01-05 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=75654 4 Text fields should draw using NSTextFieldCell instead of WebKitSystemInterface 5 6 Reviewed by John Sullivan. 7 8 This change should not have any affect on tests or real web sites. It just changed 9 the implementation under the hood to the more modern NSCell approach. 10 * rendering/RenderThemeMac.h: 11 * rendering/RenderThemeMac.mm: 12 (WebCore::RenderThemeMac::paintTextField): 13 (WebCore::RenderThemeMac::textField): 14 1 15 2012-01-05 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebCore/rendering/RenderThemeMac.h
r99083 r104240 220 220 NSSliderCell* sliderThumbHorizontal() const; 221 221 NSSliderCell* sliderThumbVertical() const; 222 NSTextFieldCell* textField() const; 222 223 223 224 #if ENABLE(METER_TAG) … … 239 240 mutable RetainPtr<NSSliderCell> m_sliderThumbVertical; 240 241 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; 242 mutable RetainPtr<NSTextFieldCell> m_textField; 241 243 242 244 bool m_isSliderThumbHorizontalPressed; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r103863 r104240 714 714 { 715 715 LocalCurrentGraphicsContext localContext(paintInfo.context); 716 wkDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o)); 716 NSTextFieldCell* textField = this->textField(); 717 718 GraphicsContextStateSaver stateSaver(*paintInfo.context); 719 720 [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))]; 721 [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)]; 722 723 [textField setControlView:nil]; 724 717 725 return false; 718 726 } … … 2085 2093 } 2086 2094 2095 NSTextFieldCell* RenderThemeMac::textField() const 2096 { 2097 if (!m_textField) { 2098 m_textField.adoptNS([[NSTextFieldCell alloc] initTextCell:@""]); 2099 [m_textField.get() setBezeled:YES]; 2100 [m_textField.get() setEditable:YES]; 2101 [m_textField.get() setFocusRingType:NSFocusRingTypeExterior]; 2102 2103 // Setting a clear background on the cell is necessary for CSS-styled backgrounds 2104 // to show through. Ideally, there would be a better way to do this. 2105 [m_textField.get() setDrawsBackground:YES]; 2106 [m_textField.get() setBackgroundColor:[NSColor clearColor]]; 2107 } 2108 2109 return m_textField.get(); 2110 } 2111 2087 2112 String RenderThemeMac::fileListNameForWidth(const Vector<String>& filenames, const Font& font, int width, bool multipleFilesAllowed) 2088 2113 {
Note: See TracChangeset
for help on using the changeset viewer.