| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
nt& paintOffset, DisplayItem::Type displayItemType) const | 188 void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
nt& paintOffset, DisplayItem::Type displayItemType) const |
| 189 { | 189 { |
| 190 if (DrawingRecorder::useCachedDrawingIfPossible(context, *this, displayItemT
ype)) | 190 if (DrawingRecorder::useCachedDrawingIfPossible(context, *this, displayItemT
ype)) |
| 191 return; | 191 return; |
| 192 | 192 |
| 193 LayoutRect drawingRect = localCaretRectWithoutUpdate(); | 193 LayoutRect drawingRect = localCaretRectWithoutUpdate(); |
| 194 if (LayoutBlock* layoutObject = caretLayoutObject(node)) | 194 if (LayoutBlock* layoutObject = caretLayoutObject(node)) |
| 195 layoutObject->flipForWritingMode(drawingRect); | 195 layoutObject->flipForWritingMode(drawingRect); |
| 196 drawingRect.moveBy(roundedIntPoint(paintOffset)); | 196 drawingRect.moveBy(paintOffset); |
| 197 | 197 |
| 198 const Color caretColor = node->layoutObject()->resolveColor(CSSPropertyColor
); | 198 const Color caretColor = node->layoutObject()->resolveColor(CSSPropertyColor
); |
| 199 IntRect paintRect = pixelSnappedIntRect(drawingRect); | 199 IntRect paintRect = pixelSnappedIntRect(drawingRect); |
| 200 DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, paintRe
ct); | 200 DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, paintRe
ct); |
| 201 context.fillRect(paintRect, caretColor); | 201 context.fillRect(paintRect, caretColor); |
| 202 } | 202 } |
| 203 | 203 |
| 204 String CaretBase::debugName() const | 204 String CaretBase::debugName() const |
| 205 { | 205 { |
| 206 return "Caret"; | 206 return "Caret"; |
| 207 } | 207 } |
| 208 | 208 |
| 209 LayoutRect CaretBase::visualRect() const | 209 LayoutRect CaretBase::visualRect() const |
| 210 { | 210 { |
| 211 return m_visualRect; | 211 return m_visualRect; |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace blink | 214 } // namespace blink |
| OLD | NEW |