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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 void FrameSelection::nodeWillBeRemoved(Node& node) | 399 void FrameSelection::nodeWillBeRemoved(Node& node) |
400 { | 400 { |
401 // There can't be a selection inside a fragment, so if a fragment's node is
being removed, | 401 // There can't be a selection inside a fragment, so if a fragment's node is
being removed, |
402 // the selection in the document that created the fragment needs no adjustme
nt. | 402 // the selection in the document that created the fragment needs no adjustme
nt. |
403 if (isNone() || !node.inActiveDocument()) | 403 if (isNone() || !node.inActiveDocument()) |
404 return; | 404 return; |
405 | 405 |
406 respondToNodeModification(node, removingNodeRemovesPosition(node, selection(
).base()), removingNodeRemovesPosition(node, selection().extent()), | 406 respondToNodeModification(node, removingNodeRemovesPosition(node, selection(
).base()), removingNodeRemovesPosition(node, selection().extent()), |
407 removingNodeRemovesPosition(node, selection().start()), removingNodeRemo
vesPosition(node, selection().end())); | 407 removingNodeRemovesPosition(node, selection().start()), removingNodeRemo
vesPosition(node, selection().end())); |
| 408 |
| 409 if (node == m_previousCaretNode) { |
| 410 // Hits in ManualTests/caret-paint-after-last-text-is-removed.html |
| 411 DisableCompositingQueryAsserts disabler; |
| 412 invalidateLocalCaretRect(m_previousCaretNode.get(), m_previousCaretRect)
; |
| 413 m_previousCaretNode = nullptr; |
| 414 m_previousCaretRect = LayoutRect(); |
| 415 m_previousCaretVisibility = Hidden; |
| 416 } |
408 } | 417 } |
409 | 418 |
410 static bool intersectsNode(const VisibleSelection& selection, Node* node) | 419 static bool intersectsNode(const VisibleSelection& selection, Node* node) |
411 { | 420 { |
412 if (selection.isNone()) | 421 if (selection.isNone()) |
413 return false; | 422 return false; |
414 Position start = selection.start().parentAnchoredEquivalent(); | 423 Position start = selection.start().parentAnchoredEquivalent(); |
415 Position end = selection.end().parentAnchoredEquivalent(); | 424 Position end = selection.end().parentAnchoredEquivalent(); |
416 TrackExceptionState exceptionState; | 425 TrackExceptionState exceptionState; |
417 // TODO(yosin) We should avoid to use |Range::intersectsNode()|. | 426 // TODO(yosin) We should avoid to use |Range::intersectsNode()|. |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 | 1410 |
1402 void showTree(const blink::FrameSelection* sel) | 1411 void showTree(const blink::FrameSelection* sel) |
1403 { | 1412 { |
1404 if (sel) | 1413 if (sel) |
1405 sel->showTreeForThis(); | 1414 sel->showTreeForThis(); |
1406 else | 1415 else |
1407 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1416 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
1408 } | 1417 } |
1409 | 1418 |
1410 #endif | 1419 #endif |
OLD | NEW |