| 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 LayoutViewItem view = m_frame->document()->layoutViewItem(); | 724 LayoutViewItem view = m_frame->document()->layoutViewItem(); |
| 725 if (m_previousCaretNode && (m_caretBase->shouldRepaintCaret(*m_previousCaret
Node) || m_caretBase->shouldRepaintCaret(view))) | 725 if (m_previousCaretNode && (m_caretBase->shouldRepaintCaret(*m_previousCaret
Node) || m_caretBase->shouldRepaintCaret(view))) |
| 726 m_caretBase->invalidateLocalCaretRect(m_previousCaretNode.get(), m_previ
ousCaretRect); | 726 m_caretBase->invalidateLocalCaretRect(m_previousCaretNode.get(), m_previ
ousCaretRect); |
| 727 if (newNode && (m_caretBase->shouldRepaintCaret(*newNode) || m_caretBase->sh
ouldRepaintCaret(view))) | 727 if (newNode && (m_caretBase->shouldRepaintCaret(*newNode) || m_caretBase->sh
ouldRepaintCaret(view))) |
| 728 m_caretBase->invalidateLocalCaretRect(newNode, newRect); | 728 m_caretBase->invalidateLocalCaretRect(newNode, newRect); |
| 729 m_previousCaretNode = newNode; | 729 m_previousCaretNode = newNode; |
| 730 m_previousCaretRect = newRect; | 730 m_previousCaretRect = newRect; |
| 731 m_previousCaretVisibility = m_caretBase->getCaretVisibility(); | 731 m_previousCaretVisibility = m_caretBase->getCaretVisibility(); |
| 732 } | 732 } |
| 733 | 733 |
| 734 void FrameSelection::dataWillChange(const CharacterData& node) |
| 735 { |
| 736 if (node == m_previousCaretNode) |
| 737 m_caretBase->invalidateLocalCaretRect(m_previousCaretNode.get(), m_previ
ousCaretRect); |
| 738 } |
| 739 |
| 734 void FrameSelection::paintCaret(GraphicsContext& context, const LayoutPoint& pai
ntOffset) | 740 void FrameSelection::paintCaret(GraphicsContext& context, const LayoutPoint& pai
ntOffset) |
| 735 { | 741 { |
| 736 if (selection().isCaret() && m_shouldPaintCaret) { | 742 if (selection().isCaret() && m_shouldPaintCaret) { |
| 737 m_caretBase->updateCaretRect(PositionWithAffinity(selection().start(), s
election().affinity())); | 743 m_caretBase->updateCaretRect(PositionWithAffinity(selection().start(), s
election().affinity())); |
| 738 m_caretBase->paintCaret(selection().start().anchorNode(), context, paint
Offset); | 744 m_caretBase->paintCaret(selection().start().anchorNode(), context, paint
Offset); |
| 739 } | 745 } |
| 740 } | 746 } |
| 741 | 747 |
| 742 bool FrameSelection::contains(const LayoutPoint& point) | 748 bool FrameSelection::contains(const LayoutPoint& point) |
| 743 { | 749 { |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 | 1426 |
| 1421 void showTree(const blink::FrameSelection* sel) | 1427 void showTree(const blink::FrameSelection* sel) |
| 1422 { | 1428 { |
| 1423 if (sel) | 1429 if (sel) |
| 1424 sel->showTreeForThis(); | 1430 sel->showTreeForThis(); |
| 1425 else | 1431 else |
| 1426 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1432 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1427 } | 1433 } |
| 1428 | 1434 |
| 1429 #endif | 1435 #endif |
| OLD | NEW |