[webkit-changes] cvs commit: WebCore/kwq KWQAccObject.mm
KWQComboBox.mm KWQLineEdit.h KWQLineEdit.mm KWQButton.h
KWQButton.mm KWQPushButton.h KWQPushButton.mm
David
hyatt at opensource.apple.com
Fri Oct 21 14:27:54 PDT 2005
hyatt 05/10/21 14:27:53
Modified: . ChangeLog
WebCore.xcodeproj project.pbxproj
khtml/css cssstyleselector.cpp cssstyleselector.h
cssvalues.in html4.css
khtml/html html_formimpl.cpp html_formimpl.h
khtml/rendering render_form.cpp render_form.h render_style.h
render_theme.cpp render_theme.h render_theme_mac.h
render_theme_mac.mm
kwq KWQAccObject.mm KWQComboBox.mm KWQLineEdit.h
KWQLineEdit.mm
Added: khtml/rendering render_button.cpp render_button.h
Removed: ForwardingHeaders qpushbutton.h
kwq KWQButton.h KWQButton.mm KWQPushButton.h
KWQPushButton.mm
Log:
Land the new "NSView-less" buttons. With this landing both
<input type=button> and <button> will now look like OS X-style
widgets. Customization of background and border is not yet
enabled, but this is still a big improvement over the old
AppKit widgets.
Reviewed by mjs
* ForwardingHeaders/qpushbutton.h: Removed.
* WebCore.xcodeproj/project.pbxproj:
* khtml/css/cssstyleselector.cpp:
(khtml::CSSStyleSelector::adjustRenderStyle):
* khtml/css/cssstyleselector.h:
(khtml::CSSStyleSelector::paintMetrics):
* khtml/css/cssvalues.in:
* khtml/css/html4.css:
* khtml/html/html_formimpl.cpp:
(DOM::HTMLButtonElementImpl::createRenderer):
(DOM::HTMLInputElementImpl::click):
(DOM::HTMLInputElementImpl::createRenderer):
* khtml/html/html_formimpl.h:
(DOM::HTMLInputElementImpl::isTextButton):
* khtml/rendering/render_button.cpp: Added.
(khtml::m_inner):
(khtml::RenderButton::~RenderButton):
(khtml::RenderButton::addChild):
(khtml::RenderButton::removeChild):
(khtml::RenderButton::setStyle):
(khtml::RenderButton::updateFromElement):
* khtml/rendering/render_button.h: Added.
(khtml::RenderButton::removeLeftoverAnonymousBoxes):
(khtml::RenderButton::renderName):
* khtml/rendering/render_form.cpp:
* khtml/rendering/render_form.h:
(khtml::RenderFileButton::calcReplacedHeight):
(khtml::RenderFileButton::isEditable):
* khtml/rendering/render_style.h:
(khtml::):
* khtml/rendering/render_theme.cpp:
(khtml::RenderTheme::adjustStyle):
(khtml::RenderTheme::paint):
(khtml::RenderTheme::adjustCheckboxStyle):
(khtml::RenderTheme::adjustRadioStyle):
(khtml::RenderTheme::adjustButtonStyle):
* khtml/rendering/render_theme.h:
(khtml::RenderTheme::setButtonSize):
* khtml/rendering/render_theme_mac.h:
* khtml/rendering/render_theme_mac.mm:
(khtml::RenderThemeMac::setSizeFromFont):
(khtml::RenderThemeMac::setFontFromControlSize):
(khtml::RenderThemeMac::addIntrinsicMargins):
(khtml::RenderThemeMac::setButtonPaddingFromControlSize):
(khtml::RenderThemeMac::adjustButtonStyle):
(khtml::RenderThemeMac::buttonSizes):
(khtml::RenderThemeMac::buttonMargins):
(khtml::RenderThemeMac::setButtonSize):
(khtml::RenderThemeMac::setButtonCellState):
(khtml::RenderThemeMac::paintButton):
* kwq/KWQAccObject.mm:
(-[KWQAccObject actionElement]):
(-[KWQAccObject role]):
(-[KWQAccObject title]):
* kwq/KWQButton.h: Removed.
* kwq/KWQButton.mm: Removed.
* kwq/KWQComboBox.mm:
* kwq/KWQLineEdit.h:
* kwq/KWQLineEdit.mm:
* kwq/KWQPushButton.h: Removed.
* kwq/KWQPushButton.mm: Removed.
Revision Changes Path
1.254 +72 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.253
retrieving revision 1.254
diff -u -r1.253 -r1.254
--- ChangeLog 20 Oct 2005 06:02:20 -0000 1.253
+++ ChangeLog 21 Oct 2005 21:27:34 -0000 1.254
@@ -1,3 +1,75 @@
+2005-10-21 David Hyatt <hyatt at apple.com>
+
+ Land the new "NSView-less" buttons. With this landing both
+ <input type=button> and <button> will now look like OS X-style
+ widgets. Customization of background and border is not yet
+ enabled, but this is still a big improvement over the old
+ AppKit widgets.
+
+ Reviewed by mjs
+
+ * ForwardingHeaders/qpushbutton.h: Removed.
+ * WebCore.xcodeproj/project.pbxproj:
+ * khtml/css/cssstyleselector.cpp:
+ (khtml::CSSStyleSelector::adjustRenderStyle):
+ * khtml/css/cssstyleselector.h:
+ (khtml::CSSStyleSelector::paintMetrics):
+ * khtml/css/cssvalues.in:
+ * khtml/css/html4.css:
+ * khtml/html/html_formimpl.cpp:
+ (DOM::HTMLButtonElementImpl::createRenderer):
+ (DOM::HTMLInputElementImpl::click):
+ (DOM::HTMLInputElementImpl::createRenderer):
+ * khtml/html/html_formimpl.h:
+ (DOM::HTMLInputElementImpl::isTextButton):
+ * khtml/rendering/render_button.cpp: Added.
+ (khtml::m_inner):
+ (khtml::RenderButton::~RenderButton):
+ (khtml::RenderButton::addChild):
+ (khtml::RenderButton::removeChild):
+ (khtml::RenderButton::setStyle):
+ (khtml::RenderButton::updateFromElement):
+ * khtml/rendering/render_button.h: Added.
+ (khtml::RenderButton::removeLeftoverAnonymousBoxes):
+ (khtml::RenderButton::renderName):
+ * khtml/rendering/render_form.cpp:
+ * khtml/rendering/render_form.h:
+ (khtml::RenderFileButton::calcReplacedHeight):
+ (khtml::RenderFileButton::isEditable):
+ * khtml/rendering/render_style.h:
+ (khtml::):
+ * khtml/rendering/render_theme.cpp:
+ (khtml::RenderTheme::adjustStyle):
+ (khtml::RenderTheme::paint):
+ (khtml::RenderTheme::adjustCheckboxStyle):
+ (khtml::RenderTheme::adjustRadioStyle):
+ (khtml::RenderTheme::adjustButtonStyle):
+ * khtml/rendering/render_theme.h:
+ (khtml::RenderTheme::setButtonSize):
+ * khtml/rendering/render_theme_mac.h:
+ * khtml/rendering/render_theme_mac.mm:
+ (khtml::RenderThemeMac::setSizeFromFont):
+ (khtml::RenderThemeMac::setFontFromControlSize):
+ (khtml::RenderThemeMac::addIntrinsicMargins):
+ (khtml::RenderThemeMac::setButtonPaddingFromControlSize):
+ (khtml::RenderThemeMac::adjustButtonStyle):
+ (khtml::RenderThemeMac::buttonSizes):
+ (khtml::RenderThemeMac::buttonMargins):
+ (khtml::RenderThemeMac::setButtonSize):
+ (khtml::RenderThemeMac::setButtonCellState):
+ (khtml::RenderThemeMac::paintButton):
+ * kwq/KWQAccObject.mm:
+ (-[KWQAccObject actionElement]):
+ (-[KWQAccObject role]):
+ (-[KWQAccObject title]):
+ * kwq/KWQButton.h: Removed.
+ * kwq/KWQButton.mm: Removed.
+ * kwq/KWQComboBox.mm:
+ * kwq/KWQLineEdit.h:
+ * kwq/KWQLineEdit.mm:
+ * kwq/KWQPushButton.h: Removed.
+ * kwq/KWQPushButton.mm: Removed.
+
2005-10-19 Darin Adler <darin at apple.com>
Reviewed by Maciej.
1.35 +8 -24 WebCore/WebCore.xcodeproj/project.pbxproj
Index: project.pbxproj
===================================================================
RCS file: /cvs/root/WebCore/WebCore.xcodeproj/project.pbxproj,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- project.pbxproj 9 Oct 2005 04:17:33 -0000 1.34
+++ project.pbxproj 21 Oct 2005 21:27:41 -0000 1.35
@@ -166,7 +166,6 @@
93F1992508245E59001E9ABC /* KWQAsyncIO.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867902DE3B8601EA4122 /* KWQAsyncIO.h */; };
93F1992608245E59001E9ABC /* KWQBrush.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867B02DE3B8601EA4122 /* KWQBrush.h */; };
93F1992708245E59001E9ABC /* KWQBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867C02DE3B8601EA4122 /* KWQBuffer.h */; };
- 93F1992808245E59001E9ABC /* KWQButton.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867D02DE3B8601EA4122 /* KWQButton.h */; };
93F1992908245E59001E9ABC /* KWQCString.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868302DE3B8601EA4122 /* KWQCString.h */; };
93F1992A08245E59001E9ABC /* KWQCharsets.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784CC02DE375901EA4122 /* KWQCharsets.h */; };
93F1992C08245E59001E9ABC /* KWQCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868002DE3B8601EA4122 /* KWQCollection.h */; };
@@ -258,7 +257,6 @@
93F1998308245E59001E9ABC /* KWQPtrQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786AD02DE3B8601EA4122 /* KWQPtrQueue.h */; };
93F1998408245E59001E9ABC /* KWQPtrStack.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B802DE3B8601EA4122 /* KWQPtrStack.h */; };
93F1998508245E59001E9ABC /* KWQPtrVector.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C402DE3B8601EA4122 /* KWQPtrVector.h */; };
- 93F1998608245E59001E9ABC /* KWQPushButton.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B002DE3B8601EA4122 /* KWQPushButton.h */; };
93F1998808245E59001E9ABC /* KWQRect.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B202DE3B8601EA4122 /* KWQRect.h */; };
93F1998908245E59001E9ABC /* KWQRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = F587852A02DE375901EA4122 /* KWQRefPtr.h */; };
93F1998A08245E59001E9ABC /* KWQRegExp.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B302DE3B8601EA4122 /* KWQRegExp.h */; };
@@ -387,7 +385,6 @@
93F19A0E08245E59001E9ABC /* KWQArrayImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C602DE375801EA4122 /* KWQArrayImpl.mm */; };
93F19A0F08245E59001E9ABC /* KWQKPartsBrowserInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C702DE375801EA4122 /* KWQKPartsBrowserInterface.mm */; };
93F19A1008245E59001E9ABC /* KWQBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C802DE375901EA4122 /* KWQBuffer.mm */; };
- 93F19A1108245E59001E9ABC /* KWQButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C902DE375901EA4122 /* KWQButton.mm */; };
93F19A1308245E59001E9ABC /* KWQCharsets.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784CD02DE375901EA4122 /* KWQCharsets.mm */; };
93F19A1508245E59001E9ABC /* KWQCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784CF02DE375901EA4122 /* KWQCollection.mm */; };
93F19A1608245E59001E9ABC /* KWQColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784D002DE375901EA4122 /* KWQColor.mm */; };
@@ -532,7 +529,6 @@
93F19ABA08245E59001E9ABC /* dom2_traversalimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30502DE4476018635CA /* dom2_traversalimpl.cpp */; };
93F19ABB08245E59001E9ABC /* dom2_viewsimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30702DE4476018635CA /* dom2_viewsimpl.cpp */; };
93F19ABC08245E59001E9ABC /* xml_tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30902DE4476018635CA /* xml_tokenizer.cpp */; };
- 93F19ABD08245E59001E9ABC /* KWQPushButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F550D70A02E13281018635CA /* KWQPushButton.mm */; };
93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A4FD02E2220F018635CB /* WebCoreCache.mm */; };
93F19ABF08245E59001E9ABC /* WebCoreJavaScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A52C02E22573018635CB /* WebCoreJavaScript.mm */; };
93F19AC008245E59001E9ABC /* KWQKHTMLPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F54A61D302E3523B01A80180 /* KWQKHTMLPart.cpp */; };
@@ -972,7 +968,6 @@
A8212AF008794A2300677359 /* KWQAsyncIO.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867902DE3B8601EA4122 /* KWQAsyncIO.h */; };
A8212AF108794A2300677359 /* KWQBrush.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867B02DE3B8601EA4122 /* KWQBrush.h */; };
A8212AF208794A2300677359 /* KWQBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867C02DE3B8601EA4122 /* KWQBuffer.h */; };
- A8212AF308794A2300677359 /* KWQButton.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867D02DE3B8601EA4122 /* KWQButton.h */; };
A8212AF408794A2300677359 /* KWQCString.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868302DE3B8601EA4122 /* KWQCString.h */; };
A8212AF508794A2300677359 /* KWQCharsets.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784CC02DE375901EA4122 /* KWQCharsets.h */; };
A8212AF708794A2300677359 /* KWQCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868002DE3B8601EA4122 /* KWQCollection.h */; };
@@ -1064,7 +1059,6 @@
A8212B4E08794A2300677359 /* KWQPtrQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786AD02DE3B8601EA4122 /* KWQPtrQueue.h */; };
A8212B4F08794A2300677359 /* KWQPtrStack.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B802DE3B8601EA4122 /* KWQPtrStack.h */; };
A8212B5008794A2300677359 /* KWQPtrVector.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C402DE3B8601EA4122 /* KWQPtrVector.h */; };
- A8212B5108794A2300677359 /* KWQPushButton.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B002DE3B8601EA4122 /* KWQPushButton.h */; };
A8212B5308794A2300677359 /* KWQRect.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B202DE3B8601EA4122 /* KWQRect.h */; };
A8212B5408794A2300677359 /* KWQRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = F587852A02DE375901EA4122 /* KWQRefPtr.h */; };
A8212B5508794A2300677359 /* KWQRegExp.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B302DE3B8601EA4122 /* KWQRegExp.h */; };
@@ -1225,7 +1219,6 @@
A8212BF608794A2300677359 /* KWQArrayImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C602DE375801EA4122 /* KWQArrayImpl.mm */; };
A8212BF708794A2300677359 /* KWQKPartsBrowserInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C702DE375801EA4122 /* KWQKPartsBrowserInterface.mm */; };
A8212BF808794A2300677359 /* KWQBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C802DE375901EA4122 /* KWQBuffer.mm */; };
- A8212BF908794A2300677359 /* KWQButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784C902DE375901EA4122 /* KWQButton.mm */; };
A8212BFA08794A2300677359 /* KWQCharsets.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784CD02DE375901EA4122 /* KWQCharsets.mm */; };
A8212BFC08794A2300677359 /* KWQCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784CF02DE375901EA4122 /* KWQCollection.mm */; };
A8212BFD08794A2300677359 /* KWQColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784D002DE375901EA4122 /* KWQColor.mm */; };
@@ -1370,7 +1363,6 @@
A8212C8B08794A2300677359 /* dom2_traversalimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30502DE4476018635CA /* dom2_traversalimpl.cpp */; };
A8212C8C08794A2300677359 /* dom2_viewsimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30702DE4476018635CA /* dom2_viewsimpl.cpp */; };
A8212C8D08794A2300677359 /* xml_tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30902DE4476018635CA /* xml_tokenizer.cpp */; };
- A8212C8E08794A2300677359 /* KWQPushButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F550D70A02E13281018635CA /* KWQPushButton.mm */; };
A8212C8F08794A2300677359 /* WebCoreCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A4FD02E2220F018635CB /* WebCoreCache.mm */; };
A8212C9008794A2300677359 /* WebCoreJavaScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A52C02E22573018635CB /* WebCoreJavaScript.mm */; };
A8212C9108794A2300677359 /* KWQKHTMLPart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F54A61D302E3523B01A80180 /* KWQKHTMLPart.cpp */; };
@@ -2290,6 +2282,8 @@
BC179893088D975F006068A5 /* render_theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC179890088D975F006068A5 /* render_theme.cpp */; };
BC179894088D975F006068A5 /* render_theme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC179891088D975F006068A5 /* render_theme.h */; };
BC1798DA088DA4F8006068A5 /* render_theme_mac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1798D9088DA4F8006068A5 /* render_theme_mac.h */; };
+ BC42035C08FC334100B782E0 /* render_button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC42035A08FC334100B782E0 /* render_button.cpp */; };
+ BC42035D08FC334100B782E0 /* render_button.h in Headers */ = {isa = PBXBuildFile; fileRef = BC42035B08FC334100B782E0 /* render_button.h */; };
BCEF3434087B563E00BBF833 /* htmlfactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEF3432087B563E00BBF833 /* htmlfactory.cpp */; };
BCEF3435087B563E00BBF833 /* htmlfactory.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEF3433087B563E00BBF833 /* htmlfactory.h */; };
E1EE773708F1086C00166870 /* WebCoreTextDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE773508F1086C00166870 /* WebCoreTextDecoder.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3834,6 +3828,8 @@
BC3B364705C9D5E200E42902 /* dom_atomicstringlist.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dom_atomicstringlist.h; sourceTree = "<group>"; };
BC41978E059293F30016347F /* xbl_binding_manager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = xbl_binding_manager.h; path = xbl/xbl_binding_manager.h; sourceTree = "<group>"; };
BC419795059294CA0016347F /* xbl_binding_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = xbl_binding_manager.cpp; path = xbl/xbl_binding_manager.cpp; sourceTree = "<group>"; };
+ BC42035A08FC334100B782E0 /* render_button.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = render_button.cpp; sourceTree = "<group>"; };
+ BC42035B08FC334100B782E0 /* render_button.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = render_button.h; sourceTree = "<group>"; };
BC433ACF05D3046F003A5A14 /* stringit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stringit.cpp; sourceTree = "<group>"; };
BC7294F703804B3C00A80166 /* arena.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = arena.cpp; sourceTree = "<group>"; };
BC7294F803804B3C00A80166 /* arena.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = arena.h; sourceTree = "<group>"; };
@@ -4054,7 +4050,6 @@
F523D30902DE4476018635CA /* xml_tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = xml_tokenizer.cpp; sourceTree = "<group>"; };
F523D30A02DE4476018635CA /* xml_tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = xml_tokenizer.h; sourceTree = "<group>"; };
F54A61D302E3523B01A80180 /* KWQKHTMLPart.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = KWQKHTMLPart.cpp; sourceTree = "<group>"; };
- F550D70A02E13281018635CA /* KWQPushButton.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQPushButton.mm; sourceTree = "<group>"; };
F550D70B02E13281018635CA /* mac-encodings.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "mac-encodings.txt"; sourceTree = "<group>"; };
F550D70C02E13281018635CA /* make-charset-table.pl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.perl; path = "make-charset-table.pl"; sourceTree = "<group>"; };
F5517DC2031AB56301A80180 /* WebCoreHistory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = WebCoreHistory.h; path = kwq/WebCoreHistory.h; sourceTree = SOURCE_ROOT; };
@@ -4071,7 +4066,6 @@
F58784C602DE375801EA4122 /* KWQArrayImpl.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQArrayImpl.mm; sourceTree = "<group>"; };
F58784C702DE375801EA4122 /* KWQKPartsBrowserInterface.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKPartsBrowserInterface.mm; sourceTree = "<group>"; };
F58784C802DE375901EA4122 /* KWQBuffer.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQBuffer.mm; sourceTree = "<group>"; };
- F58784C902DE375901EA4122 /* KWQButton.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQButton.mm; sourceTree = "<group>"; };
F58784CC02DE375901EA4122 /* KWQCharsets.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQCharsets.h; sourceTree = "<group>"; };
F58784CD02DE375901EA4122 /* KWQCharsets.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQCharsets.mm; sourceTree = "<group>"; };
F58784CF02DE375901EA4122 /* KWQCollection.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQCollection.mm; sourceTree = "<group>"; };
@@ -4220,7 +4214,6 @@
F587867902DE3B8601EA4122 /* KWQAsyncIO.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQAsyncIO.h; sourceTree = "<group>"; };
F587867B02DE3B8601EA4122 /* KWQBrush.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQBrush.h; sourceTree = "<group>"; };
F587867C02DE3B8601EA4122 /* KWQBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQBuffer.h; sourceTree = "<group>"; };
- F587867D02DE3B8601EA4122 /* KWQButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQButton.h; sourceTree = "<group>"; };
F587868002DE3B8601EA4122 /* KWQCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQCollection.h; sourceTree = "<group>"; };
F587868102DE3B8601EA4122 /* KWQColor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQColor.h; sourceTree = "<group>"; };
F587868202DE3B8601EA4122 /* KWQComboBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQComboBox.h; sourceTree = "<group>"; };
@@ -4258,7 +4251,6 @@
F58786AD02DE3B8601EA4122 /* KWQPtrQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQPtrQueue.h; sourceTree = "<group>"; };
F58786AE02DE3B8601EA4122 /* KWQPtrStack.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQPtrStack.h; sourceTree = "<group>"; };
F58786AF02DE3B8601EA4122 /* KWQPtrVector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQPtrVector.h; sourceTree = "<group>"; };
- F58786B002DE3B8601EA4122 /* KWQPushButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQPushButton.h; sourceTree = "<group>"; };
F58786B202DE3B8601EA4122 /* KWQRect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQRect.h; sourceTree = "<group>"; };
F58786B302DE3B8601EA4122 /* KWQRegExp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQRegExp.h; sourceTree = "<group>"; };
F58786B402DE3B8601EA4122 /* KWQRegion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQRegion.h; sourceTree = "<group>"; };
@@ -6493,6 +6485,8 @@
F523D2A702DE4438018635CA /* render_box.cpp */,
F523D2AA02DE4438018635CA /* render_br.h */,
F523D2A902DE4438018635CA /* render_br.cpp */,
+ BC42035A08FC334100B782E0 /* render_button.cpp */,
+ BC42035B08FC334100B782E0 /* render_button.h */,
BC80A6940468B78100DBCC9C /* render_canvas.h */,
BC80A6930468B78100DBCC9C /* render_canvas.cpp */,
51F6A3DD0663C2EC004D2919 /* render_canvasimage.cpp */,
@@ -6789,8 +6783,6 @@
F587867B02DE3B8601EA4122 /* KWQBrush.h */,
F587867C02DE3B8601EA4122 /* KWQBuffer.h */,
F58784C802DE375901EA4122 /* KWQBuffer.mm */,
- F587867D02DE3B8601EA4122 /* KWQButton.h */,
- F58784C902DE375901EA4122 /* KWQButton.mm */,
F587868002DE3B8601EA4122 /* KWQCollection.h */,
F58784CF02DE375901EA4122 /* KWQCollection.mm */,
F587868102DE3B8601EA4122 /* KWQColor.h */,
@@ -6866,8 +6858,6 @@
F58786AD02DE3B8601EA4122 /* KWQPtrQueue.h */,
F58786AE02DE3B8601EA4122 /* KWQPtrStack.h */,
F58786AF02DE3B8601EA4122 /* KWQPtrVector.h */,
- F58786B002DE3B8601EA4122 /* KWQPushButton.h */,
- F550D70A02E13281018635CA /* KWQPushButton.mm */,
F58786B202DE3B8601EA4122 /* KWQRect.h */,
F587852902DE375901EA4122 /* KWQRect.mm */,
F58786B302DE3B8601EA4122 /* KWQRegExp.h */,
@@ -7010,7 +7000,6 @@
93F1992508245E59001E9ABC /* KWQAsyncIO.h in Headers */,
93F1992608245E59001E9ABC /* KWQBrush.h in Headers */,
93F1992708245E59001E9ABC /* KWQBuffer.h in Headers */,
- 93F1992808245E59001E9ABC /* KWQButton.h in Headers */,
93F1992908245E59001E9ABC /* KWQCString.h in Headers */,
93F1992A08245E59001E9ABC /* KWQCharsets.h in Headers */,
93F1992C08245E59001E9ABC /* KWQCollection.h in Headers */,
@@ -7102,7 +7091,6 @@
93F1998308245E59001E9ABC /* KWQPtrQueue.h in Headers */,
93F1998408245E59001E9ABC /* KWQPtrStack.h in Headers */,
93F1998508245E59001E9ABC /* KWQPtrVector.h in Headers */,
- 93F1998608245E59001E9ABC /* KWQPushButton.h in Headers */,
93F1998808245E59001E9ABC /* KWQRect.h in Headers */,
93F1998908245E59001E9ABC /* KWQRefPtr.h in Headers */,
93F1998A08245E59001E9ABC /* KWQRegExp.h in Headers */,
@@ -7254,6 +7242,7 @@
939885C408B7E3D100E707C4 /* EventNames.h in Headers */,
65C97AF308EA908800ACD273 /* config.h in Headers */,
E1EE773708F1086C00166870 /* WebCoreTextDecoder.h in Headers */,
+ BC42035D08FC334100B782E0 /* render_button.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -7354,7 +7343,6 @@
A8212AF008794A2300677359 /* KWQAsyncIO.h in Headers */,
A8212AF108794A2300677359 /* KWQBrush.h in Headers */,
A8212AF208794A2300677359 /* KWQBuffer.h in Headers */,
- A8212AF308794A2300677359 /* KWQButton.h in Headers */,
A8212AF408794A2300677359 /* KWQCString.h in Headers */,
A8212AF508794A2300677359 /* KWQCharsets.h in Headers */,
A8212AF708794A2300677359 /* KWQCollection.h in Headers */,
@@ -7446,7 +7434,6 @@
A8212B4E08794A2300677359 /* KWQPtrQueue.h in Headers */,
A8212B4F08794A2300677359 /* KWQPtrStack.h in Headers */,
A8212B5008794A2300677359 /* KWQPtrVector.h in Headers */,
- A8212B5108794A2300677359 /* KWQPushButton.h in Headers */,
A8212B5308794A2300677359 /* KWQRect.h in Headers */,
A8212B5408794A2300677359 /* KWQRefPtr.h in Headers */,
A8212B5508794A2300677359 /* KWQRegExp.h in Headers */,
@@ -9300,7 +9287,6 @@
93F19A0E08245E59001E9ABC /* KWQArrayImpl.mm in Sources */,
93F19A0F08245E59001E9ABC /* KWQKPartsBrowserInterface.mm in Sources */,
93F19A1008245E59001E9ABC /* KWQBuffer.mm in Sources */,
- 93F19A1108245E59001E9ABC /* KWQButton.mm in Sources */,
93F19A1308245E59001E9ABC /* KWQCharsets.mm in Sources */,
93F19A1508245E59001E9ABC /* KWQCollection.mm in Sources */,
93F19A1608245E59001E9ABC /* KWQColor.mm in Sources */,
@@ -9445,7 +9431,6 @@
93F19ABA08245E59001E9ABC /* dom2_traversalimpl.cpp in Sources */,
93F19ABB08245E59001E9ABC /* dom2_viewsimpl.cpp in Sources */,
93F19ABC08245E59001E9ABC /* xml_tokenizer.cpp in Sources */,
- 93F19ABD08245E59001E9ABC /* KWQPushButton.mm in Sources */,
93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */,
93F19ABF08245E59001E9ABC /* WebCoreJavaScript.mm in Sources */,
93F19AC008245E59001E9ABC /* KWQKHTMLPart.cpp in Sources */,
@@ -9560,6 +9545,7 @@
7E6FEED90898582300C44C3F /* WebCoreScriptDebugger.mm in Sources */,
939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */,
E1EE773808F1086C00166870 /* WebCoreTextDecoder.mm in Sources */,
+ BC42035C08FC334100B782E0 /* render_button.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -9572,7 +9558,6 @@
A8212BF608794A2300677359 /* KWQArrayImpl.mm in Sources */,
A8212BF708794A2300677359 /* KWQKPartsBrowserInterface.mm in Sources */,
A8212BF808794A2300677359 /* KWQBuffer.mm in Sources */,
- A8212BF908794A2300677359 /* KWQButton.mm in Sources */,
A8212BFA08794A2300677359 /* KWQCharsets.mm in Sources */,
A8212BFC08794A2300677359 /* KWQCollection.mm in Sources */,
A8212BFD08794A2300677359 /* KWQColor.mm in Sources */,
@@ -9717,7 +9702,6 @@
A8212C8B08794A2300677359 /* dom2_traversalimpl.cpp in Sources */,
A8212C8C08794A2300677359 /* dom2_viewsimpl.cpp in Sources */,
A8212C8D08794A2300677359 /* xml_tokenizer.cpp in Sources */,
- A8212C8E08794A2300677359 /* KWQPushButton.mm in Sources */,
A8212C8F08794A2300677359 /* WebCoreCache.mm in Sources */,
A8212C9008794A2300677359 /* WebCoreJavaScript.mm in Sources */,
A8212C9108794A2300677359 /* KWQKHTMLPart.cpp in Sources */,
1.211 +1 -1 WebCore/khtml/css/cssstyleselector.cpp
Index: cssstyleselector.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.cpp,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -r1.210 -r1.211
--- cssstyleselector.cpp 19 Oct 2005 00:03:44 -0000 1.210
+++ cssstyleselector.cpp 21 Oct 2005 21:27:43 -0000 1.211
@@ -995,7 +995,7 @@
// Let the theme get a crack at changing the style if an appearance has been set.
if (style->hasAppearance())
- theme()->adjustStyle(style);
+ theme()->adjustStyle(this, style, e);
// Only use slow repaints if we actually have a background image.
// FIXME: We only need to invalidate the fixed regions when scrolling. It's total overkill to
1.40 +2 -0 WebCore/khtml/css/cssstyleselector.h
Index: cssstyleselector.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- cssstyleselector.h 3 Oct 2005 21:12:08 -0000 1.39
+++ cssstyleselector.h 21 Oct 2005 21:27:44 -0000 1.40
@@ -139,6 +139,8 @@
QColor getColorFromPrimitiveValue(DOM::CSSPrimitiveValueImpl* primitiveValue);
+ QPaintDeviceMetrics* paintMetrics() const { return paintDeviceMetrics; }
+
protected:
/* checks if a compound selector (which can consist of multiple simple selectors)
1.34 +2 -1 WebCore/khtml/css/cssvalues.in
Index: cssvalues.in
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/cssvalues.in,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- cssvalues.in 30 Sep 2005 00:03:19 -0000 1.33
+++ cssvalues.in 21 Oct 2005 21:27:44 -0000 1.34
@@ -440,8 +440,9 @@
#
checkbox
radio
+push-button
+square-button
button
-button-bevel
listbox
listitem
menulist
1.78 +13 -10 WebCore/khtml/css/html4.css
Index: html4.css
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/html4.css,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- html4.css 9 Oct 2005 02:14:05 -0000 1.77
+++ html4.css 21 Oct 2005 21:27:44 -0000 1.78
@@ -278,15 +278,8 @@
}
button {
- border: 2px outset ButtonFace;
- background-color: ButtonFace;
- color: ButtonText;
- padding: 2px 2px 2px 2px;
- cursor: default
-}
-
-button:active {
- border-style: inset
+ cursor: default;
+ -khtml-appearance: button
}
input, textarea {
@@ -299,7 +292,7 @@
font: 11px 'Lucida Grande';
color: initial;
display: inline-block;
- -khtml-box-sizing: border-box
+ box-sizing: border-box
}
input[type="hidden"] {
@@ -311,6 +304,16 @@
-khtml-user-select: ignore
}
+input[type="button"], input[type="submit"], input[type="reset"]
+{
+ -khtml-appearance: push-button
+}
+
+input[type="button"], input[type="submit"], input[type="reset"], button {
+ -khtml-box-align: center;
+ text-align:center;
+}
+
select, button, input[type="button"], input[type="image"], input[type="submit"], input[type="reset"], img {
-khtml-user-select: ignore
}
1.199 +12 -15 WebCore/khtml/html/html_formimpl.cpp
Index: html_formimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.cpp,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- html_formimpl.cpp 9 Oct 2005 03:31:09 -0000 1.198
+++ html_formimpl.cpp 21 Oct 2005 21:27:45 -0000 1.199
@@ -46,6 +46,7 @@
#include "khtml_ext.h"
#include "rendering/render_form.h"
+#include "render_button.h"
#include "render_theme.h"
#include <kcharsets.h>
@@ -1200,6 +1201,11 @@
{
}
+RenderObject* HTMLButtonElementImpl::createRenderer(RenderArena* arena, RenderStyle* style)
+{
+ return new (arena) RenderButton(this);
+}
+
DOMString HTMLButtonElementImpl::type() const
{
return getAttribute(typeAttr);
@@ -1699,17 +1705,7 @@
break;
case SUBMIT:
case RESET:
- case BUTTON:
-#if APPLE_CHANGES
- {
- QWidget *widget;
- if (showPressedLook && renderer() && (widget = static_cast<RenderWidget *>(renderer())->widget())) {
- // using this method gives us nice Cocoa user interface feedback
- static_cast<QButton *>(widget)->click(sendMouseEvents);
- break;
- }
- }
-#endif
+ case BUTTON:
HTMLGenericFormElementImpl::click(sendMouseEvents, showPressedLook);
break;
case FILE:
@@ -1919,12 +1915,13 @@
case CHECKBOX:
case RADIO:
return RenderObject::createObject(this, style);
- case SUBMIT: return new (arena) RenderSubmitButton(this);
+ case SUBMIT:
+ case RESET:
+ case BUTTON:
+ return new (arena) RenderButton(this);
case IMAGE: return new (arena) RenderImageButton(this);
- case RESET: return new (arena) RenderResetButton(this);
case FILE: return new (arena) RenderFileButton(this);
- case BUTTON: return new (arena) RenderPushButton(this);
-#if APPLE_CHANGES
+ #if APPLE_CHANGES
case RANGE: return new (arena) RenderSlider(this);
#endif
case HIDDEN: break;
1.91 +4 -0 WebCore/khtml/html/html_formimpl.h
Index: html_formimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.h,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- html_formimpl.h 28 Sep 2005 22:01:36 -0000 1.90
+++ html_formimpl.h 21 Oct 2005 21:27:45 -0000 1.91
@@ -251,6 +251,8 @@
};
DOMString type() const;
+
+ virtual khtml::RenderObject *createRenderer(RenderArena*, khtml::RenderStyle*);
virtual void parseMappedAttribute(MappedAttributeImpl *attr);
virtual void defaultEventHandler(EventImpl *evt);
@@ -346,6 +348,8 @@
virtual bool isChecked() const { return checked(); }
+ bool isTextButton() const { return m_type == SUBMIT || m_type == RESET || m_type == BUTTON; }
+
bool checked() const { return m_checked; }
void setChecked(bool);
int maxLength() const { return m_maxLen; }
1.129 +0 -124 WebCore/khtml/rendering/render_form.cpp
Index: render_form.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_form.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -r1.128 -r1.129
--- render_form.cpp 18 Oct 2005 20:45:37 -0000 1.128
+++ render_form.cpp 21 Oct 2005 21:27:46 -0000 1.129
@@ -254,112 +254,6 @@
#endif
-// -------------------------------------------------------------------------
-
-RenderButton::RenderButton(HTMLGenericFormElementImpl *element)
- : RenderFormElement(element)
-{
-}
-
-short RenderButton::baselinePosition( bool f, bool isRootLineBox ) const
-{
-#if APPLE_CHANGES
- return RenderFormElement::baselinePosition( f, isRootLineBox );
-#else
- return RenderWidget::baselinePosition( f, isRootLineBox ) - 2;
-#endif
-}
-
-// -------------------------------------------------------------------------------
-
-RenderSubmitButton::RenderSubmitButton(HTMLInputElementImpl *element)
- : RenderButton(element)
-{
- QPushButton* p = new QPushButton(view()->viewport());
- setQWidget(p);
- p->setAutoMask(true);
- p->setMouseTracking(true);
- connect(p, SIGNAL(clicked()), this, SLOT(slotClicked()));
-}
-
-QString RenderSubmitButton::rawText()
-{
- QString value = element()->valueWithDefault().qstring();
- value = value.stripWhiteSpace();
- value.replace(QChar('\\'), backslashAsCurrencySymbol());
-#if APPLE_CHANGES
- return value;
-#else
- QString raw;
- for(unsigned int i = 0; i < value.length(); i++) {
- raw += value[i];
- if(value[i] == '&')
- raw += '&';
- }
- return raw;
-#endif
-}
-
-void RenderSubmitButton::calcMinMaxWidth()
-{
- KHTMLAssert( !minMaxKnown() );
-
-#if APPLE_CHANGES
- // Let the widget tell us how big it wants to be.
- QSize s(widget()->sizeHint());
- setIntrinsicWidth(s.width());
- setIntrinsicHeight(s.height());
-#else
- QString raw = rawText();
- QPushButton* pb = static_cast<QPushButton*>(m_widget);
- pb->setText(raw);
- pb->setFont(style()->font());
-
- bool empty = raw.isEmpty();
- if ( empty )
- raw = QString::fromLatin1("XXXX");
- QFontMetrics fm = pb->fontMetrics();
- int margin = pb->style().pixelMetric( QStyle::PM_ButtonMargin, pb);
- QSize s(pb->style().sizeFromContents(
- QStyle::CT_PushButton, pb, fm.size( ShowPrefix, raw))
- .expandedTo(QApplication::globalStrut()));
-
- setIntrinsicWidth( s.width() - margin / 2 );
- setIntrinsicHeight( s.height() - margin / 2);
-#endif
-
- RenderButton::calcMinMaxWidth();
-}
-
-#if APPLE_CHANGES
-
-void RenderSubmitButton::setStyle(RenderStyle *s)
-{
- RenderButton::setStyle(s);
-
- QPushButton *w = static_cast<QPushButton*>(m_widget);
- w->setWritingDirection(style()->direction() == RTL ? QPainter::RTL : QPainter::LTR);
-}
-
-#endif
-
-void RenderSubmitButton::updateFromElement()
-{
- QPushButton *w = static_cast<QPushButton*>(m_widget);
-
- QString oldText = w->text();
- QString newText = rawText();
- w->setText(newText);
- if ( oldText != newText )
- setNeedsLayoutAndMinMaxRecalc();
- RenderFormElement::updateFromElement();
-}
-
-short RenderSubmitButton::baselinePosition( bool f, bool isRootLineBox ) const
-{
- return RenderFormElement::baselinePosition( f, isRootLineBox );
-}
-
// -------------------------------------------------------------------------------
RenderImageButton::RenderImageButton(HTMLInputElementImpl *element)
@@ -370,24 +264,6 @@
// -------------------------------------------------------------------------------
-// FIXME: No real reason to need separate classes for RenderResetButton and
-// RenderSubmitButton now that the default label is handled on the DOM side.
-RenderResetButton::RenderResetButton(HTMLInputElementImpl *element)
- : RenderSubmitButton(element)
-{
-}
-
-// -------------------------------------------------------------------------------
-
-// FIXME: No real reason to need separate classes for RenderPushButton and
-// RenderSubmitButton now that the default label is handled on the DOM side.
-RenderPushButton::RenderPushButton(HTMLInputElementImpl *element)
- : RenderSubmitButton(element)
-{
-}
-
-// -------------------------------------------------------------------------------
-
#if !APPLE_CHANGES
LineEditWidget::LineEditWidget(QWidget *parent)
1.57 +0 -81 WebCore/khtml/rendering/render_form.h
Index: render_form.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_form.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- render_form.h 6 Oct 2005 00:53:57 -0000 1.56
+++ render_form.h 21 Oct 2005 21:27:47 -0000 1.57
@@ -36,7 +36,6 @@
#include <qtextedit.h>
#include <klineedit.h>
-#include <qpushbutton.h>
#include <qhbox.h>
#include <klistbox.h>
#include <kcombobox.h>
@@ -110,7 +109,6 @@
#endif
protected:
- virtual bool isRenderButton() const { return false; }
virtual bool isEditable() const { return false; }
AlignmentFlags textAlignment() const;
@@ -118,51 +116,6 @@
// -------------------------------------------------------------------------
-// generic class for all buttons
-class RenderButton : public RenderFormElement
-{
- Q_OBJECT
-public:
- RenderButton(DOM::HTMLGenericFormElementImpl* node);
-
-#if APPLE_CHANGES
- int calcReplacedHeight() const { return intrinsicHeight(); }
- virtual bool canHaveIntrinsicMargins() const { return true; }
-#endif
-
- virtual const char *renderName() const { return "RenderButton"; }
- virtual short baselinePosition( bool, bool ) const;
-
- // don't even think about making this method virtual!
- DOM::HTMLInputElementImpl* element() const
- { return static_cast<DOM::HTMLInputElementImpl*>(RenderObject::element()); }
-
-protected:
- virtual bool isRenderButton() const { return true; }
-};
-
-// -------------------------------------------------------------------------
-
-class RenderSubmitButton : public RenderButton
-{
-public:
- RenderSubmitButton(DOM::HTMLInputElementImpl *element);
-
- virtual const char *renderName() const { return "RenderSubmitButton"; }
-
- virtual void calcMinMaxWidth();
- virtual void updateFromElement();
- virtual short baselinePosition( bool, bool ) const;
-#if APPLE_CHANGES
- virtual void setStyle(RenderStyle *);
-#endif
-
-private:
- QString rawText();
-};
-
-// -------------------------------------------------------------------------
-
class RenderImageButton : public RenderImage
{
public:
@@ -172,25 +125,6 @@
virtual bool isImageButton() const { return true; }
};
-
-// -------------------------------------------------------------------------
-
-class RenderResetButton : public RenderSubmitButton
-{
-public:
- RenderResetButton(DOM::HTMLInputElementImpl *element);
-
- virtual const char *renderName() const { return "RenderResetButton"; }
-};
-
-// -------------------------------------------------------------------------
-
-class RenderPushButton : public RenderSubmitButton
-{
-public:
- RenderPushButton(DOM::HTMLInputElementImpl *element);
-};
-
// -------------------------------------------------------------------------
class RenderLineEdit : public RenderFormElement
@@ -284,20 +218,12 @@
virtual void updateFromElement();
void select();
-#if APPLE_CHANGES
int calcReplacedHeight() const { return intrinsicHeight(); }
-#endif
DOM::HTMLInputElementImpl *element() const
{ return static_cast<DOM::HTMLInputElementImpl*>(RenderObject::element()); }
-#if !APPLE_CHANGES
- KLineEdit* lineEdit() const { return m_edit; }
-#endif
-
-#if APPLE_CHANGES
void click(bool sendMouseEvents);
-#endif
public slots:
virtual void slotClicked();
@@ -306,13 +232,6 @@
protected:
virtual bool isEditable() const { return true; }
-
-#if !APPLE_CHANGES
- virtual void handleFocusOut();
-
- KLineEdit *m_edit;
- QPushButton *m_button;
-#endif
};
1.94 +1 -1 WebCore/khtml/rendering/render_style.h
Index: render_style.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_style.h,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- render_style.h 3 Oct 2005 21:12:41 -0000 1.93
+++ render_style.h 21 Oct 2005 21:27:47 -0000 1.94
@@ -747,7 +747,7 @@
};
enum EAppearance {
- NoAppearance, CheckboxAppearance, RadioAppearance, ButtonAppearance,
+ NoAppearance, CheckboxAppearance, RadioAppearance, PushButtonAppearance, SquareButtonAppearance, ButtonAppearance,
ButtonBevelAppearance, ListboxAppearance, ListItemAppearance, MenulistAppearance,
MenulistButtonAppearance, MenulistTextAppearance, MenulistTextFieldAppearance,
ScrollbarButtonUpAppearance, ScrollbarButtonDownAppearance,
1.12 +23 -6 WebCore/khtml/rendering/render_theme.cpp
Index: render_theme.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_theme.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- render_theme.cpp 3 Oct 2005 21:12:42 -0000 1.11
+++ render_theme.cpp 21 Oct 2005 21:27:47 -0000 1.12
@@ -29,25 +29,31 @@
using namespace DOM::HTMLNames;
using DOM::HTMLInputElementImpl;
+using DOM::ElementImpl;
// The methods in this file are shared by all themes on every platform.
namespace khtml {
-void RenderTheme::adjustStyle(RenderStyle* style)
+void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, ElementImpl* e)
{
// Force inline to be inline-block
if (style->display() == INLINE)
style->setDisplay(INLINE_BLOCK);
else if (style->display() == COMPACT || style->display() == RUN_IN || style->display() == LIST_ITEM)
style->setDisplay(BLOCK);
-
+ // FIXME: Do we really want to honor table display styles?
+
// Call the appropriate style adjustment method based off the appearance value.
switch (style->appearance()) {
case CheckboxAppearance:
- return adjustCheckboxStyle(style);
+ return adjustCheckboxStyle(selector, style, e);
case RadioAppearance:
- return adjustRadioStyle(style);
+ return adjustRadioStyle(selector, style, e);
+ case PushButtonAppearance:
+ case SquareButtonAppearance:
+ case ButtonAppearance:
+ return adjustButtonStyle(selector, style, e);
default:
break;
}
@@ -72,6 +78,10 @@
return paintCheckbox(o, i, r);
case RadioAppearance:
return paintRadio(o, i, r);
+ case PushButtonAppearance:
+ case SquareButtonAppearance:
+ case ButtonAppearance:
+ return paintButton(o, i, r);
default:
break;
}
@@ -132,7 +142,7 @@
return o->element()->active();
}
-void RenderTheme::adjustCheckboxStyle(RenderStyle* style) const
+void RenderTheme::adjustCheckboxStyle(CSSStyleSelector* selector, RenderStyle* style, ElementImpl* e) const
{
// A summary of the rules for checkbox designed to match WinIE:
// width/height - honored (WinIE actually scales its control for small widths, but lets it overflow for small heights.)
@@ -147,7 +157,7 @@
style->resetBorder();
}
-void RenderTheme::adjustRadioStyle(RenderStyle* style) const
+void RenderTheme::adjustRadioStyle(CSSStyleSelector* selector, RenderStyle* style, ElementImpl* e) const
{
// A summary of the rules for checkbox designed to match WinIE:
// width/height - honored (WinIE actually scales its control for small widths, but lets it overflow for small heights.)
@@ -162,4 +172,11 @@
style->resetBorder();
}
+void RenderTheme::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, ElementImpl* e) const
+{
+ // Most platforms will completely honor all CSS, and so we have no need to adjust the style
+ // at all by default. We will still allow the theme a crack at setting up a desired vertical size.
+ setButtonSize(style);
+}
+
}
1.10 +11 -3 WebCore/khtml/rendering/render_theme.h
Index: render_theme.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_theme.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- render_theme.h 8 Aug 2005 21:12:00 -0000 1.9
+++ render_theme.h 21 Oct 2005 21:27:47 -0000 1.10
@@ -25,6 +25,10 @@
#include "render_object.h"
+namespace DOM {
+class ElementImpl;
+};
+
namespace khtml {
class RenderStyle;
@@ -41,7 +45,7 @@
// metrics and defaults given the contents of the style. This includes sophisticated operations like
// selection of control size based off the font, the disabling of appearance when certain other properties like
// "border" are set, or if the appearance is not supported by the theme.
- void adjustStyle(RenderStyle* style);
+ void adjustStyle(CSSStyleSelector* selector, RenderStyle* style, DOM::ElementImpl* e);
// This method is called to paint the widget as a background of the RenderObject. A widget's foreground, e.g., the
// text of a button, is always rendered by the engine itself.
@@ -85,13 +89,17 @@
bool isPressed(const RenderObject* o) const;
// Methods for each appearance value.
- virtual void adjustCheckboxStyle(RenderStyle* style) const;
+ virtual void adjustCheckboxStyle(CSSStyleSelector* selector, RenderStyle* style, DOM::ElementImpl* e) const;
virtual void paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r) = 0;
virtual void setCheckboxSize(RenderStyle* style) const {};
- virtual void adjustRadioStyle(RenderStyle* style) const;
+ virtual void adjustRadioStyle(CSSStyleSelector* selector, RenderStyle* style, DOM::ElementImpl* e) const;
virtual void paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r) = 0;
virtual void setRadioSize(RenderStyle* style) const {};
+
+ virtual void adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, DOM::ElementImpl* e) const;
+ virtual void paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r) = 0;
+ virtual void setButtonSize(RenderStyle* style) const {};
};
// Function to obtain the theme. This is implemented in your platform-specific theme implementation to hand
1.7 +14 -1 WebCore/khtml/rendering/render_theme_mac.h
Index: render_theme_mac.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_theme_mac.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- render_theme_mac.h 8 Aug 2005 21:12:00 -0000 1.6
+++ render_theme_mac.h 21 Oct 2005 21:27:47 -0000 1.7
@@ -55,6 +55,10 @@
virtual void paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r);
virtual void setRadioSize(RenderStyle* style) const;
+ virtual void adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, DOM::ElementImpl* e) const;
+ virtual void paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r);
+ virtual void setButtonSize(RenderStyle* style) const;
+
private:
QRect inflateRect(const QRect& r, const QSize& size, const int* margins) const;
@@ -63,7 +67,10 @@
void setControlSize(NSCell* cell, const QSize* sizes, const QSize& minSize);
void setSizeFromFont(RenderStyle* style, const QSize* sizes) const;
QSize sizeForFont(RenderStyle* style, const QSize* sizes) const;
-
+ void setFontFromControlSize(CSSStyleSelector* selector, RenderStyle* style, NSControlSize size) const;
+
+ void addIntrinsicMargins(RenderStyle* style, NSControlSize size) const;
+
void updateCheckedState(NSCell* cell, const RenderObject* o);
void updateEnabledState(NSCell* cell, const RenderObject* o);
void updateFocusedState(NSCell* cell, const RenderObject* o);
@@ -78,9 +85,15 @@
const int* radioMargins() const;
void setRadioCellState(const RenderObject* o, const QRect& r);
+ void setButtonPaddingFromControlSize(RenderStyle* style, NSControlSize size) const;
+ const QSize* buttonSizes() const;
+ const int* buttonMargins() const;
+ void setButtonCellState(const RenderObject* o, const QRect& r);
+
private:
NSButtonCell* checkbox;
NSButtonCell* radio;
+ NSButtonCell* button;
};
}
1.9 +212 -3 WebCore/khtml/rendering/render_theme_mac.mm
Index: render_theme_mac.mm
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_theme_mac.mm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- render_theme_mac.mm 3 Oct 2005 21:12:42 -0000 1.8
+++ render_theme_mac.mm 21 Oct 2005 21:27:47 -0000 1.9
@@ -22,6 +22,8 @@
#include "config.h"
#import "render_theme_mac.h"
+#import "cssstyleselector.h"
+#import "font.h"
#import "render_style.h"
#import "render_canvas.h"
#import "dom_elementimpl.h"
@@ -29,6 +31,8 @@
// The methods in this file are specific to the Mac OS X platform.
+using DOM::ElementImpl;
+
enum {
topMargin,
rightMargin,
@@ -167,12 +171,51 @@
{
// FIXME: Check is flawed, since it doesn't take min-width/max-width into account.
QSize size = sizeForFont(style, sizes);
- if (style->width().isIntrinsicOrAuto())
+ if (style->width().isIntrinsicOrAuto() && size.width() > 0)
style->setWidth(Length(size.width(), Fixed));
- if (style->height().isAuto())
+ if (style->height().isAuto() && size.height() > 0)
style->setHeight(Length(size.height(), Fixed));
}
+void RenderThemeMac::setFontFromControlSize(CSSStyleSelector* selector, RenderStyle* style, NSControlSize controlSize) const
+{
+ FontDef fontDef(style->htmlFont().getFontDef());
+ fontDef.isAbsoluteSize = true;
+ fontDef.genericFamily = FontDef::eSansSerif;
+
+ NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSize]];
+ fontDef.family.setFamily(QString::fromNSString([font fontName]));
+ fontDef.computedSize = fontDef.specifiedSize = [font pointSize];
+
+ if (style->setFontDef(fontDef))
+ style->htmlFont().update(selector->paintMetrics());
+}
+
+void RenderThemeMac::addIntrinsicMargins(RenderStyle* style, NSControlSize size) const
+{
+ // Cut out the intrinsic margins completely if we end up using mini controls.
+ if (size == NSMiniControlSize)
+ return;
+
+ // Intrinsic margin value.
+ const int m = 2;
+
+ // FIXME: Using width/height alone and not also dealing with min-width/max-width is flawed.
+ if (style->width().isIntrinsicOrAuto()) {
+ if (style->marginLeft().quirk)
+ style->setMarginLeft(Length(m, Fixed));
+ if (style->marginRight().quirk)
+ style->setMarginRight(Length(m, Fixed));
+ }
+
+ if (style->height().isAuto()) {
+ if (style->marginTop().quirk)
+ style->setMarginTop(Length(m, Fixed));
+ if (style->marginBottom().quirk)
+ style->setMarginBottom(Length(m, Fixed));
+ }
+}
+
void RenderThemeMac::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r)
{
// Determine the width and height needed for the control and prepare the cell for painting.
@@ -220,7 +263,6 @@
updateFocusedState(checkbox, o);
}
-
void RenderThemeMac::setCheckboxSize(RenderStyle* style) const
{
// If the width and height are both specified, then we have nothing to do.
@@ -289,4 +331,171 @@
setSizeFromFont(style, radioSizes());
}
+void RenderThemeMac::setButtonPaddingFromControlSize(RenderStyle* style, NSControlSize size) const
+{
+ // More magical mystery constants designed to match what NSButtonCell does by default with push-in buttons.
+ int padding;
+ switch (size) {
+ case NSRegularControlSize:
+ padding = 8;
+ break;
+ case NSSmallControlSize:
+ padding = 8;
+ break;
+ case NSMiniControlSize:
+ padding = 11;
+ break;
+ }
+ style->setPaddingLeft(Length(padding, Fixed));
+ style->setPaddingRight(Length(padding, Fixed));
+ style->setPaddingTop(Length(0, Fixed));
+ style->setPaddingBottom(Length(0, Fixed));
+}
+
+void RenderThemeMac::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, ElementImpl* e) const
+{
+ // There are three appearance constants for buttons.
+ // (1) Push-button is the constant for the default Aqua system button. Push buttons will not scale vertically and will not allow
+ // custom fonts or colors. <input>s use this constant. The fundamental rule for push-button is that we will never display a push-button
+ // that looks "half-Aqua." Either the button will look perfectly native, or it will turn off the Aqua look completely.
+ // (2) square-button is the constant for the square button. This button will allow custom fonts and colors and will scale vertically.
+ // (3) Button is the constant that means "pick the best button as appropriate." <button>s use this constant. This button will
+ // also scale vertically and allow custom fonts and colors. It will attempt to use Aqua if possible and will make this determination
+ // solely on the rectangle of the control.
+
+ // Determine our control size based off our font.
+ NSControlSize controlSize = controlSizeForFont(style);
+
+ // Add in intrinsic margins
+ addIntrinsicMargins(style, controlSize);
+
+ // Whenever a button has a background or border specified, then appearance is disabled.
+ // FIXME: We can't support the disabling of appearance yet until box-sizing is fully implemented.
+ bool disableAppearance = false; // style->hasBorder() || style->hasBackground();
+ if (!disableAppearance) {
+ // FIXME: This line is temporary. It can go away once the presence of a border really disables appearance.
+ style->resetBorder();
+
+ if (style->appearance() == PushButtonAppearance) {
+ // Color is locked to black.
+ if (!e || e->isEnabled())
+ style->setColor(Qt::black);
+ else
+ style->setColor(QColor(128,128,128));
+
+ // Height is locked to auto.
+ style->setHeight(Length(Auto));
+
+ // Set the button's vertical size.
+ setButtonSize(style);
+
+ // Add in the padding that we'd like to use.
+ setButtonPaddingFromControlSize(style, controlSize);
+
+ // Our font is locked to the appropriate system font size for the control. To clarify, we first use the CSS-specified font to figure out
+ // a reasonable control size, but once that control size is determined, we throw that font away and use the appropriate
+ // system font for the control size instead.
+ setFontFromControlSize(selector, style, controlSize);
+ } else {
+ // Reset padding to a sensible size.
+ // FIXME: Honor author's padding if it's set.
+ style->setPaddingLeft(Length(8, Fixed));
+ style->setPaddingRight(Length(8, Fixed));
+ style->setPaddingTop(Length(2, Fixed));
+ style->setPaddingBottom(Length(3, Fixed));
+
+ // Set a min-height so that we can't get smaller than the mini button.
+ // FIXME: Once we support box-sizing, we'll have to change this value to include the padding.
+ style->setMinHeight(Length(10, Fixed));
+
+ // Color is locked to black.
+ // FIXME: Honor author's color if it's set.
+ if (!e || e->isEnabled())
+ style->setColor(Qt::black);
+ else
+ style->setColor(QColor(128,128,128));
+ }
+ } else {
+ // FIXME: We're going to have to make sure some sort of decent padding/border/background is in effect when the appearance gets turned off.
+ // We will need to know whether or not the user set these, and then fill in the ones that weren't set.
+ }
+
+}
+
+const QSize* RenderThemeMac::buttonSizes() const
+{
+ static const QSize sizes[3] = { QSize(0, 21), QSize(0, 18), QSize(0, 15) };
+ return sizes;
+}
+
+const int* RenderThemeMac::buttonMargins() const
+{
+ static const int margins[3][4] =
+ {
+ { 4, 6, 7, 6 },
+ { 4, 5, 6, 5 },
+ { 0, 1, 1, 1 },
+ };
+ return margins[[button controlSize]];
+}
+
+void RenderThemeMac::setButtonSize(RenderStyle* style) const
+{
+ // If the width and height are both specified, then we have nothing to do.
+ if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
+ return;
+
+ // Use the font size to determine the intrinsic width of the control.
+ setSizeFromFont(style, buttonSizes());
+}
+
+void RenderThemeMac::setButtonCellState(const RenderObject* o, const QRect& r)
+{
+ if (!button) {
+ button = [[NSButtonCell alloc] init];
+ [button setTitle:nil];
+ [button setButtonType:NSMomentaryPushInButton];
+ }
+
+ // Set the control size based off the rectangle we're painting into.
+ if (o->style()->appearance() == SquareButtonAppearance || r.height() > buttonSizes()[NSRegularControlSize].height()) {
+ // Use the square button
+ if ([button bezelStyle] != NSShadowlessSquareBezelStyle)
+ [button setBezelStyle:NSShadowlessSquareBezelStyle];
+ } else if ([button bezelStyle] != NSRoundedBezelStyle)
+ [button setBezelStyle:NSRoundedBezelStyle];
+
+ setControlSize(button, buttonSizes(), QSize(r.width(), r.height()));
+
+ // Update the various states we respond to.
+ updateCheckedState(button, o);
+ updateEnabledState(button, o);
+ updatePressedState(button, o);
+ updateFocusedState(button, o);
+}
+
+void RenderThemeMac::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r)
+{
+ // Determine the width and height needed for the control and prepare the cell for painting.
+ setButtonCellState(o, r);
+
+ // We inflate the rect as needed to account for padding included in the cell to accommodate the button
+ // shadow. We don't consider this part of the bounds of the control in WebKit.
+ QSize size = buttonSizes()[[button controlSize]];
+ size.setWidth(r.width());
+ QRect inflatedRect = r;
+ if ([button bezelStyle] == NSRoundedBezelStyle) {
+ // Center the button within the available space.
+ if (inflatedRect.height() > size.height()) {
+ inflatedRect.setX(inflatedRect.x() + (inflatedRect.height() - size.height())/2);
+ inflatedRect.setHeight(size.height());
+ }
+
+ // Now inflate it to account for the shadow.
+ inflatedRect = inflateRect(inflatedRect, size, buttonMargins());
+ }
+ [button drawWithFrame:NSRect(inflatedRect) inView:o->canvas()->view()->getDocumentView()];
+ [button setControlView: nil];
+}
+
}
1.1 WebCore/khtml/rendering/render_button.cpp
Index: render_button.cpp
===================================================================
/**
* This file is part of the html renderer for KDE.
*
* Copyright (C) 2005 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#include "config.h"
#include "render_button.h"
#include "render_text.h"
#include "htmlnames.h"
#include "html_formimpl.h"
using namespace DOM;
using namespace HTMLNames;
namespace khtml {
RenderButton::RenderButton(NodeImpl* node)
:RenderFlexibleBox(node), m_buttonText(0), m_inner(0)
{
}
RenderButton::~RenderButton()
{
}
void RenderButton::addChild(RenderObject *newChild, RenderObject *beforeChild)
{
if (!m_inner) {
// Create an anonymous block.
assert(!m_first);
m_inner = createAnonymousBlock();
m_inner->style()->setBoxFlex(1.0f);
RenderFlexibleBox::addChild(m_inner);
}
m_inner->addChild(newChild, beforeChild);
}
void RenderButton::removeChild(RenderObject *oldChild)
{
if (oldChild == m_inner || !m_inner) {
RenderFlexibleBox::removeChild(oldChild);
m_inner = 0;
}
else
m_inner->removeChild(oldChild);
}
void RenderButton::setStyle(RenderStyle* style)
{
RenderBlock::setStyle(style);
if (m_buttonText)
m_buttonText->setStyle(style);
}
void RenderButton::updateFromElement()
{
// If we're an input element, we may need to change our button text.
if (element()->hasTagName(inputTag)) {
HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(element());
DOMString value = input->value();
if (value.isEmpty()) {
if (m_buttonText) {
m_buttonText->destroy();
m_buttonText = 0;
}
} else {
if (m_buttonText)
m_buttonText->setText(value.impl());
else {
m_buttonText = new (renderArena()) RenderText(document(), value.impl());
m_buttonText->setStyle(style());
addChild(m_buttonText);
}
}
}
}
}
1.1 WebCore/khtml/rendering/render_button.h
Index: render_button.h
===================================================================
/*
* This file is part of the html renderer for KDE.
*
* Copyright (C) 2005 Apple Computer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef render_button_h
#define render_button_h
#include "render_flexbox.h"
namespace khtml
{
// RenderButtons are just like normal flexboxes except that they will generate an anonymous block child.
// For inputs, they will also generate an anonymous RenderText and keep its style and content up
// to date as the button changes.
class RenderButton : public RenderFlexibleBox
{
public:
RenderButton(DOM::NodeImpl* node);
virtual ~RenderButton();
virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
virtual void removeChild(RenderObject *oldChild);
virtual void removeLeftoverAnonymousBoxes() {};
virtual void setStyle(RenderStyle* style);
virtual void updateFromElement();
virtual const char *renderName() const { return "RenderButton"; }
protected:
RenderText* m_buttonText;
RenderBlock* m_inner;
};
};
#endif
1.85 +10 -2 WebCore/kwq/KWQAccObject.mm
Index: KWQAccObject.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQAccObject.mm,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- KWQAccObject.mm 3 Oct 2005 21:13:00 -0000 1.84
+++ KWQAccObject.mm 21 Oct 2005 21:27:49 -0000 1.85
@@ -196,7 +196,8 @@
if (m_renderer->element() && m_renderer->element()->hasTagName(inputTag)) {
HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(m_renderer->element());
if (!input->disabled() && (input->inputType() == HTMLInputElementImpl::CHECKBOX ||
- input->inputType() == HTMLInputElementImpl::RADIO))
+ input->inputType() == HTMLInputElementImpl::RADIO ||
+ input->isTextButton()))
return input;
}
@@ -381,6 +382,8 @@
return NSAccessibilityCheckBoxRole;
if (input->inputType() == HTMLInputElementImpl::RADIO)
return NSAccessibilityRadioButtonRole;
+ if (input->isTextButton())
+ return NSAccessibilityButtonRole;
}
if (m_renderer->isBlockFlow())
@@ -545,8 +548,13 @@
if (!m_renderer || m_areaElement || !m_renderer->element())
return nil;
- if (m_renderer->element()->isHTMLElement() && m_renderer->element()->hasTagName(buttonTag))
+ if (m_renderer->element()->hasTagName(buttonTag))
return [self textUnderElement];
+ if (m_renderer->element()->hasTagName(inputTag)) {
+ HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(m_renderer->element());
+ if (input->isTextButton())
+ return input->value();
+ }
if (m_renderer->element()->isLink())
return [self textUnderElement];
if ([self isAttachment])
1.70 +1 -1 WebCore/kwq/KWQComboBox.mm
Index: KWQComboBox.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQComboBox.mm,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- KWQComboBox.mm 20 Oct 2005 06:02:25 -0000 1.69
+++ KWQComboBox.mm 21 Oct 2005 21:27:50 -0000 1.70
@@ -27,7 +27,7 @@
#import "KWQComboBox.h"
#import <kxmlcore/Assertions.h>
-#import "KWQButton.h"
+#import "KWQLineEdit.h"
#import "KWQExceptions.h"
#import "KWQKHTMLPart.h"
#import "KWQNSViewExtras.h"
1.35 +1 -0 WebCore/kwq/KWQLineEdit.h
Index: KWQLineEdit.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQLineEdit.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- KWQLineEdit.h 30 Aug 2005 09:30:23 -0000 1.34
+++ KWQLineEdit.h 21 Oct 2005 21:27:51 -0000 1.35
@@ -32,6 +32,7 @@
#ifdef __OBJC__
@class KWQTextFieldController;
+NSControlSize KWQNSControlSizeForFont(const QFont&);
#else
class KWQTextFieldController;
#endif
1.75 +10 -1 WebCore/kwq/KWQLineEdit.mm
Index: KWQLineEdit.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQLineEdit.mm,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- KWQLineEdit.mm 20 Oct 2005 06:02:26 -0000 1.74
+++ KWQLineEdit.mm 21 Oct 2005 21:27:51 -0000 1.75
@@ -26,7 +26,6 @@
#include "config.h"
#import "KWQLineEdit.h"
-#import "KWQButton.h"
#import "KWQExceptions.h"
#import "KWQKHTMLPart.h"
#import "KWQLogging.h"
@@ -41,6 +40,16 @@
- (void)_addStringToRecentSearches:(NSString *)string;
@end
+NSControlSize KWQNSControlSizeForFont(const QFont& f)
+{
+ const int fontSize = f.pixelSize();
+ if (fontSize >= 16)
+ return NSRegularControlSize;
+ if (fontSize >= 11)
+ return NSSmallControlSize;
+ return NSMiniControlSize;
+}
+
QLineEdit::QLineEdit(Type type)
: m_returnPressed(this, SIGNAL(returnPressed()))
, m_textChanged(this, SIGNAL(textChanged(const QString &)))
More information about the webkit-changes
mailing list