[webkit-changes] cvs commit: WebCore/layout-tests/fast/forms 001-expected.txt form-element-geometry-expected.txt formmove-expected.txt formmove2-expected.txt input-value-expected.txt

David hyatt at opensource.apple.com
Mon Aug 8 14:12:03 PDT 2005


hyatt       05/08/08 14:12:03

  Modified:    .        ChangeLog
               WebCore.xcodeproj project.pbxproj
               khtml/css html4.css
               khtml/html html_formimpl.cpp html_formimpl.h
               khtml/rendering render_form.cpp render_form.h
                        render_theme.cpp render_theme.h render_theme_mac.h
                        render_theme_mac.mm
               khtml/xml dom_nodeimpl.cpp dom_nodeimpl.h
               kwq      KWQAccObject.mm
               layout-tests/fast/block/basic 011-expected.txt
               layout-tests/fast/block/margin-collapse 103-expected.txt
               layout-tests/fast/forms 001-expected.txt
                        form-element-geometry-expected.txt
                        formmove-expected.txt formmove2-expected.txt
                        input-value-expected.txt
  Removed:     ForwardingHeaders qradiobutton.h
               kwq      KWQRadioButton.h KWQRadioButton.mm
  Log:
  	This patch implements support for <input type=radio> in the engine and removes the NSView-based
  	control.
  
  	Reviewed by: John Sullivan
  
          * ForwardingHeaders/qradiobutton.h: Removed.
          * WebCore.xcodeproj/project.pbxproj:
          Removing the old QRadioButton from the project.
  
  	* khtml/css/html4.css:
          Add the CSS rule to give radio buttons the correct appearance.
  
  	* khtml/html/html_formimpl.cpp:
          (DOM::HTMLInputElementImpl::click):
          Now that radio button has no corresponding QWidget, move its click handling case down to match
  	the other widget-less controls.
  
  	(DOM::HTMLInputElementImpl::createRenderer):
  	The special renderer doesn't have to be made any more.  Radio now behaves like checkbox and just
  	makes a renderer based off the specified display type in CSS.
  
          (DOM::HTMLInputElementImpl::setChecked):
          Fix a regression that prevented unnamed checkboxes from functioning properly.  Make sure to
  	only disallow the selecting of unnamed radio buttons.
  
  	(DOM::HTMLInputElementImpl::valueWithDefault):
  	Fix some mis-indented ifdefs.
  
          (DOM::HTMLInputElementImpl::preDispatchEventHandler):
          Added a new event handler method that is called prior to the dispatch of the event into the DOM.
  	This function is necessary because checkboxes and radio buttons need to check/uncheck *prior* to
  	the onclick actually being sent into the DOM.
  
  	(DOM::HTMLInputElementImpl::defaultEventHandler):
          Remove the code that attempted to check/uncheck checkboxes from this function, since it was called
  	*after* onclick was handled in the DOM, and this was too late.  The code has moved into
  	preDispatchEventHandler instead.
  
  	* khtml/html/html_formimpl.h:
          * khtml/rendering/render_form.cpp:
          * khtml/rendering/render_form.h:
          Removed RenderRadioButton, the custom renderer that used to wrap QRadioButton.
  
  	* khtml/rendering/render_theme.cpp:
          (khtml::RenderTheme::adjustStyle):
          (khtml::RenderTheme::paint):
  	Add the radio button case to these methods.
  
          (khtml::RenderTheme::adjustCheckboxStyle):
          (khtml::RenderTheme::adjustRadioStyle):
          Rework these methods to move all of the control size selection based off font into the
  	derived class.  These methods stay in the base class and call a virtual setCheckbox/RadioSize
  	method to get the size set up properly.
  
  	* khtml/rendering/render_theme.h:
          (khtml::RenderTheme::setCheckboxSize):
          (khtml::RenderTheme::setRadioSize):
          The two new virtual methods that a derived class can override to set initial sizes.
  
  	* khtml/rendering/render_theme_mac.h:
          * khtml/rendering/render_theme_mac.mm:
          (khtml::RenderThemeMac::inflateRect):
          (khtml::RenderThemeMac::setControlSize):
          (khtml::RenderThemeMac::sizeForFont):
          (khtml::RenderThemeMac::setSizeFromFont):
          (khtml::RenderThemeMac::checkboxSizes):
          (khtml::RenderThemeMac::setCheckboxCellState):
          (khtml::RenderThemeMac::setCheckboxSize):
          Patched all of these methods to deal with QSizes instead of ints, since radio buttons are not
  	square.
  
  	(khtml::RenderThemeMac::paintRadio):
          (khtml::RenderThemeMac::radioSizes):
          (khtml::RenderThemeMac::radioMargins):
          (khtml::RenderThemeMac::setRadioCellState):
          (khtml::RenderThemeMac::setRadioSize):
          The implementation of radio buttons.  Virtually identical to checkbox.
  
  	* khtml/xml/dom_nodeimpl.cpp:
          (DOM::NodeImpl::dispatchGenericEvent):
          Add the invocation of preDispatchEventHandler prior to the dispatch of the event.
  
  	* khtml/xml/dom_nodeimpl.h:
          (DOM::NodeImpl::preDispatchEventHandler):
          The stubbed out empty virtual function in the base class.  Overridden in HTMLInputElementImpl
  	to check/uncheck radio buttons and checkboxes prior to the click event being sent into the DOM.
  
  	* kwq/KWQAccObject.mm:
          (-[KWQAccObject actionElement]):
          (-[KWQAccObject role]):
          (-[KWQAccObject roleDescription]):
          (-[KWQAccObject value]):
          (-[KWQAccObject accessibilityIsAttributeSettable:]):
          The implementation of radio button accessibility.  Identical to checkbox (just a different role).
  
  	* kwq/KWQRadioButton.h: Removed.
          * kwq/KWQRadioButton.mm: Removed.
  	Removed the old radio button files for QRadioButton.
  
  Revision  Changes    Path
  1.4542    +101 -0    WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4541
  retrieving revision 1.4542
  diff -u -r1.4541 -r1.4542
  --- ChangeLog	8 Aug 2005 20:21:18 -0000	1.4541
  +++ ChangeLog	8 Aug 2005 21:11:52 -0000	1.4542
  @@ -1,3 +1,104 @@
  +2005-08-08  David Hyatt  <hyatt at apple.com>
  +
  +	This patch implements support for <input type=radio> in the engine and removes the NSView-based
  +	control.
  +	
  +	Reviewed by: John Sullivan
  +	
  +        * ForwardingHeaders/qradiobutton.h: Removed.
  +        * WebCore.xcodeproj/project.pbxproj:
  +        Removing the old QRadioButton from the project.
  +	
  +	* khtml/css/html4.css:
  +        Add the CSS rule to give radio buttons the correct appearance.
  +	
  +	* khtml/html/html_formimpl.cpp:
  +        (DOM::HTMLInputElementImpl::click):
  +        Now that radio button has no corresponding QWidget, move its click handling case down to match
  +	the other widget-less controls.
  +	
  +	(DOM::HTMLInputElementImpl::createRenderer):
  +	The special renderer doesn't have to be made any more.  Radio now behaves like checkbox and just
  +	makes a renderer based off the specified display type in CSS.
  +	
  +        (DOM::HTMLInputElementImpl::setChecked):
  +        Fix a regression that prevented unnamed checkboxes from functioning properly.  Make sure to
  +	only disallow the selecting of unnamed radio buttons.
  +	
  +	(DOM::HTMLInputElementImpl::valueWithDefault):
  +	Fix some mis-indented ifdefs.
  +	
  +        (DOM::HTMLInputElementImpl::preDispatchEventHandler):
  +        Added a new event handler method that is called prior to the dispatch of the event into the DOM.
  +	This function is necessary because checkboxes and radio buttons need to check/uncheck *prior* to
  +	the onclick actually being sent into the DOM.
  +	
  +	(DOM::HTMLInputElementImpl::defaultEventHandler):
  +        Remove the code that attempted to check/uncheck checkboxes from this function, since it was called
  +	*after* onclick was handled in the DOM, and this was too late.  The code has moved into 
  +	preDispatchEventHandler instead.
  +	
  +	* khtml/html/html_formimpl.h:
  +        * khtml/rendering/render_form.cpp:
  +        * khtml/rendering/render_form.h:
  +        Removed RenderRadioButton, the custom renderer that used to wrap QRadioButton.
  +	
  +	* khtml/rendering/render_theme.cpp:
  +        (khtml::RenderTheme::adjustStyle):
  +        (khtml::RenderTheme::paint):
  +	Add the radio button case to these methods.
  +	
  +        (khtml::RenderTheme::adjustCheckboxStyle):
  +        (khtml::RenderTheme::adjustRadioStyle):
  +        Rework these methods to move all of the control size selection based off font into the
  +	derived class.  These methods stay in the base class and call a virtual setCheckbox/RadioSize
  +	method to get the size set up properly.
  +	
  +	* khtml/rendering/render_theme.h:
  +        (khtml::RenderTheme::setCheckboxSize):
  +        (khtml::RenderTheme::setRadioSize):
  +        The two new virtual methods that a derived class can override to set initial sizes.
  +	
  +	* khtml/rendering/render_theme_mac.h:
  +        * khtml/rendering/render_theme_mac.mm:
  +        (khtml::RenderThemeMac::inflateRect):
  +        (khtml::RenderThemeMac::setControlSize):
  +        (khtml::RenderThemeMac::sizeForFont):
  +        (khtml::RenderThemeMac::setSizeFromFont):
  +        (khtml::RenderThemeMac::checkboxSizes):
  +        (khtml::RenderThemeMac::setCheckboxCellState):
  +        (khtml::RenderThemeMac::setCheckboxSize):
  +        Patched all of these methods to deal with QSizes instead of ints, since radio buttons are not
  +	square.
  +	
  +	(khtml::RenderThemeMac::paintRadio):
  +        (khtml::RenderThemeMac::radioSizes):
  +        (khtml::RenderThemeMac::radioMargins):
  +        (khtml::RenderThemeMac::setRadioCellState):
  +        (khtml::RenderThemeMac::setRadioSize):
  +        The implementation of radio buttons.  Virtually identical to checkbox.
  +	
  +	* khtml/xml/dom_nodeimpl.cpp:
  +        (DOM::NodeImpl::dispatchGenericEvent):
  +        Add the invocation of preDispatchEventHandler prior to the dispatch of the event.
  +	
  +	* khtml/xml/dom_nodeimpl.h:
  +        (DOM::NodeImpl::preDispatchEventHandler):
  +        The stubbed out empty virtual function in the base class.  Overridden in HTMLInputElementImpl
  +	to check/uncheck radio buttons and checkboxes prior to the click event being sent into the DOM.
  +	
  +	* kwq/KWQAccObject.mm:
  +        (-[KWQAccObject actionElement]):
  +        (-[KWQAccObject role]):
  +        (-[KWQAccObject roleDescription]):
  +        (-[KWQAccObject value]):
  +        (-[KWQAccObject accessibilityIsAttributeSettable:]):
  +        The implementation of radio button accessibility.  Identical to checkbox (just a different role).
  +	
  +	* kwq/KWQRadioButton.h: Removed.
  +        * kwq/KWQRadioButton.mm: Removed.
  +	Removed the old radio button files for QRadioButton.
  +	
   2005-08-08  Eric Seidel  <eseidel at apple.com>
   
           Reviewed by darin.
  
  
  
  1.9       +0 -12     WebCore/WebCore.xcodeproj/project.pbxproj
  
  Index: project.pbxproj
  ===================================================================
  RCS file: /cvs/root/WebCore/WebCore.xcodeproj/project.pbxproj,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- project.pbxproj	6 Aug 2005 18:46:16 -0000	1.8
  +++ project.pbxproj	8 Aug 2005 21:11:58 -0000	1.9
  @@ -261,7 +261,6 @@
   		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 */; };
  -		93F1998708245E59001E9ABC /* KWQRadioButton.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B102DE3B8601EA4122 /* KWQRadioButton.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 */; };
  @@ -444,7 +443,6 @@
   		93F19A4508245E59001E9ABC /* KWQPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852302DE375901EA4122 /* KWQPoint.mm */; };
   		93F19A4608245E59001E9ABC /* KWQPointArray.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852402DE375901EA4122 /* KWQPointArray.mm */; };
   		93F19A4708245E59001E9ABC /* KWQPtrDictImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852602DE375901EA4122 /* KWQPtrDictImpl.mm */; };
  -		93F19A4808245E59001E9ABC /* KWQRadioButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852802DE375901EA4122 /* KWQRadioButton.mm */; };
   		93F19A4908245E59001E9ABC /* KWQRect.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852902DE375901EA4122 /* KWQRect.mm */; };
   		93F19A4A08245E59001E9ABC /* KWQRegExp.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852B02DE375901EA4122 /* KWQRegExp.mm */; };
   		93F19A4B08245E59001E9ABC /* KWQRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852C02DE375901EA4122 /* KWQRegion.mm */; };
  @@ -812,7 +810,6 @@
   		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 */; };
  -		A8212B5208794A2300677359 /* KWQRadioButton.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B102DE3B8601EA4122 /* KWQRadioButton.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 */; };
  @@ -1029,7 +1026,6 @@
   		A8212C2C08794A2300677359 /* KWQPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852302DE375901EA4122 /* KWQPoint.mm */; };
   		A8212C2D08794A2300677359 /* KWQPointArray.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852402DE375901EA4122 /* KWQPointArray.mm */; };
   		A8212C2E08794A2300677359 /* KWQPtrDictImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852602DE375901EA4122 /* KWQPtrDictImpl.mm */; };
  -		A8212C2F08794A2300677359 /* KWQRadioButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852802DE375901EA4122 /* KWQRadioButton.mm */; };
   		A8212C3008794A2300677359 /* KWQRect.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852902DE375901EA4122 /* KWQRect.mm */; };
   		A8212C3108794A2300677359 /* KWQRegExp.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852B02DE375901EA4122 /* KWQRegExp.mm */; };
   		A8212C3208794A2300677359 /* KWQRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587852C02DE375901EA4122 /* KWQRegion.mm */; };
  @@ -4036,7 +4032,6 @@
   		F587852402DE375901EA4122 /* KWQPointArray.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQPointArray.mm; sourceTree = "<group>"; };
   		F587852502DE375901EA4122 /* KWQPtrDictImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQPtrDictImpl.h; sourceTree = "<group>"; };
   		F587852602DE375901EA4122 /* KWQPtrDictImpl.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQPtrDictImpl.mm; sourceTree = "<group>"; };
  -		F587852802DE375901EA4122 /* KWQRadioButton.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQRadioButton.mm; sourceTree = "<group>"; };
   		F587852902DE375901EA4122 /* KWQRect.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQRect.mm; sourceTree = "<group>"; };
   		F587852A02DE375901EA4122 /* KWQRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQRefPtr.h; sourceTree = "<group>"; };
   		F587852B02DE375901EA4122 /* KWQRegExp.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQRegExp.mm; sourceTree = "<group>"; };
  @@ -4160,7 +4155,6 @@
   		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>"; };
  -		F58786B102DE3B8601EA4122 /* KWQRadioButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQRadioButton.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>"; };
  @@ -6531,8 +6525,6 @@
   				F58786AF02DE3B8601EA4122 /* KWQPtrVector.h */,
   				F58786B002DE3B8601EA4122 /* KWQPushButton.h */,
   				F550D70A02E13281018635CA /* KWQPushButton.mm */,
  -				F58786B102DE3B8601EA4122 /* KWQRadioButton.h */,
  -				F587852802DE375901EA4122 /* KWQRadioButton.mm */,
   				F58786B202DE3B8601EA4122 /* KWQRect.h */,
   				F587852902DE375901EA4122 /* KWQRect.mm */,
   				F58786B302DE3B8601EA4122 /* KWQRegExp.h */,
  @@ -6769,7 +6761,6 @@
   				93F1998408245E59001E9ABC /* KWQPtrStack.h in Headers */,
   				93F1998508245E59001E9ABC /* KWQPtrVector.h in Headers */,
   				93F1998608245E59001E9ABC /* KWQPushButton.h in Headers */,
  -				93F1998708245E59001E9ABC /* KWQRadioButton.h in Headers */,
   				93F1998808245E59001E9ABC /* KWQRect.h in Headers */,
   				93F1998908245E59001E9ABC /* KWQRefPtr.h in Headers */,
   				93F1998A08245E59001E9ABC /* KWQRegExp.h in Headers */,
  @@ -7117,7 +7108,6 @@
   				A8212B4F08794A2300677359 /* KWQPtrStack.h in Headers */,
   				A8212B5008794A2300677359 /* KWQPtrVector.h in Headers */,
   				A8212B5108794A2300677359 /* KWQPushButton.h in Headers */,
  -				A8212B5208794A2300677359 /* KWQRadioButton.h in Headers */,
   				A8212B5308794A2300677359 /* KWQRect.h in Headers */,
   				A8212B5408794A2300677359 /* KWQRefPtr.h in Headers */,
   				A8212B5508794A2300677359 /* KWQRegExp.h in Headers */,
  @@ -9035,7 +9025,6 @@
   				93F19A4508245E59001E9ABC /* KWQPoint.mm in Sources */,
   				93F19A4608245E59001E9ABC /* KWQPointArray.mm in Sources */,
   				93F19A4708245E59001E9ABC /* KWQPtrDictImpl.mm in Sources */,
  -				93F19A4808245E59001E9ABC /* KWQRadioButton.mm in Sources */,
   				93F19A4908245E59001E9ABC /* KWQRect.mm in Sources */,
   				93F19A4A08245E59001E9ABC /* KWQRegExp.mm in Sources */,
   				93F19A4B08245E59001E9ABC /* KWQRegion.mm in Sources */,
  @@ -9309,7 +9298,6 @@
   				A8212C2C08794A2300677359 /* KWQPoint.mm in Sources */,
   				A8212C2D08794A2300677359 /* KWQPointArray.mm in Sources */,
   				A8212C2E08794A2300677359 /* KWQPtrDictImpl.mm in Sources */,
  -				A8212C2F08794A2300677359 /* KWQRadioButton.mm in Sources */,
   				A8212C3008794A2300677359 /* KWQRect.mm in Sources */,
   				A8212C3108794A2300677359 /* KWQRegExp.mm in Sources */,
   				A8212C3208794A2300677359 /* KWQRegion.mm in Sources */,
  
  
  
  1.74      +4 -0      WebCore/khtml/css/html4.css
  
  Index: html4.css
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/html4.css,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- html4.css	5 Aug 2005 20:47:35 -0000	1.73
  +++ html4.css	8 Aug 2005 21:11:58 -0000	1.74
  @@ -323,6 +323,10 @@
       -khtml-appearance: checkbox
   }
   
  +input[type="radio"] {
  +    -khtml-appearance: radio
  +}
  +
   /* inline elements */      
         
   u, ins {
  
  
  
  1.184     +16 -12    WebCore/khtml/html/html_formimpl.cpp
  
  Index: html_formimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.cpp,v
  retrieving revision 1.183
  retrieving revision 1.184
  diff -u -r1.183 -r1.184
  --- html_formimpl.cpp	4 Aug 2005 22:45:54 -0000	1.183
  +++ html_formimpl.cpp	8 Aug 2005 21:11:59 -0000	1.184
  @@ -1690,7 +1690,6 @@
           case HIDDEN:
               // a no-op for this type
               break;
  -        case RADIO:
           case SUBMIT:
           case RESET:
           case BUTTON: 
  @@ -1716,6 +1715,7 @@
               HTMLGenericFormElementImpl::click(sendMouseEvents, showPressedLook);
               break;
           case CHECKBOX:
  +        case RADIO:
           case IMAGE:
           case ISINDEX:
           case PASSWORD:
  @@ -1896,8 +1896,9 @@
       case SEARCH:
   #endif
       case ISINDEX:  return new (arena) RenderLineEdit(this);
  -    case CHECKBOX: return RenderObject::createObject(this, style);
  -    case RADIO:    return new (arena) RenderRadioButton(this);
  +    case CHECKBOX:
  +    case RADIO:
  +        return RenderObject::createObject(this, style);
       case SUBMIT:   return new (arena) RenderSubmitButton(this);
       case IMAGE:    return new (arena) RenderImageButton(this);
       case RESET:    return new (arena) RenderResetButton(this);
  @@ -2141,7 +2142,7 @@
   void HTMLInputElementImpl::setChecked(bool _checked)
   {
       // WinIE does not allow unnamed radio buttons to even be checked.
  -    if (checked() == _checked || name().isEmpty())
  +    if (checked() == _checked || (m_type == RADIO && name().isEmpty()))
           return;
   
       if (m_form && m_type == RADIO && _checked)
  @@ -2201,10 +2202,10 @@
               case ISINDEX:
               case PASSWORD:
               case RADIO:
  -        #if APPLE_CHANGES
  +#if APPLE_CHANGES
               case RANGE:
               case SEARCH:
  -        #endif
  +#endif
               case TEXT:
                   break;
           }
  @@ -2273,6 +2274,14 @@
       getDocument()->setFocusNode(this);
   }
   
  +void HTMLInputElementImpl::preDispatchEventHandler(EventImpl *evt)
  +{
  +    if (evt->isMouseEvent() && evt->id() == EventImpl::CLICK_EVENT && static_cast<MouseEventImpl*>(evt)->button() == 0) {
  +        if (m_type == CHECKBOX || m_type == RADIO)
  +            setChecked(!checked());
  +    }
  +}
  +
   void HTMLInputElementImpl::defaultEventHandler(EventImpl *evt)
   {
       if (evt->isMouseEvent() &&
  @@ -2307,12 +2316,7 @@
                   }
                   m_activeSubmit = false;
               }
  -        } else if (m_type == CHECKBOX || m_type == RADIO) {
  -            if (m_type == CHECKBOX || (renderer() && renderer()->style()->hasAppearance()))
  -                // FIXME: We key off appearance for now, but this is temporary.  When we cut over
  -                // for real this will just always be used.
  -                setChecked(!checked());
  -        }
  +        } 
       }
   
   #if APPLE_CHANGES
  
  
  
  1.85      +1 -2      WebCore/khtml/html/html_formimpl.h
  
  Index: html_formimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.h,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- html_formimpl.h	4 Aug 2005 22:45:54 -0000	1.84
  +++ html_formimpl.h	8 Aug 2005 21:11:59 -0000	1.85
  @@ -43,7 +43,6 @@
       class RenderTextArea;
       class RenderSelect;
       class RenderLineEdit;
  -    class RenderRadioButton;
       class RenderFileButton;
   #if APPLE_CHANGES
       class RenderSlider;
  @@ -306,7 +305,6 @@
   class HTMLInputElementImpl : public HTMLGenericFormElementImpl
   {
       friend class khtml::RenderLineEdit;
  -    friend class khtml::RenderRadioButton;
       friend class khtml::RenderFileButton;
   
   #if APPLE_CHANGES
  @@ -407,6 +405,7 @@
       int clickX() const { return xPos; }
       int clickY() const { return yPos; }
   
  +    virtual void preDispatchEventHandler(EventImpl *evt);
       virtual void defaultEventHandler(EventImpl *evt);
       virtual bool isEditable();
   
  
  
  
  1.115     +0 -45     WebCore/khtml/rendering/render_form.cpp
  
  Index: render_form.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_form.cpp,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- render_form.cpp	2 Aug 2005 20:28:40 -0000	1.114
  +++ render_form.cpp	8 Aug 2005 21:11:59 -0000	1.115
  @@ -281,51 +281,6 @@
   
   // -------------------------------------------------------------------------------
   
  -RenderRadioButton::RenderRadioButton(HTMLInputElementImpl *element)
  -    : RenderButton(element)
  -{
  -    QRadioButton* b = new QRadioButton(view()->viewport());
  -    b->setAutoMask(true);
  -    b->setMouseTracking(true);
  -    setQWidget(b);
  -    connect(b, SIGNAL(clicked()), this, SLOT(slotClicked()));
  -}
  -
  -void RenderRadioButton::updateFromElement()
  -{
  -    widget()->setChecked(element()->checked());
  -
  -    RenderButton::updateFromElement();
  -}
  -
  -void RenderRadioButton::slotClicked()
  -{
  -    element()->setChecked(true);
  -
  -    // emit mouseClick event etc
  -    RenderButton::slotClicked();
  -}
  -
  -void RenderRadioButton::calcMinMaxWidth()
  -{
  -    KHTMLAssert( !minMaxKnown() );
  -
  -#if APPLE_CHANGES
  -    // Let the widget tell us how big it wants to be.
  -    QSize s(widget()->sizeHint());
  -#else
  -    QRadioButton *rb = static_cast<QRadioButton *>( m_widget );
  -    QSize s( rb->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth ),
  -             rb->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight ) );
  -#endif
  -    setIntrinsicWidth( s.width() );
  -    setIntrinsicHeight( s.height() );
  -
  -    RenderButton::calcMinMaxWidth();
  -}
  -
  -// -------------------------------------------------------------------------------
  -
   RenderSubmitButton::RenderSubmitButton(HTMLInputElementImpl *element)
       : RenderButton(element)
   {
  
  
  
  1.54      +0 -20     WebCore/khtml/rendering/render_form.h
  
  Index: render_form.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_form.h,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- render_form.h	2 Aug 2005 20:28:40 -0000	1.53
  +++ render_form.h	8 Aug 2005 21:11:59 -0000	1.54
  @@ -36,7 +36,6 @@
   
   #include <qtextedit.h>
   #include <klineedit.h>
  -#include <qradiobutton.h>
   #include <qpushbutton.h>
   #include <qhbox.h>
   #include <klistbox.h>
  @@ -144,25 +143,6 @@
   
   // -------------------------------------------------------------------------
   
  -class RenderRadioButton : public RenderButton
  -{
  -    Q_OBJECT
  -public:
  -    RenderRadioButton(DOM::HTMLInputElementImpl* node);
  -
  -    virtual const char *renderName() const { return "RenderRadioButton"; }
  -
  -    virtual void calcMinMaxWidth();
  -    virtual void updateFromElement();
  -
  -    QRadioButton *widget() const { return static_cast<QRadioButton*>(m_widget); }
  -
  -public slots:
  -    void slotClicked();
  -};
  -
  -// -------------------------------------------------------------------------
  -
   class RenderSubmitButton : public RenderButton
   {
   public:
  
  
  
  1.9       +17 -22    WebCore/khtml/rendering/render_theme.cpp
  
  Index: render_theme.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_theme.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- render_theme.cpp	31 Jul 2005 01:08:12 -0000	1.8
  +++ render_theme.cpp	8 Aug 2005 21:11:59 -0000	1.9
  @@ -43,6 +43,8 @@
       switch (style->appearance()) {
           case CheckboxAppearance:
               return adjustCheckboxStyle(style);
  +        case RadioAppearance:
  +            return adjustRadioStyle(style);
           default:
               break;
       }
  @@ -65,6 +67,8 @@
       switch (o->style()->appearance()) {
           case CheckboxAppearance:
               return paintCheckbox(o, i, r);
  +        case RadioAppearance:
  +            return paintRadio(o, i, r);
           default:
               break;
       }
  @@ -125,36 +129,27 @@
       return o->element()->active();
   }
   
  -int RenderTheme::sizeForFont(RenderStyle* style) const
  -{
  -    return style->fontSize();
  -}
  -
  -void RenderTheme::setSizeFromFont(RenderStyle* style) const
  -{
  -    int size = sizeForFont(style);
  -    if (style->width().isVariable())
  -        style->setWidth(Length(size, Fixed));
  -    if (style->height().isVariable())
  -        style->setHeight(Length(size, Fixed));
  -}
  -
  -void RenderTheme::setCheckboxSize(RenderStyle* style) const
  +void RenderTheme::adjustCheckboxStyle(RenderStyle* style) const
   {
  -    // If the width and height are both specified, then we have nothing to do.
  -    if (!style->width().isVariable() && !style->height().isVariable())
  -        return;
  +    // 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.)
  +    // font-size - not honored (control has no text), but we use it to decide which control size to use.
  +    setCheckboxSize(style);
  +    
  +    // padding - not honored by WinIE, needs to be removed.
  +    style->resetPadding();
       
  -    // Use the font size to determine the intrinsic width of the control.
  -    setSizeFromFont(style);
  +    // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
  +    // for now, we will not honor it.
  +    style->resetBorder();
   }
   
  -void RenderTheme::adjustCheckboxStyle(RenderStyle* style) const
  +void RenderTheme::adjustRadioStyle(RenderStyle* style) 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.)
       // font-size - not honored (control has no text), but we use it to decide which control size to use.
  -    setCheckboxSize(style);
  +    setRadioSize(style);
       
       // padding - not honored by WinIE, needs to be removed.
       style->resetPadding();
  
  
  
  1.9       +5 -5      WebCore/khtml/rendering/render_theme.h
  
  Index: render_theme.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_theme.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- render_theme.h	1 Aug 2005 21:23:41 -0000	1.8
  +++ render_theme.h	8 Aug 2005 21:12:00 -0000	1.9
  @@ -87,11 +87,11 @@
       // Methods for each appearance value.
       virtual void adjustCheckboxStyle(RenderStyle* style) const;
       virtual void paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r) = 0;
  -    virtual int sizeForFont(RenderStyle* style) const;
  -
  -    void setSizeFromFont(RenderStyle* style) const;
  -    void setCheckboxSize(RenderStyle* style) const;
  -        
  +    virtual void setCheckboxSize(RenderStyle* style) const {};
  +    
  +    virtual void adjustRadioStyle(RenderStyle* style) const;
  +    virtual void paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r) = 0;
  +    virtual void setRadioSize(RenderStyle* style) const {};
   };
   
   // Function to obtain the theme.  This is implemented in your platform-specific theme implementation to hand
  
  
  
  1.6       +15 -5     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- render_theme_mac.h	1 Aug 2005 22:23:23 -0000	1.5
  +++ render_theme_mac.h	8 Aug 2005 21:12:00 -0000	1.6
  @@ -50,14 +50,19 @@
   protected:
       // Methods for each appearance value.
       virtual void paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r);
  -    virtual int sizeForFont(RenderStyle* style) const;
  +    virtual void setCheckboxSize(RenderStyle* style) const;
  +    
  +    virtual void paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r);
  +    virtual void setRadioSize(RenderStyle* style) const;
       
   private:
  -    QRect inflateRect(const QRect& r, int size, const int* margins) const;
  +    QRect inflateRect(const QRect& r, const QSize& size, 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 int* sizes, int minSize);
  +    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 updateCheckedState(NSCell* cell, const RenderObject* o);
       void updateEnabledState(NSCell* cell, const RenderObject* o);
  @@ -65,12 +70,17 @@
       void updatePressedState(NSCell* cell, const RenderObject* o);
   
       // Helpers for adjusting appearance and for painting
  -    const int* checkboxSizes() const;
  +    const QSize* checkboxSizes() const;
       const int* checkboxMargins() const;
       void setCheckboxCellState(const RenderObject* o, const QRect& r);
  -    
  +
  +    const QSize* radioSizes() const;
  +    const int* radioMargins() const;
  +    void setRadioCellState(const RenderObject* o, const QRect& r);
  +
   private:
       NSButtonCell* checkbox;
  +    NSButtonCell* radio;
   };
   
   }
  
  
  
  1.6       +96 -16    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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- render_theme_mac.mm	28 Jul 2005 21:28:00 -0000	1.5
  +++ render_theme_mac.mm	8 Aug 2005 21:12:00 -0000	1.6
  @@ -60,12 +60,12 @@
       }
   }
   
  -QRect RenderThemeMac::inflateRect(const QRect& r, int size, const int* margins) const
  +QRect RenderThemeMac::inflateRect(const QRect& r, const QSize& size, const int* margins) const
   {
       // Only do the inflation if the available width/height are too small.  Otherwise try to
       // fit the glow/check space into the available box's width/height.
  -    int widthDelta = r.width() - (size + margins[leftMargin] + margins[rightMargin]);
  -    int heightDelta = r.height() - (size + margins[topMargin] + margins[bottomMargin]);
  +    int widthDelta = r.width() - (size.width() + margins[leftMargin] + margins[rightMargin]);
  +    int heightDelta = r.height() - (size.height() + margins[topMargin] + margins[bottomMargin]);
       QRect result(r);
       if (widthDelta < 0) {
           result.setX(result.x() - margins[leftMargin]);
  @@ -114,8 +114,8 @@
   
   short RenderThemeMac::baselinePosition(const RenderObject* o) const
   {
  -    if (o->style()->appearance() == CheckboxAppearance)
  -        return o->marginTop() + o->height() - 2; // The baseline is 2px up from the bottom of the checkbox in AppKit.
  +    if (o->style()->appearance() == CheckboxAppearance || o->style()->appearance() == RadioAppearance)
  +        return o->marginTop() + o->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
       return RenderTheme::baselinePosition(o);
   }
   
  @@ -142,17 +142,14 @@
       return NSMiniControlSize;
   }
   
  -int RenderThemeMac::sizeForFont(RenderStyle* style) const
  -{
  -    return checkboxSizes()[controlSizeForFont(style)];
  -}
  -
  -void RenderThemeMac::setControlSize(NSCell* cell, const int* sizes, int minSize)
  +void RenderThemeMac::setControlSize(NSCell* cell, const QSize* sizes, const QSize& minSize)
   {
       NSControlSize size;
  -    if (minSize >= sizes[NSRegularControlSize])
  +    if (minSize.width() >= sizes[NSRegularControlSize].width() &&
  +        minSize.height() >= sizes[NSRegularControlSize].height())
           size = NSRegularControlSize;
  -    else if (minSize >= sizes[NSSmallControlSize])
  +    else if (minSize.width() >= sizes[NSSmallControlSize].width() &&
  +             minSize.height() >= sizes[NSSmallControlSize].height())
           size = NSSmallControlSize;
       else
           size = NSMiniControlSize;
  @@ -160,6 +157,20 @@
           [cell setControlSize:size];
   }
   
  +QSize RenderThemeMac::sizeForFont(RenderStyle* style, const QSize* sizes) const
  +{
  +    return sizes[controlSizeForFont(style)];
  +}
  +
  +void RenderThemeMac::setSizeFromFont(RenderStyle* style, const QSize* sizes) const
  +{
  +    QSize size = sizeForFont(style, sizes);
  +    if (style->width().isVariable())
  +        style->setWidth(Length(size.width(), Fixed));
  +    if (style->height().isVariable())
  +        style->setHeight(Length(size.height(), 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.
  @@ -172,9 +183,9 @@
       [checkbox setControlView: nil];
   }
   
  -const int* RenderThemeMac::checkboxSizes() const
  +const QSize* RenderThemeMac::checkboxSizes() const
   {
  -    static const int sizes[3] = { 14, 12, 10 };
  +    static const QSize sizes[3] = { QSize(14, 14), QSize(12, 12), QSize(10, 10) };
       return sizes;
   }
   
  @@ -198,7 +209,7 @@
       }
       
       // Set the control size based off the rectangle we're painting into.
  -    setControlSize(checkbox, checkboxSizes(), kMin(r.width(), r.height()));
  +    setControlSize(checkbox, checkboxSizes(), QSize(r.width(), r.height()));
       
       // Update the various states we respond to.
       updateCheckedState(checkbox, o);
  @@ -207,4 +218,73 @@
       updateFocusedState(checkbox, o);
   }
   
  +
  +void RenderThemeMac::setCheckboxSize(RenderStyle* style) const
  +{
  +    // If the width and height are both specified, then we have nothing to do.
  +    if (!style->width().isVariable() && !style->height().isVariable())
  +        return;
  +    
  +    // Use the font size to determine the intrinsic width of the control.
  +    setSizeFromFont(style, checkboxSizes());
  +}
  +
  +void RenderThemeMac::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const QRect& r)
  +{
  +    // Determine the width and height needed for the control and prepare the cell for painting.
  +    setRadioCellState(o, r);
  +    
  +    // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
  +    // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
  +    QRect inflatedRect = inflateRect(r, radioSizes()[[radio controlSize]], radioMargins());
  +    [radio drawWithFrame:NSRect(inflatedRect) inView:o->canvas()->view()->getDocumentView()];
  +    [radio setControlView: nil];
  +}
  +
  +const QSize* RenderThemeMac::radioSizes() const
  +{
  +    static const QSize sizes[3] = { QSize(14, 15), QSize(12, 13), QSize(10, 10) };
  +    return sizes;
  +}
  +
  +const int* RenderThemeMac::radioMargins() const
  +{
  +    static const int margins[3][4] = 
  +    {
  +        { 2, 2, 4, 2 },
  +        { 3, 2, 3, 2 },
  +        { 1, 0, 2, 0 },
  +    };
  +    return margins[[radio controlSize]];
  +}
  +
  +void RenderThemeMac::setRadioCellState(const RenderObject* o, const QRect& r)
  +{
  +    if (!radio) {
  +        radio = [[NSButtonCell alloc] init];
  +        [radio setButtonType:NSRadioButton];
  +        [radio setTitle:nil];
  +    }
  +    
  +    // Set the control size based off the rectangle we're painting into.
  +    setControlSize(radio, radioSizes(), QSize(r.width(), r.height()));
  +    
  +    // Update the various states we respond to.
  +    updateCheckedState(radio, o);
  +    updateEnabledState(radio, o);
  +    updatePressedState(radio, o);
  +    updateFocusedState(radio, o);
  +}
  +
  +
  +void RenderThemeMac::setRadioSize(RenderStyle* style) const
  +{
  +    // If the width and height are both specified, then we have nothing to do.
  +    if (!style->width().isVariable() && !style->height().isVariable())
  +        return;
  +    
  +    // Use the font size to determine the intrinsic width of the control.
  +    setSizeFromFont(style, radioSizes());
  +}
  +
   }
  
  
  
  1.171     +9 -1      WebCore/khtml/xml/dom_nodeimpl.cpp
  
  Index: dom_nodeimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
  retrieving revision 1.170
  retrieving revision 1.171
  diff -u -r1.170 -r1.171
  --- dom_nodeimpl.cpp	6 Aug 2005 16:30:14 -0000	1.170
  +++ dom_nodeimpl.cpp	8 Aug 2005 21:12:00 -0000	1.171
  @@ -530,9 +530,17 @@
           nodeChain.prepend(n);
       }
   
  +    
  +    QPtrListIterator<NodeImpl> it(nodeChain);
  +    
  +    // Before we begin dispatching events, give each node a chance to do some work prior
  +    // to the DOM event handlers getting a crack.
  +    for (; it.current() && !evt->propagationStopped(); ++it)
  +        it.current()->preDispatchEventHandler(evt);
  +
       // trigger any capturing event handlers on our way down
       evt->setEventPhase(Event::CAPTURING_PHASE);
  -    QPtrListIterator<NodeImpl> it(nodeChain);
  +    it.toFirst();
       for (; it.current() && it.current() != this && !evt->propagationStopped(); ++it) {
           evt->setCurrentTarget(it.current());
           it.current()->handleLocalEvents(evt,true);
  
  
  
  1.97      +3 -0      WebCore/khtml/xml/dom_nodeimpl.h
  
  Index: dom_nodeimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.h,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- dom_nodeimpl.h	5 Aug 2005 18:36:29 -0000	1.96
  +++ dom_nodeimpl.h	8 Aug 2005 21:12:01 -0000	1.97
  @@ -288,6 +288,9 @@
   
       void handleLocalEvents(EventImpl *evt, bool useCapture);
   
  +    // A handler to do actions before an event is dispatched.
  +    virtual void preDispatchEventHandler(EventImpl *evt) {};
  +
       /**
        * Perform the default action for an event e.g. submitting a form
        */
  
  
  
  1.75      +13 -4     WebCore/kwq/KWQAccObject.mm
  
  Index: KWQAccObject.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQAccObject.mm,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- KWQAccObject.mm	1 Aug 2005 21:23:42 -0000	1.74
  +++ KWQAccObject.mm	8 Aug 2005 21:12:01 -0000	1.75
  @@ -206,7 +206,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)
  +        if (!input->disabled() && (input->inputType() == HTMLInputElementImpl::CHECKBOX ||
  +                                   input->inputType() == HTMLInputElementImpl::RADIO))
               return input;
       }
   
  @@ -389,6 +390,8 @@
           HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(m_renderer->element());
           if (input->inputType() == HTMLInputElementImpl::CHECKBOX)
               return NSAccessibilityCheckBoxRole;
  +        if (input->inputType() == HTMLInputElementImpl::RADIO)
  +            return NSAccessibilityRadioButtonRole;
       }
       
       if (m_renderer->isBlockFlow())
  @@ -441,6 +444,9 @@
       
       if ([role isEqualToString:NSAccessibilityCheckBoxRole])
           return NSAccessibilityRoleDescription(NSAccessibilityCheckBoxRole, nil);
  +        
  +    if ([role isEqualToString:NSAccessibilityRadioButtonRole])
  +        return NSAccessibilityRoleDescription(NSAccessibilityRadioButtonRole, nil);
   
       if ([role isEqualToString:@"AXWebArea"])
           return UI_STRING("web area", "accessibility role description for web area");
  @@ -539,7 +545,8 @@
   
       if (m_renderer->element() && m_renderer->element()->hasTagName(inputTag)) {
           HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(m_renderer->element());
  -        if (input->inputType() == HTMLInputElementImpl::CHECKBOX)
  +        if (input->inputType() == HTMLInputElementImpl::CHECKBOX ||
  +            input->inputType() == HTMLInputElementImpl::RADIO)
               // Checkboxes return their state as an integer. 0 for off, 1 for on.
               return [NSNumber numberWithInt:input->checked()];
       }
  @@ -1915,7 +1922,8 @@
           return YES;
       if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
           if ([[self role] isEqualToString:@"AXLink"] ||
  -            ([[self role] isEqualToString:NSAccessibilityCheckBoxRole] &&
  +            (([[self role] isEqualToString:NSAccessibilityCheckBoxRole] ||
  +             ([[self role] isEqualToString:NSAccessibilityRadioButtonRole])) &&
                 m_renderer->element()->isEnabled()))
               return YES;
       }
  @@ -1964,7 +1972,8 @@
       } else if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
           ASSERT(number);
           if ([[self role] isEqualToString:@"AXLink"] ||
  -            ([[self role] isEqualToString:NSAccessibilityCheckBoxRole] &&
  +            (([[self role] isEqualToString:NSAccessibilityCheckBoxRole] ||
  +             ([[self role] isEqualToString:NSAccessibilityRadioButtonRole])) &&
                m_renderer->element()->isEnabled())) {
               if ([number intValue] != 0)
                   m_renderer->document()->setFocusNode(m_renderer->element());
  
  
  
  1.11      +2 -2      WebCore/layout-tests/fast/block/basic/011-expected.txt
  
  Index: 011-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/block/basic/011-expected.txt,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- 011-expected.txt	15 Apr 2005 21:45:53 -0000	1.10
  +++ 011-expected.txt	8 Aug 2005 21:12:02 -0000	1.11
  @@ -23,12 +23,12 @@
                   RenderBlock {P} at (0,0) size 139x19
                     RenderText {TEXT} at (0,4) size 28x18
                       text run at (0,4) width 28: "bang "
  -                  RenderRadioButton {INPUT} at (31,3) size 12x13 [color=#000000]
  +                  RenderBlock {INPUT} at (31,3) size 12x13 [color=#000000]
                     RenderText {TEXT} at (0,0) size 0x0
                   RenderBlock {P} at (0,19) size 139x19
                     RenderText {TEXT} at (0,4) size 47x18
                       text run at (0,4) width 47: "whimper "
  -                  RenderRadioButton {INPUT} at (50,3) size 12x13 [color=#000000]
  +                  RenderBlock {INPUT} at (50,3) size 12x13 [color=#000000]
                     RenderText {TEXT} at (0,0) size 0x0
                 RenderBlock (anonymous) at (10,58) size 139x0
                   RenderInline {FORM} at (0,0) size 0x0
  
  
  
  1.6       +5 -5      WebCore/layout-tests/fast/block/margin-collapse/103-expected.txt
  
  Index: 103-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/block/margin-collapse/103-expected.txt,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- 103-expected.txt	15 Apr 2005 21:45:54 -0000	1.5
  +++ 103-expected.txt	8 Aug 2005 21:12:02 -0000	1.6
  @@ -65,15 +65,15 @@
                 RenderText {TEXT} at (0,2) size 220x20
                   text run at (0,2) width 220: "Your research is primarily focused on:"
               RenderBlock {SPAN} at (325,250) size 180x20 [color=#333333]
  -              RenderRadioButton {INPUT} at (3,3) size 12x13 [color=#000000]
  +              RenderBlock {INPUT} at (3,3) size 12x13 [color=#000000]
                 RenderText {TEXT} at (18,2) size 32x20
                   text run at (18,2) width 32: "Texts"
               RenderBlock {SPAN} at (325,270) size 180x20 [color=#333333]
  -              RenderRadioButton {INPUT} at (3,3) size 12x13 [color=#000000]
  +              RenderBlock {INPUT} at (3,3) size 12x13 [color=#000000]
                 RenderText {TEXT} at (18,2) size 133x20
                   text run at (18,2) width 133: "Performance materials"
               RenderBlock {SPAN} at (325,290) size 180x20 [color=#333333]
  -              RenderRadioButton {INPUT} at (3,3) size 12x13 [color=#000000]
  +              RenderBlock {INPUT} at (3,3) size 12x13 [color=#000000]
                 RenderText {TEXT} at (18,2) size 21x20
                   text run at (18,2) width 21: "n/a"
               RenderBlock {H2} at (0,335) size 560x16 [color=#333333]
  @@ -85,11 +85,11 @@
               RenderBlock {SPAN} at (325,361) size 180x20 [color=#333333]
                 RenderText {TEXT} at (0,2) size 19x20
                   text run at (0,2) width 19: "Yes"
  -              RenderRadioButton {INPUT} at (22,3) size 12x13 [color=#000000]
  +              RenderBlock {INPUT} at (22,3) size 12x13 [color=#000000]
                 RenderText {TEXT} at (37,2) size 19x20
                   text run at (37,2) width 4: " "
                   text run at (41,2) width 15: "No"
  -              RenderRadioButton {INPUT} at (59,3) size 12x13 [color=#000000]
  +              RenderBlock {INPUT} at (59,3) size 12x13 [color=#000000]
                 RenderText {TEXT} at (0,0) size 0x0
               RenderBlock {P} at (0,394) size 560x20 [color=#333333]
                 RenderText {TEXT} at (0,2) size 378x20
  
  
  
  1.10      +7 -7      WebCore/layout-tests/fast/forms/001-expected.txt
  
  Index: 001-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/forms/001-expected.txt,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- 001-expected.txt	2 Aug 2005 20:28:41 -0000	1.9
  +++ 001-expected.txt	8 Aug 2005 21:12:02 -0000	1.10
  @@ -19,21 +19,21 @@
                 RenderTableCell {TD} at (0,0) size 20x20 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
                   RenderBlock {INPUT} at (4,4) size 12x12
                 RenderTableCell {TD} at (20,9) size 760x2 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
  -      RenderBlock {P} at (0,138) size 784x25
  -        RenderTable {TABLE} at (0,0) size 784x25 [border: (2px outset #808080)]
  -          RenderTableSection {TBODY} at (2,2) size 0x21
  +      RenderBlock {P} at (0,138) size 784x24
  +        RenderTable {TABLE} at (0,0) size 784x24 [border: (2px outset #808080)]
  +          RenderTableSection {TBODY} at (2,2) size 0x20
               RenderTableRow {TR} at (0,0) size 0x0
  -              RenderTableCell {TD} at (0,0) size 20x21 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
  -                RenderRadioButton {INPUT} at (4,4) size 12x13
  +              RenderTableCell {TD} at (0,0) size 20x20 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
  +                RenderBlock {INPUT} at (4,4) size 12x12
                 RenderTableCell {TD} at (20,9) size 760x2 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
  -      RenderBlock {P} at (0,179) size 784x28
  +      RenderBlock {P} at (0,178) size 784x28
           RenderTable {TABLE} at (0,0) size 784x28 [border: (2px outset #808080)]
             RenderTableSection {TBODY} at (2,2) size 0x24
               RenderTableRow {TR} at (0,0) size 0x0
                 RenderTableCell {TD} at (0,0) size 42x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
                   RenderSubmitButton {INPUT} at (3,3) size 36x18
                 RenderTableCell {TD} at (42,11) size 738x2 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
  -      RenderBlock {P} at (0,223) size 784x66
  +      RenderBlock {P} at (0,222) size 784x66
           RenderTable {TABLE} at (0,0) size 784x24 [border: (2px outset #808080)]
             RenderTableSection {TBODY} at (2,2) size 0x20
               RenderTableRow {TR} at (0,0) size 0x0
  
  
  
  1.11      +10 -14    WebCore/layout-tests/fast/forms/form-element-geometry-expected.txt
  
  Index: form-element-geometry-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/forms/form-element-geometry-expected.txt,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- form-element-geometry-expected.txt	2 Aug 2005 20:28:41 -0000	1.10
  +++ form-element-geometry-expected.txt	8 Aug 2005 21:12:02 -0000	1.11
  @@ -28,7 +28,7 @@
               RenderTableCell {TD} at (132,4) size 18x19 [r=0 c=2 rs=1 cs=1]
                 RenderBlock {DIV} at (1,1) size 16x17 [border: (2px solid #0000FF)]
                   RenderInline {FONT} at (0,0) size 12x13
  -                  RenderRadioButton {INPUT} at (2,2) size 12x13
  +                  RenderBlock {INPUT} at (2,2) size 12x13
                 RenderBlock (anonymous) at (1,18) size 16x0
                   RenderInline {FONT} at (0,0) size 0x0
               RenderTableCell {TD} at (152,5) size 18x18 [r=0 c=3 rs=1 cs=1]
  @@ -48,7 +48,7 @@
                   RenderSelect {SELECT} at (2,2) size 62x18
               RenderTableCell {TD} at (132,4) size 18x19 [r=0 c=2 rs=1 cs=1]
                 RenderBlock {DIV} at (1,1) size 16x17 [border: (2px solid #0000FF)]
  -                RenderRadioButton {INPUT} at (2,2) size 12x13
  +                RenderBlock {INPUT} at (2,2) size 12x13
               RenderTableCell {TD} at (152,5) size 18x18 [r=0 c=3 rs=1 cs=1]
                 RenderBlock {DIV} at (1,1) size 16x16 [border: (2px solid #0000FF)]
                   RenderBlock {INPUT} at (2,2) size 12x12
  @@ -66,7 +66,7 @@
               RenderTableCell {TD} at (132,4) size 18x19 [r=0 c=2 rs=1 cs=1]
                 RenderBlock {DIV} at (1,1) size 16x17 [border: (2px solid #0000FF)]
                   RenderInline {FONT} at (0,0) size 12x12
  -                  RenderRadioButton {INPUT} at (2,2) size 12x13
  +                  RenderBlock {INPUT} at (2,2) size 12x13
               RenderTableCell {TD} at (152,5) size 18x18 [r=0 c=3 rs=1 cs=1]
                 RenderBlock {DIV} at (1,1) size 16x16 [border: (2px solid #0000FF)]
                   RenderInline {FONT} at (0,0) size 12x12
  @@ -90,7 +90,7 @@
           RenderText {TEXT} at (0,0) size 200x28
             text run at (0,0) width 200: "Baseline Alignment"
         RenderBlock {DIV} at (0,360) size 784x29
  -        RenderInline {FONT} at (0,0) size 219x28
  +        RenderInline {FONT} at (0,0) size 213x28
             RenderText {TEXT} at (0,0) size 43x28
               text run at (0,0) width 43: "text "
             RenderSubmitButton {INPUT} at (45,9) size 52x18
  @@ -99,10 +99,8 @@
             RenderSelect {SELECT} at (107,9) size 62x18
             RenderText {TEXT} at (171,0) size 6x28
               text run at (171,0) width 6: " "
  -          RenderRadioButton {INPUT} at (180,11) size 12x13
  -          RenderText {TEXT} at (195,0) size 6x28
  -            text run at (195,0) width 6: " "
  -          RenderBlock {INPUT} at (204,12) size 12x12
  +          RenderBlock {INPUT} at (180,11) size 12x13
  +          RenderBlock {INPUT} at (198,12) size 12x12
         RenderBlock {DIV} at (0,389) size 784x22
           RenderText {TEXT} at (0,1) size 27x18
             text run at (0,1) width 27: "text "
  @@ -112,13 +110,13 @@
           RenderSelect {SELECT} at (89,2) size 62x18
           RenderText {TEXT} at (153,1) size 4x18
             text run at (153,1) width 4: " "
  -        RenderRadioButton {INPUT} at (160,4) size 12x13
  +        RenderBlock {INPUT} at (160,4) size 12x13
           RenderText {TEXT} at (175,1) size 4x18
             text run at (175,1) width 4: " "
           RenderBlock {INPUT} at (182,5) size 12x12
           RenderText {TEXT} at (0,0) size 0x0
         RenderBlock {DIV} at (0,411) size 784x22
  -        RenderInline {FONT} at (0,0) size 185x13
  +        RenderInline {FONT} at (0,0) size 182x13
             RenderText {TEXT} at (0,5) size 18x13
               text run at (0,5) width 18: "text "
             RenderSubmitButton {INPUT} at (20,2) size 52x18
  @@ -127,10 +125,8 @@
             RenderSelect {SELECT} at (79,2) size 62x18
             RenderText {TEXT} at (143,5) size 3x13
               text run at (143,5) width 3: " "
  -          RenderRadioButton {INPUT} at (149,4) size 12x13
  -          RenderText {TEXT} at (164,5) size 3x13
  -            text run at (164,5) width 3: " "
  -          RenderBlock {INPUT} at (170,5) size 12x12
  +          RenderBlock {INPUT} at (149,4) size 12x13
  +          RenderBlock {INPUT} at (167,5) size 12x12
         RenderBlock {DIV} at (0,433) size 784x37
           RenderText {TEXT} at (0,16) size 27x18
             text run at (0,16) width 27: "text "
  
  
  
  1.2       +6 -6      WebCore/layout-tests/fast/forms/formmove-expected.txt
  
  Index: formmove-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/forms/formmove-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- formmove-expected.txt	4 Aug 2005 22:46:36 -0000	1.1
  +++ formmove-expected.txt	8 Aug 2005 21:12:02 -0000	1.2
  @@ -4,23 +4,23 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {FORM} at (0,0) size 784x19
  -        RenderRadioButton {INPUT} at (3,3) size 12x13
  +        RenderBlock {INPUT} at (3,3) size 12x13
           RenderText {TEXT} at (18,0) size 34x18
             text run at (18,0) width 34: "Two "
  -        RenderRadioButton {INPUT} at (55,3) size 12x13
  +        RenderBlock {INPUT} at (55,3) size 12x13
           RenderText {TEXT} at (70,0) size 37x18
             text run at (70,0) width 37: "Three"
         RenderBlock {FORM} at (0,35) size 784x19
  -        RenderRadioButton {INPUT} at (3,3) size 12x13
  +        RenderBlock {INPUT} at (3,3) size 12x13
           RenderText {TEXT} at (18,0) size 31x18
             text run at (18,0) width 31: "One "
  -        RenderRadioButton {INPUT} at (52,3) size 12x13
  +        RenderBlock {INPUT} at (52,3) size 12x13
           RenderText {TEXT} at (67,0) size 34x18
             text run at (67,0) width 34: "Two "
  -        RenderRadioButton {INPUT} at (104,3) size 12x13
  +        RenderBlock {INPUT} at (104,3) size 12x13
           RenderText {TEXT} at (119,0) size 41x18
             text run at (119,0) width 41: "Three "
  -        RenderRadioButton {INPUT} at (163,3) size 12x13
  +        RenderBlock {INPUT} at (163,3) size 12x13
           RenderText {TEXT} at (178,0) size 27x18
             text run at (178,0) width 27: "One"
         RenderBlock (anonymous) at (0,70) size 784x36
  
  
  
  1.2       +2 -2      WebCore/layout-tests/fast/forms/formmove2-expected.txt
  
  Index: formmove2-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/forms/formmove2-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- formmove2-expected.txt	4 Aug 2005 22:46:36 -0000	1.1
  +++ formmove2-expected.txt	8 Aug 2005 21:12:02 -0000	1.2
  @@ -4,8 +4,8 @@
     RenderBlock {HTML} at (0,0) size 800x600
       RenderBody {BODY} at (8,8) size 784x584
         RenderBlock {FORM} at (0,0) size 784x19
  -        RenderRadioButton {INPUT} at (3,3) size 12x13
  -        RenderRadioButton {INPUT} at (21,3) size 12x13
  +        RenderBlock {INPUT} at (3,3) size 12x13
  +        RenderBlock {INPUT} at (21,3) size 12x13
         RenderBlock (anonymous) at (0,35) size 784x36
           RenderText {TEXT} at (0,0) size 777x36
             text run at (0,0) width 777: "There should be two elements in the first form and one in the second. The count in form one is 2, and the count in form two"
  
  
  
  1.5       +1 -1      WebCore/layout-tests/fast/forms/input-value-expected.txt
  
  Index: input-value-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/forms/input-value-expected.txt,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- input-value-expected.txt	2 Aug 2005 20:28:41 -0000	1.4
  +++ input-value-expected.txt	8 Aug 2005 21:12:02 -0000	1.5
  @@ -104,7 +104,7 @@
                   RenderText {TEXT} at (1,1) size 216x18
                     text run at (1,1) width 216: "radio with value property changed"
                 RenderTableCell {TD} at (389,148) size 236x21 [r=6 c=1 rs=1 cs=1]
  -                RenderRadioButton {INPUT} at (4,4) size 12x13
  +                RenderBlock {INPUT} at (4,4) size 12x13
                 RenderTableCell {TD} at (627,148) size 62x20 [r=6 c=2 rs=1 cs=1]
                   RenderText {TEXT} at (1,1) size 28x18
                     text run at (1,1) width 28: "after"
  
  
  



More information about the webkit-changes mailing list