Changeset 33520 in webkit
- Timestamp:
- May 16, 2008 10:26:23 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r33518 r33520 1 2008-05-16 Chris Fleizach <cfleizach@apple.com> 2 3 Reviewed by Alice Liu 4 5 <rdar://problem/5710317> REGRESSION:Selecting ranges of text should be possible using the keyboard (15310) 6 7 * WebCore.base.exp: 8 * editing/VisiblePosition.cpp: 9 (WebCore::VisiblePosition::leftVisuallyDistinctCandidate): 10 (WebCore::VisiblePosition::rightVisuallyDistinctCandidate): 11 * page/AXObjectCache.cpp: 12 * page/AXObjectCache.h: 13 (WebCore::AXObjectCache::enableEnhancedUserInterfaceAccessibility): 14 (WebCore::AXObjectCache::accessibilityEnabled): 15 (WebCore::AXObjectCache::accessibilityEnhancedUserInterfaceEnabled): 16 * page/AccessibilityRenderObject.cpp: 17 (WebCore::AccessibilityRenderObject::visiblePositionRange): 18 (WebCore::AccessibilityRenderObject::doSetAXSelectedTextMarkerRange): 19 (WebCore::AccessibilityRenderObject::addChildren): 20 (WebCore::AccessibilityRenderObject::actionVerb): 21 * page/EventHandler.cpp: 22 (WebCore::EventHandler::handleKeyboardSelectionMovement): 23 (WebCore::EventHandler::defaultKeyboardEventHandler): 24 * page/EventHandler.h: 25 1 26 2008-05-15 Ariya Hidayat <ariya.hidayat@trolltech.com> 2 27 -
trunk/WebCore/WebCore.base.exp
r33504 r33520 139 139 __ZN7WebCore12TextIteratorC1EPKNS_5RangeEb 140 140 __ZN7WebCore13AXObjectCache21gAccessibilityEnabledE 141 __ZN7WebCore13AXObjectCache42gAccessibilityEnhancedUserInterfaceEnabledE 141 142 __ZN7WebCore13AXObjectCache3getEPNS_12RenderObjectE 142 143 __ZN7WebCore13HitTestResultC1ERKS0_ -
trunk/WebCore/editing/VisiblePosition.cpp
r32605 r33520 106 106 { 107 107 Position p = m_deepPosition; 108 if (!p.node()) 109 return Position(); 110 108 111 Position downstreamStart = p.downstream(); 109 110 112 TextDirection primaryDirection = LTR; 111 113 for (RenderObject* r = p.node()->renderer(); r; r = r->parent()) { … … 245 247 { 246 248 Position p = m_deepPosition; 249 if (!p.node()) 250 return Position(); 251 247 252 Position downstreamStart = p.downstream(); 248 249 253 TextDirection primaryDirection = LTR; 250 254 for (RenderObject* r = p.node()->renderer(); r; r = r->parent()) { -
trunk/WebCore/page/AXObjectCache.cpp
r33514 r33520 40 40 41 41 bool AXObjectCache::gAccessibilityEnabled = false; 42 bool AXObjectCache::gAccessibilityEnhancedUserInterfaceEnabled = false; 42 43 43 44 AXObjectCache::~AXObjectCache() -
trunk/WebCore/page/AXObjectCache.h
r33510 r33520 78 78 void handleFocusedUIElementChanged(); 79 79 static void enableAccessibility() { gAccessibilityEnabled = true; } 80 static void enableEnhancedUserInterfaceAccessibility() { gAccessibilityEnhancedUserInterfaceEnabled = true; } 81 80 82 static bool accessibilityEnabled() { return gAccessibilityEnabled; } 81 83 static bool accessibilityEnhancedUserInterfaceEnabled() { return gAccessibilityEnhancedUserInterfaceEnabled; } 84 82 85 void removeAXID(AccessibilityObject*); 83 86 bool isIDinUse(AXID id) const { return m_idsInUse.contains(id); } … … 87 90 HashMap<RenderObject*, AXID> m_renderObjectMapping; 88 91 static bool gAccessibilityEnabled; 92 static bool gAccessibilityEnhancedUserInterfaceEnabled; 93 89 94 HashSet<AXID> m_idsInUse; 90 95 -
trunk/WebCore/page/AccessibilityRenderObject.cpp
r33510 r33520 1212 1212 // construct VisiblePositions for start and end 1213 1213 Node* node = m_renderer->element(); 1214 if (!node) 1215 return VisiblePositionRange(); 1216 1214 1217 VisiblePosition startPos = VisiblePosition(node, 0, VP_DEFAULT_AFFINITY); 1215 1218 VisiblePosition endPos = VisiblePosition(node, maxDeepOffset(node), VP_DEFAULT_AFFINITY); … … 1346 1349 return; 1347 1350 1348 // make selection and tell the document to use it 1349 Selection newSelection = Selection(textMarkerRange.start, textMarkerRange.end); 1350 m_renderer->document()->frame()->selectionController()->setSelection(newSelection); 1351 // make selection and tell the document to use it. if it's zero length, then move to that position 1352 if (textMarkerRange.start == textMarkerRange.end) { 1353 m_renderer->document()->frame()->selectionController()->moveTo(textMarkerRange.start, true); 1354 } 1355 else { 1356 Selection newSelection = Selection(textMarkerRange.start, textMarkerRange.end); 1357 m_renderer->document()->frame()->selectionController()->setSelection(newSelection); 1358 } 1351 1359 } 1352 1360 … … 1886 1894 for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSibling()) { 1887 1895 if (obj->accessibilityIsIgnored()) { 1888 if (! m_haveChildren)1896 if (!obj->hasChildren()) 1889 1897 obj->addChildren(); 1890 1898 Vector<RefPtr<AccessibilityObject> >children = obj->children(); … … 1992 2000 } 1993 2001 1994 2002 const String& AccessibilityRenderObject::actionVerb() const 1995 2003 { 1996 2004 // FIXME: Need to add verbs for select elements. -
trunk/WebCore/page/EventHandler.cpp
r33503 r33520 28 28 #include "EventHandler.h" 29 29 30 #include "AXObjectCache.h" 30 31 #include "CachedImage.h" 31 32 #include "ChromeClient.h" … … 1579 1580 } 1580 1581 1582 void EventHandler::handleKeyboardSelectionMovement(KeyboardEvent* event) 1583 { 1584 if (!event) 1585 return; 1586 1587 String key = event->keyIdentifier(); 1588 bool isShifted = event->getModifierState("Shift"); 1589 bool isOptioned = event->getModifierState("Alt"); 1590 1591 if (key == "Up") { 1592 m_frame->selectionController()->modify((isShifted) ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::BACKWARD, LineGranularity, true); 1593 event->setDefaultHandled(); 1594 } 1595 else if (key == "Down") { 1596 m_frame->selectionController()->modify((isShifted) ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::FORWARD, LineGranularity, true); 1597 event->setDefaultHandled(); 1598 } 1599 else if (key == "Left") { 1600 m_frame->selectionController()->modify((isShifted) ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::LEFT, (isOptioned) ? WordGranularity : CharacterGranularity, true); 1601 event->setDefaultHandled(); 1602 } 1603 else if (key == "Right") { 1604 m_frame->selectionController()->modify((isShifted) ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::RIGHT, (isOptioned) ? WordGranularity : CharacterGranularity, true); 1605 event->setDefaultHandled(); 1606 } 1607 } 1608 1581 1609 void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event) 1582 1610 { … … 1587 1615 if (event->keyIdentifier() == "U+0009") 1588 1616 defaultTabEventHandler(event); 1617 1618 // provides KB navigation and selection for enhanced accessibility users 1619 if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled()) 1620 handleKeyboardSelectionMovement(event); 1589 1621 } 1590 1622 if (event->type() == keypressEvent) { -
trunk/WebCore/page/EventHandler.h
r33503 r33520 203 203 bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&); 204 204 205 void handleKeyboardSelectionMovement(KeyboardEvent*); 206 205 207 Cursor selectCursor(const MouseEventWithHitTestResults&, PlatformScrollbar*); 206 208 -
trunk/WebKit/mac/ChangeLog
r33506 r33520 1 2008-05-16 Chris Fleizach <cfleizach@apple.com> 2 3 Reviewed by Alice Liu 4 5 <rdar://problem/5710317> REGRESSION:Selecting ranges of text should be possible using the keyboard (15310) 6 7 * WebView/WebFrame.mm: 8 (-[WebFrame _accessibilityTree]): 9 1 10 2008-05-15 Stephanie Lewis <slewis@apple.com> 2 11 -
trunk/WebKit/mac/WebView/WebFrame.mm
r33503 r33520 121 121 NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey"; 122 122 123 // FIXME: Remove when this key becomes publicly defined 124 NSString *NSAccessibilityEnhancedUserInterfaceAttribute = @"AXEnhancedUserInterface"; 125 123 126 @implementation WebFramePrivate 124 127 … … 670 673 - (id)_accessibilityTree 671 674 { 672 AXObjectCache::enableAccessibility(); 675 if (!AXObjectCache::accessibilityEnabled()) { 676 AXObjectCache::enableAccessibility(); 677 if ([[NSApp accessibilityAttributeValue:NSAccessibilityEnhancedUserInterfaceAttribute] boolValue]) 678 AXObjectCache::enableEnhancedUserInterfaceAccessibility(); 679 } 680 673 681 if (!_private->coreFrame || !_private->coreFrame->document()) 674 682 return nil;
Note: See TracChangeset
for help on using the changeset viewer.