| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 return adoptPtr(new DragCaretController); | 54 return adoptPtr(new DragCaretController); |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool DragCaretController::isContentRichlyEditable() const | 57 bool DragCaretController::isContentRichlyEditable() const |
| 58 { | 58 { |
| 59 return isRichlyEditablePosition(m_position.deepEquivalent()); | 59 return isRichlyEditablePosition(m_position.deepEquivalent()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void DragCaretController::setCaretPosition(const VisiblePosition& position) | 62 void DragCaretController::setCaretPosition(const VisiblePosition& position) |
| 63 { | 63 { |
| 64 // for querying RenderLayer::compositingState() | |
| 65 // This code is probably correct, since it doesn't occur in a stack that inv
olves updating compositing state. | |
| 66 DisableCompositingQueryAsserts disabler; | |
| 67 | |
| 68 if (Node* node = m_position.deepEquivalent().deprecatedNode()) | 64 if (Node* node = m_position.deepEquivalent().deprecatedNode()) |
| 69 invalidateCaretRect(node); | 65 invalidateCaretRect(node); |
| 70 m_position = position; | 66 m_position = position; |
| 71 setCaretRectNeedsUpdate(); | 67 setCaretRectNeedsUpdate(); |
| 72 Document* document = 0; | 68 Document* document = 0; |
| 73 if (Node* node = m_position.deepEquivalent().deprecatedNode()) { | 69 if (Node* node = m_position.deepEquivalent().deprecatedNode()) { |
| 74 invalidateCaretRect(node); | 70 invalidateCaretRect(node); |
| 75 document = &node->document(); | 71 document = &node->document(); |
| 76 } | 72 } |
| 77 if (m_position.isNull() || m_position.isOrphan()) { | 73 if (m_position.isNull() || m_position.isOrphan()) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 context->fillRect(caret, caretColor); | 245 context->fillRect(caret, caretColor); |
| 250 } | 246 } |
| 251 | 247 |
| 252 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p,
const LayoutPoint& paintOffset, const LayoutRect& clipRect) const | 248 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p,
const LayoutPoint& paintOffset, const LayoutRect& clipRect) const |
| 253 { | 249 { |
| 254 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram
e) | 250 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram
e) |
| 255 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset,
clipRect); | 251 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset,
clipRect); |
| 256 } | 252 } |
| 257 | 253 |
| 258 } | 254 } |
| OLD | NEW |