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