| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale
d()) | 290 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale
d()) |
| 291 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; | 291 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; |
| 292 else | 292 else |
| 293 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; | 293 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; |
| 294 | 294 |
| 295 revealSelection(alignment, RevealExtent); | 295 revealSelection(alignment, RevealExtent); |
| 296 } | 296 } |
| 297 | 297 |
| 298 notifyAccessibilityForSelectionChange(); | 298 notifyAccessibilityForSelectionChange(); |
| 299 notifyCompositorForSelectionChange(); | 299 notifyCompositorForSelectionChange(); |
| 300 notifyEventHandlerForSelectionChange(); |
| 300 m_frame->domWindow()->enqueueDocumentEvent(Event::create(EventTypeNames::sel
ectionchange)); | 301 m_frame->domWindow()->enqueueDocumentEvent(Event::create(EventTypeNames::sel
ectionchange)); |
| 301 } | 302 } |
| 302 | 303 |
| 303 static bool removingNodeRemovesPosition(Node& node, const Position& position) | 304 static bool removingNodeRemovesPosition(Node& node, const Position& position) |
| 304 { | 305 { |
| 305 if (!position.anchorNode()) | 306 if (!position.anchorNode()) |
| 306 return false; | 307 return false; |
| 307 | 308 |
| 308 if (position.anchorNode() == node) | 309 if (position.anchorNode() == node) |
| 309 return true; | 310 return true; |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 } | 1446 } |
| 1446 | 1447 |
| 1447 void FrameSelection::notifyCompositorForSelectionChange() | 1448 void FrameSelection::notifyCompositorForSelectionChange() |
| 1448 { | 1449 { |
| 1449 if (!RuntimeEnabledFeatures::compositedSelectionUpdatesEnabled()) | 1450 if (!RuntimeEnabledFeatures::compositedSelectionUpdatesEnabled()) |
| 1450 return; | 1451 return; |
| 1451 | 1452 |
| 1452 scheduleVisualUpdate(); | 1453 scheduleVisualUpdate(); |
| 1453 } | 1454 } |
| 1454 | 1455 |
| 1456 void FrameSelection::notifyEventHandlerForSelectionChange() |
| 1457 { |
| 1458 m_frame->eventHandler().notifySelectionChanged(); |
| 1459 } |
| 1460 |
| 1455 void FrameSelection::focusedOrActiveStateChanged() | 1461 void FrameSelection::focusedOrActiveStateChanged() |
| 1456 { | 1462 { |
| 1457 bool activeAndFocused = isFocusedAndActive(); | 1463 bool activeAndFocused = isFocusedAndActive(); |
| 1458 | 1464 |
| 1459 RefPtrWillBeRawPtr<Document> document = m_frame->document(); | 1465 RefPtrWillBeRawPtr<Document> document = m_frame->document(); |
| 1460 document->updateRenderTreeIfNeeded(); | 1466 document->updateRenderTreeIfNeeded(); |
| 1461 | 1467 |
| 1462 // Because RenderObject::selectionBackgroundColor() and | 1468 // Because RenderObject::selectionBackgroundColor() and |
| 1463 // RenderObject::selectionForegroundColor() check if the frame is active, | 1469 // RenderObject::selectionForegroundColor() check if the frame is active, |
| 1464 // we have to update places those colors were painted. | 1470 // we have to update places those colors were painted. |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1925 sel.showTreeForThis(); | 1931 sel.showTreeForThis(); |
| 1926 } | 1932 } |
| 1927 | 1933 |
| 1928 void showTree(const blink::FrameSelection* sel) | 1934 void showTree(const blink::FrameSelection* sel) |
| 1929 { | 1935 { |
| 1930 if (sel) | 1936 if (sel) |
| 1931 sel->showTreeForThis(); | 1937 sel->showTreeForThis(); |
| 1932 } | 1938 } |
| 1933 | 1939 |
| 1934 #endif | 1940 #endif |
| OLD | NEW |