[webkit-changes] cvs commit: WebCore/kwq KWQAccObject.mm KWQKHTMLPart.mm

David hyatt at opensource.apple.com
Mon Aug 1 14:23:43 PDT 2005


hyatt       05/08/01 14:23:43

  Modified:    .        ChangeLog
               khtml/rendering render_theme.h
               kwq      KWQAccObject.mm KWQKHTMLPart.mm
  Log:
  	Fix bugzilla bug 4219, crash because we tried to do the fake paint
  	when layout was not updated yet.
  
  	Also landing accessibility for checkboxes.
  
          Reviewed by darin/mjs (accessibility), kocienda(crash)
  
          * ChangeLog:
          * khtml/rendering/render_theme.h:
          (khtml::RenderTheme::supportsControlTints):
          * kwq/KWQAccObject.mm:
          (-[KWQAccObject actionElement]):
          (-[KWQAccObject role]):
          (-[KWQAccObject roleDescription]):
          (-[KWQAccObject value]):
          (boundingBoxRect):
          (-[KWQAccObject accessibilityIsIgnored]):
          (-[KWQAccObject accessibilityAttributeValue:]):
          (-[KWQAccObject accessibilityIsAttributeSettable:]):
          * kwq/KWQKHTMLPart.mm:
          (KWQKHTMLPart::setDisplaysWithFocusAttributes):
  
  Revision  Changes    Path
  1.4514    +40 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4513
  retrieving revision 1.4514
  diff -u -r1.4513 -r1.4514
  --- ChangeLog	1 Aug 2005 16:11:54 -0000	1.4513
  +++ ChangeLog	1 Aug 2005 21:23:38 -0000	1.4514
  @@ -1,3 +1,27 @@
  +2005-08-01  David Hyatt  <hyatt at apple.com>
  +
  +	Fix bugzilla bug 4219, crash because we tried to do the fake paint
  +	when layout was not updated yet.
  +
  +	Also landing accessibility for checkboxes.
  +	
  +        Reviewed by darin/mjs (accessibility), kocienda(crash)
  +
  +        * ChangeLog:
  +        * khtml/rendering/render_theme.h:
  +        (khtml::RenderTheme::supportsControlTints):
  +        * kwq/KWQAccObject.mm:
  +        (-[KWQAccObject actionElement]):
  +        (-[KWQAccObject role]):
  +        (-[KWQAccObject roleDescription]):
  +        (-[KWQAccObject value]):
  +        (boundingBoxRect):
  +        (-[KWQAccObject accessibilityIsIgnored]):
  +        (-[KWQAccObject accessibilityAttributeValue:]):
  +        (-[KWQAccObject accessibilityIsAttributeSettable:]):
  +        * kwq/KWQKHTMLPart.mm:
  +        (KWQKHTMLPart::setDisplaysWithFocusAttributes):
  +
   2005-08-01  John Sullivan  <sullivan at apple.com>
   
           Reviewed by Beth Dakin.
  @@ -59,6 +83,22 @@
   
   2005-07-31  David Hyatt  <hyatt at apple.com>
   
  +	Implement support for checkbox accessibility for VoiceOver.
  +	
  +        Reviewed by mjs
  +
  +        * kwq/KWQAccObject.mm:
  +        (-[KWQAccObject actionElement]):
  +        (-[KWQAccObject role]):
  +        (-[KWQAccObject roleDescription]):
  +        (-[KWQAccObject value]):
  +        (boundingBoxRect):
  +        (-[KWQAccObject accessibilityIsIgnored]):
  +        (-[KWQAccObject accessibilityAttributeValue:]):
  +        (-[KWQAccObject accessibilityIsAttributeSettable:]):
  +
  +2005-07-31  David Hyatt  <hyatt at apple.com>
  +
   	Make node lists more refined in their invalidation when children are added/removed
   	in the DOM or attributes are changed.  This is sort of a band-aid fix.  The
   	architecture of node list notifications (as well as how they are stored) should
  
  
  
  1.8       +3 -0      WebCore/khtml/rendering/render_theme.h
  
  Index: render_theme.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_theme.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- render_theme.h	31 Jul 2005 01:08:12 -0000	1.7
  +++ render_theme.h	1 Aug 2005 21:23:41 -0000	1.8
  @@ -62,6 +62,9 @@
       // An API asking if the control changes its tint when the window has focus or not.
       virtual bool controlSupportsTints(const RenderObject* o) const { return false; }
   
  +    // A general API asking if any control tinting is supported at all.
  +    virtual bool supportsControlTints() const { return false; }
  +
       // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
       // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
       virtual void adjustRepaintRect(const RenderObject* o, QRect& r) { }
  
  
  
  1.74      +40 -5     WebCore/kwq/KWQAccObject.mm
  
  Index: KWQAccObject.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQAccObject.mm,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- KWQAccObject.mm	30 Jul 2005 02:33:09 -0000	1.73
  +++ KWQAccObject.mm	1 Aug 2005 21:23:42 -0000	1.74
  @@ -55,6 +55,7 @@
   #import "render_object.h"
   #import "render_style.h"
   #import "render_text.h"
  +#import "render_theme.h"
   #import "selection.h"
   #import "kjs_html.h"
   #import "text_granularity.h"
  @@ -80,6 +81,7 @@
   using DOM::NodeImpl;
   using DOM::Position;
   
  +using khtml::theme;
   using khtml::EAffinity;
   using khtml::EVerticalAlign;
   using khtml::plainText;
  @@ -202,6 +204,12 @@
   
   -(ElementImpl *)actionElement
   {
  +    if (m_renderer->element() && m_renderer->element()->hasTagName(inputTag)) {
  +        HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(m_renderer->element());
  +        if (!input->disabled() && input->inputType() == HTMLInputElementImpl::CHECKBOX)
  +            return input;
  +    }
  +
       if ([self isImageButton])
           return static_cast<ElementImpl*>(m_renderer->element());
   
  @@ -376,6 +384,13 @@
       }
       if (m_renderer->isCanvas())
           return @"AXWebArea";
  +    
  +    if (m_renderer->element() && m_renderer->element()->hasTagName(inputTag)) {
  +        HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(m_renderer->element());
  +        if (input->inputType() == HTMLInputElementImpl::CHECKBOX)
  +            return NSAccessibilityCheckBoxRole;
  +    }
  +    
       if (m_renderer->isBlockFlow())
           return NSAccessibilityGroupRole;
       if ([self isAttachment])
  @@ -424,6 +439,9 @@
       if ([role isEqualToString:NSAccessibilityGroupRole])
           return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, nil);
       
  +    if ([role isEqualToString:NSAccessibilityCheckBoxRole])
  +        return NSAccessibilityRoleDescription(NSAccessibilityCheckBoxRole, nil);
  +
       if ([role isEqualToString:@"AXWebArea"])
           return UI_STRING("web area", "accessibility role description for web area");
       
  @@ -488,7 +506,7 @@
       return nil;
   }
   
  --(NSString*)value
  +-(id)value
   {
       if (!m_renderer || m_areaElement)
           return nil;
  @@ -518,7 +536,14 @@
       
       if ([self isAttachment])
           return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityValueAttribute];
  -        
  +
  +    if (m_renderer->element() && m_renderer->element()->hasTagName(inputTag)) {
  +        HTMLInputElementImpl* input = static_cast<HTMLInputElementImpl*>(m_renderer->element());
  +        if (input->inputType() == HTMLInputElementImpl::CHECKBOX)
  +            // Checkboxes return their state as an integer. 0 for off, 1 for on.
  +            return [NSNumber numberWithInt:input->checked()];
  +    }
  +    
       // FIXME: We might need to implement a value here for more types
       // FIXME: It would be better not to advertise a value at all for the types for which we don't implement one;
       // this would require subclassing or making accessibilityAttributeNames do something other than return a
  @@ -570,6 +595,8 @@
           for (QValueList<QRect>::ConstIterator it = rects.begin(); it != rects.end(); ++it) {
               QRect r = *it;
               if (r.isValid()) {
  +                if (obj->style()->hasAppearance())
  +                    theme()->adjustRepaintRect(obj, r);
                   if (rect.isEmpty())
                       rect = r;
                   else
  @@ -615,6 +642,10 @@
       if (m_areaElement || (m_renderer->element() && m_renderer->element()->isLink()))
           return NO;
   
  +    // All controls must be examined.
  +    if (m_renderer->element() && m_renderer->element()->isControl())
  +        return NO;
  +
       if (m_renderer->isBlockFlow() && m_renderer->childrenInline())
           return !static_cast<RenderBlock*>(m_renderer)->firstLineBox() && ![self mouseButtonListener];
   
  @@ -895,7 +926,7 @@
           return [NSNumber numberWithBool: (m_renderer->element() && m_renderer->document()->focusNode() == m_renderer->element())];
   
       if ([attributeName isEqualToString: NSAccessibilityEnabledAttribute])
  -        return [NSNumber numberWithBool: YES];
  +        return [NSNumber numberWithBool: m_renderer->element() ? m_renderer->element()->isEnabled() : YES];
       
       if ([attributeName isEqualToString: NSAccessibilitySizeAttribute])
           return [self size];
  @@ -1883,7 +1914,9 @@
       if ([attributeName isEqualToString: @"AXSelectedTextMarkerRangeAttribute"])
           return YES;
       if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
  -        if ([[self role] isEqualToString:@"AXLink"])
  +        if ([[self role] isEqualToString:@"AXLink"] ||
  +            ([[self role] isEqualToString:NSAccessibilityCheckBoxRole] &&
  +              m_renderer->element()->isEnabled()))
               return YES;
       }
   #endif
  @@ -1930,7 +1963,9 @@
           
       } else if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) {
           ASSERT(number);
  -        if ([[self role] isEqualToString:@"AXLink"]) {
  +        if ([[self role] isEqualToString:@"AXLink"] ||
  +            ([[self role] isEqualToString:NSAccessibilityCheckBoxRole] &&
  +             m_renderer->element()->isEnabled())) {
               if ([number intValue] != 0)
                   m_renderer->document()->setFocusNode(m_renderer->element());
               else
  
  
  
  1.657     +9 -6      WebCore/kwq/KWQKHTMLPart.mm
  
  Index: KWQKHTMLPart.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
  retrieving revision 1.656
  retrieving revision 1.657
  diff -u -r1.656 -r1.657
  --- KWQKHTMLPart.mm	30 Jul 2005 02:33:09 -0000	1.656
  +++ KWQKHTMLPart.mm	1 Aug 2005 21:23:42 -0000	1.657
  @@ -3751,12 +3751,15 @@
       
       // 4. Changing the tint of controls from clear to aqua/graphite and vice versa.  We
       // do a "fake" paint.  When the theme gets a paint call, it can then do an invalidate.
  -    NSView *documentView = d->m_view ? d->m_view->getDocumentView() : 0;
  -    if (documentView && renderer()) {
  -        QRect visibleRect([documentView visibleRect]);
  -        QPainter p;
  -        p.setUpdatingControlTints(true);
  -        paint(&p, visibleRect);
  +    if (theme()->supportsControlTints()) {
  +        NSView *documentView = d->m_view ? d->m_view->getDocumentView() : 0;
  +        if (documentView && renderer()) {
  +            doc->updateLayout(); // Ensure layout is up to date.
  +            QRect visibleRect([documentView visibleRect]);
  +            QPainter p;
  +            p.setUpdatingControlTints(true);
  +            paint(&p, visibleRect);
  +        }
       }
   }
   
  
  
  



More information about the webkit-changes mailing list