| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale
d()) | 291 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale
d()) |
| 292 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; | 292 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; |
| 293 else | 293 else |
| 294 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; | 294 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; |
| 295 | 295 |
| 296 revealSelection(alignment, RevealExtent); | 296 revealSelection(alignment, RevealExtent); |
| 297 } | 297 } |
| 298 | 298 |
| 299 notifyAccessibilityForSelectionChange(); | 299 notifyAccessibilityForSelectionChange(); |
| 300 notifyCompositorForSelectionChange(); | 300 notifyCompositorForSelectionChange(); |
| 301 notifyEventHandlerForSelectionChange(); | |
| 302 m_frame->localDOMWindow()->enqueueDocumentEvent(Event::create(EventTypeNames
::selectionchange)); | 301 m_frame->localDOMWindow()->enqueueDocumentEvent(Event::create(EventTypeNames
::selectionchange)); |
| 303 } | 302 } |
| 304 | 303 |
| 305 static bool removingNodeRemovesPosition(Node& node, const Position& position) | 304 static bool removingNodeRemovesPosition(Node& node, const Position& position) |
| 306 { | 305 { |
| 307 if (!position.anchorNode()) | 306 if (!position.anchorNode()) |
| 308 return false; | 307 return false; |
| 309 | 308 |
| 310 if (position.anchorNode() == node) | 309 if (position.anchorNode() == node) |
| 311 return true; | 310 return true; |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 } | 1452 } |
| 1454 | 1453 |
| 1455 void FrameSelection::notifyCompositorForSelectionChange() | 1454 void FrameSelection::notifyCompositorForSelectionChange() |
| 1456 { | 1455 { |
| 1457 if (!RuntimeEnabledFeatures::compositedSelectionUpdateEnabled()) | 1456 if (!RuntimeEnabledFeatures::compositedSelectionUpdateEnabled()) |
| 1458 return; | 1457 return; |
| 1459 | 1458 |
| 1460 scheduleVisualUpdate(); | 1459 scheduleVisualUpdate(); |
| 1461 } | 1460 } |
| 1462 | 1461 |
| 1463 void FrameSelection::notifyEventHandlerForSelectionChange() | |
| 1464 { | |
| 1465 m_frame->eventHandler().notifySelectionChanged(); | |
| 1466 } | |
| 1467 | |
| 1468 void FrameSelection::focusedOrActiveStateChanged() | 1462 void FrameSelection::focusedOrActiveStateChanged() |
| 1469 { | 1463 { |
| 1470 bool activeAndFocused = isFocusedAndActive(); | 1464 bool activeAndFocused = isFocusedAndActive(); |
| 1471 | 1465 |
| 1472 RefPtrWillBeRawPtr<Document> document = m_frame->document(); | 1466 RefPtrWillBeRawPtr<Document> document = m_frame->document(); |
| 1473 document->updateRenderTreeIfNeeded(); | 1467 document->updateRenderTreeIfNeeded(); |
| 1474 | 1468 |
| 1475 // Because LayoutObject::selectionBackgroundColor() and | 1469 // Because LayoutObject::selectionBackgroundColor() and |
| 1476 // LayoutObject::selectionForegroundColor() check if the frame is active, | 1470 // LayoutObject::selectionForegroundColor() check if the frame is active, |
| 1477 // we have to update places those colors were painted. | 1471 // we have to update places those colors were painted. |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 sel.showTreeForThis(); | 1938 sel.showTreeForThis(); |
| 1945 } | 1939 } |
| 1946 | 1940 |
| 1947 void showTree(const blink::FrameSelection* sel) | 1941 void showTree(const blink::FrameSelection* sel) |
| 1948 { | 1942 { |
| 1949 if (sel) | 1943 if (sel) |
| 1950 sel->showTreeForThis(); | 1944 sel->showTreeForThis(); |
| 1951 } | 1945 } |
| 1952 | 1946 |
| 1953 #endif | 1947 #endif |
| OLD | NEW |