| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 bounds = CGRectZero; | 42 bounds = CGRectZero; |
| 43 | 43 |
| 44 return bounds; | 44 return bounds; |
| 45 } | 45 } |
| 46 | 46 |
| 47 | 47 |
| 48 void FrameSelection::notifyAccessibilityForSelectionChange() | 48 void FrameSelection::notifyAccessibilityForSelectionChange() |
| 49 { | 49 { |
| 50 Document* document = m_frame->document(); | 50 Document* document = m_frame->document(); |
| 51 | 51 |
| 52 if (m_selection.start().isNotNull() && m_selection.end().isNotNull()) { | 52 if (AXObjectCache::accessibilityEnabled() && m_selection.start().isNotNull()
&& m_selection.end().isNotNull()) |
| 53 if (AXObjectCache* cache = document->existingAXObjectCache()) | 53 document->axObjectCache()->postNotification(m_selection.start().deprecat
edNode()->renderer(), AXObjectCache::AXSelectedTextChanged, false); |
| 54 cache->postNotification(m_selection.start().deprecatedNode()->render
er(), AXObjectCache::AXSelectedTextChanged, false); | |
| 55 } | |
| 56 | 54 |
| 57 // if zoom feature is enabled, insertion point changes should update the zoo
m | 55 // if zoom feature is enabled, insertion point changes should update the zoo
m |
| 58 if (!UAZoomEnabled() || !m_selection.isCaret()) | 56 if (!UAZoomEnabled() || !m_selection.isCaret()) |
| 59 return; | 57 return; |
| 60 | 58 |
| 61 RenderView* renderView = document->renderView(); | 59 RenderView* renderView = document->renderView(); |
| 62 if (!renderView) | 60 if (!renderView) |
| 63 return; | 61 return; |
| 64 FrameView* frameView = m_frame->view(); | 62 FrameView* frameView = m_frame->view(); |
| 65 if (!frameView) | 63 if (!frameView) |
| 66 return; | 64 return; |
| 67 | 65 |
| 68 IntRect selectionRect = absoluteCaretBounds(); | 66 IntRect selectionRect = absoluteCaretBounds(); |
| 69 IntRect viewRect = pixelSnappedIntRect(renderView->viewRect()); | 67 IntRect viewRect = pixelSnappedIntRect(renderView->viewRect()); |
| 70 | 68 |
| 71 selectionRect = frameView->contentsToScreen(selectionRect); | 69 selectionRect = frameView->contentsToScreen(selectionRect); |
| 72 viewRect = frameView->contentsToScreen(viewRect); | 70 viewRect = frameView->contentsToScreen(viewRect); |
| 73 CGRect cgCaretRect = CGRectMake(selectionRect.x(), selectionRect.y(), select
ionRect.width(), selectionRect.height()); | 71 CGRect cgCaretRect = CGRectMake(selectionRect.x(), selectionRect.y(), select
ionRect.width(), selectionRect.height()); |
| 74 CGRect cgViewRect = CGRectMake(viewRect.x(), viewRect.y(), viewRect.width(),
viewRect.height()); | 72 CGRect cgViewRect = CGRectMake(viewRect.x(), viewRect.y(), viewRect.width(),
viewRect.height()); |
| 75 cgCaretRect = accessibilityConvertScreenRect(cgCaretRect); | 73 cgCaretRect = accessibilityConvertScreenRect(cgCaretRect); |
| 76 cgViewRect = accessibilityConvertScreenRect(cgViewRect); | 74 cgViewRect = accessibilityConvertScreenRect(cgViewRect); |
| 77 | 75 |
| 78 UAZoomChangeFocus(&cgViewRect, &cgCaretRect, kUAZoomFocusTypeInsertionPoint)
; | 76 UAZoomChangeFocus(&cgViewRect, &cgCaretRect, kUAZoomFocusTypeInsertionPoint)
; |
| 79 } | 77 } |
| 80 | 78 |
| 81 } // namespace WebCore | 79 } // namespace WebCore |
| OLD | NEW |