summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/editing/mac/SelectionControllerMac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/editing/mac/SelectionControllerMac.mm')
-rw-r--r--Source/WebCore/editing/mac/SelectionControllerMac.mm17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/WebCore/editing/mac/SelectionControllerMac.mm b/Source/WebCore/editing/mac/SelectionControllerMac.mm
index 730eb60..119d406 100644
--- a/Source/WebCore/editing/mac/SelectionControllerMac.mm
+++ b/Source/WebCore/editing/mac/SelectionControllerMac.mm
@@ -33,6 +33,19 @@
namespace WebCore {
+static CGRect accessibilityConvertScreenRect(CGRect bounds)
+{
+ NSArray *screens = [NSScreen screens];
+ if ([screens count]) {
+ CGFloat screenHeight = NSHeight([[screens objectAtIndex:0] frame]);
+ bounds.origin.y = (screenHeight - (bounds.origin.y + bounds.size.height));
+ } else
+ bounds = CGRectZero;
+
+ return bounds;
+}
+
+
void SelectionController::notifyAccessibilityForSelectionChange()
{
Document* document = m_frame->document();
@@ -58,8 +71,8 @@ void SelectionController::notifyAccessibilityForSelectionChange()
viewRect = frameView->contentsToScreen(viewRect);
CGRect cgCaretRect = CGRectMake(selectionRect.x(), selectionRect.y(), selectionRect.width(), selectionRect.height());
CGRect cgViewRect = CGRectMake(viewRect.x(), viewRect.y(), viewRect.width(), viewRect.height());
- cgCaretRect = [[WebCoreViewFactory sharedFactory] accessibilityConvertScreenRect:cgCaretRect];
- cgViewRect = [[WebCoreViewFactory sharedFactory] accessibilityConvertScreenRect:cgViewRect];
+ cgCaretRect = accessibilityConvertScreenRect(cgCaretRect);
+ cgViewRect = accessibilityConvertScreenRect(cgViewRect);
UAZoomChangeFocus(&cgViewRect, &cgCaretRect, kUAZoomFocusTypeInsertionPoint);
}