| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation(); | 266 m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation(); |
| 267 selectFrameElementInParentIfFullySelected(); | 267 selectFrameElementInParentIfFullySelected(); |
| 268 notifyRendererOfSelectionChange(userTriggered); | 268 notifyRendererOfSelectionChange(userTriggered); |
| 269 m_frame->editor().respondToChangedSelection(oldSelection, options); | 269 m_frame->editor().respondToChangedSelection(oldSelection, options); |
| 270 if (userTriggered == UserTriggered) { | 270 if (userTriggered == UserTriggered) { |
| 271 ScrollAlignment alignment = (align == AlignCursorOnScrollAlways) ? Scrol
lAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; | 271 ScrollAlignment alignment = (align == AlignCursorOnScrollAlways) ? Scrol
lAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; |
| 272 revealSelection(alignment, RevealExtent); | 272 revealSelection(alignment, RevealExtent); |
| 273 } | 273 } |
| 274 | 274 |
| 275 notifyAccessibilityForSelectionChange(); | 275 notifyAccessibilityForSelectionChange(); |
| 276 notifyCompositorForSelectionChange(); | 276 |
| 277 m_frame->domWindow()->enqueueDocumentEvent(Event::create(EventTypeNames::sel
ectionchange)); | 277 m_frame->domWindow()->enqueueDocumentEvent(Event::create(EventTypeNames::sel
ectionchange)); |
| 278 } | 278 } |
| 279 | 279 |
| 280 static bool removingNodeRemovesPosition(Node& node, const Position& position) | 280 static bool removingNodeRemovesPosition(Node& node, const Position& position) |
| 281 { | 281 { |
| 282 if (!position.anchorNode()) | 282 if (!position.anchorNode()) |
| 283 return false; | 283 return false; |
| 284 | 284 |
| 285 if (position.anchorNode() == node) | 285 if (position.anchorNode() == node) |
| 286 return true; | 286 return true; |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 | 1310 |
| 1311 bool FrameSelection::isInPasswordField() const | 1311 bool FrameSelection::isInPasswordField() const |
| 1312 { | 1312 { |
| 1313 return false; | 1313 return false; |
| 1314 } | 1314 } |
| 1315 | 1315 |
| 1316 void FrameSelection::notifyAccessibilityForSelectionChange() | 1316 void FrameSelection::notifyAccessibilityForSelectionChange() |
| 1317 { | 1317 { |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 void FrameSelection::notifyCompositorForSelectionChange() | |
| 1321 { | |
| 1322 if (!RuntimeEnabledFeatures::compositedSelectionUpdatesEnabled()) | |
| 1323 return; | |
| 1324 | |
| 1325 scheduleVisualUpdate(); | |
| 1326 } | |
| 1327 | |
| 1328 void FrameSelection::focusedOrActiveStateChanged() | 1320 void FrameSelection::focusedOrActiveStateChanged() |
| 1329 { | 1321 { |
| 1330 bool activeAndFocused = isFocusedAndActive(); | 1322 bool activeAndFocused = isFocusedAndActive(); |
| 1331 | 1323 |
| 1332 RefPtr<Document> document = m_frame->document(); | 1324 RefPtr<Document> document = m_frame->document(); |
| 1333 document->updateRenderTreeIfNeeded(); | 1325 document->updateRenderTreeIfNeeded(); |
| 1334 | 1326 |
| 1335 // Caret appears in the active frame. | 1327 // Caret appears in the active frame. |
| 1336 if (activeAndFocused) | 1328 if (activeAndFocused) |
| 1337 setSelectionFromNone(); | 1329 setSelectionFromNone(); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 | 1620 |
| 1629 void FrameSelection::showTreeForThis() const | 1621 void FrameSelection::showTreeForThis() const |
| 1630 { | 1622 { |
| 1631 m_selection.showTreeForThis(); | 1623 m_selection.showTreeForThis(); |
| 1632 } | 1624 } |
| 1633 | 1625 |
| 1634 #endif | 1626 #endif |
| 1635 | 1627 |
| 1636 void FrameSelection::setCaretRectNeedsUpdate() | 1628 void FrameSelection::setCaretRectNeedsUpdate() |
| 1637 { | 1629 { |
| 1638 scheduleVisualUpdate(); | 1630 if (m_frame) |
| 1639 } | 1631 m_frame->document()->scheduleVisualUpdate(); |
| 1640 | |
| 1641 void FrameSelection::scheduleVisualUpdate() const | |
| 1642 { | |
| 1643 if (!m_frame) | |
| 1644 return; | |
| 1645 if (Page* page = m_frame->page()) | |
| 1646 page->animator().scheduleVisualUpdate(); | |
| 1647 } | 1632 } |
| 1648 | 1633 |
| 1649 } | 1634 } |
| 1650 | 1635 |
| 1651 #ifndef NDEBUG | 1636 #ifndef NDEBUG |
| 1652 | 1637 |
| 1653 void showTree(const blink::FrameSelection& sel) | 1638 void showTree(const blink::FrameSelection& sel) |
| 1654 { | 1639 { |
| 1655 sel.showTreeForThis(); | 1640 sel.showTreeForThis(); |
| 1656 } | 1641 } |
| 1657 | 1642 |
| 1658 void showTree(const blink::FrameSelection* sel) | 1643 void showTree(const blink::FrameSelection* sel) |
| 1659 { | 1644 { |
| 1660 if (sel) | 1645 if (sel) |
| 1661 sel->showTreeForThis(); | 1646 sel->showTreeForThis(); |
| 1662 } | 1647 } |
| 1663 | 1648 |
| 1664 #endif | 1649 #endif |
| OLD | NEW |