| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 void FrameSelection::invalidatePaintIfNeeded( | 473 void FrameSelection::invalidatePaintIfNeeded( |
| 474 const LayoutBlock& block, | 474 const LayoutBlock& block, |
| 475 const PaintInvalidatorContext& context, | 475 const PaintInvalidatorContext& context, |
| 476 PaintInvalidationReason reason) { | 476 PaintInvalidationReason reason) { |
| 477 m_frameCaret->invalidatePaintIfNeeded(block, context, reason); | 477 m_frameCaret->invalidatePaintIfNeeded(block, context, reason); |
| 478 } | 478 } |
| 479 | 479 |
| 480 bool FrameSelection::shouldPaintCaret(const LayoutBlock& block) const { | 480 bool FrameSelection::shouldPaintCaret(const LayoutBlock& block) const { |
| 481 DCHECK_GE(document().lifecycle().state(), DocumentLifecycle::LayoutClean); | 481 DCHECK_GE(document().lifecycle().state(), DocumentLifecycle::LayoutClean); |
| 482 bool result = m_frameCaret->shouldPaintCaret(block); | 482 bool result = m_frameCaret->shouldPaintCaret(block); |
| 483 DCHECK(!result || (isCaret() && hasEditableStyle())); | 483 DCHECK(!result || (computeVisibleSelectionInDOMTreeDeprecated().isCaret() && |
| 484 hasEditableStyle())); |
| 484 return result; | 485 return result; |
| 485 } | 486 } |
| 486 | 487 |
| 487 IntRect FrameSelection::absoluteCaretBounds() { | 488 IntRect FrameSelection::absoluteCaretBounds() { |
| 488 DCHECK(computeVisibleSelectionInDOMTree().isValidFor(*m_frame->document())); | 489 DCHECK(computeVisibleSelectionInDOMTree().isValidFor(*m_frame->document())); |
| 489 return m_frameCaret->absoluteCaretBounds(); | 490 return m_frameCaret->absoluteCaretBounds(); |
| 490 } | 491 } |
| 491 | 492 |
| 492 void FrameSelection::paintCaret(GraphicsContext& context, | 493 void FrameSelection::paintCaret(GraphicsContext& context, |
| 493 const LayoutPoint& paintOffset) { | 494 const LayoutPoint& paintOffset) { |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 } | 1179 } |
| 1179 | 1180 |
| 1180 void showTree(const blink::FrameSelection* sel) { | 1181 void showTree(const blink::FrameSelection* sel) { |
| 1181 if (sel) | 1182 if (sel) |
| 1182 sel->showTreeForThis(); | 1183 sel->showTreeForThis(); |
| 1183 else | 1184 else |
| 1184 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1185 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
| 1185 } | 1186 } |
| 1186 | 1187 |
| 1187 #endif | 1188 #endif |
| OLD | NEW |