| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 DisplayItem::Type displayItemType) const { | 180 DisplayItem::Type displayItemType) const { |
| 181 if (DrawingRecorder::useCachedDrawingIfPossible(context, *this, | 181 if (DrawingRecorder::useCachedDrawingIfPossible(context, *this, |
| 182 displayItemType)) | 182 displayItemType)) |
| 183 return; | 183 return; |
| 184 | 184 |
| 185 LayoutRect drawingRect = localCaretRectWithoutUpdate(); | 185 LayoutRect drawingRect = localCaretRectWithoutUpdate(); |
| 186 if (LayoutBlock* layoutObject = caretLayoutObject(node)) | 186 if (LayoutBlock* layoutObject = caretLayoutObject(node)) |
| 187 layoutObject->flipForWritingMode(drawingRect); | 187 layoutObject->flipForWritingMode(drawingRect); |
| 188 drawingRect.moveBy(paintOffset); | 188 drawingRect.moveBy(paintOffset); |
| 189 | 189 |
| 190 const Color caretColor = node->layoutObject()->resolveColor(CSSPropertyColor); | 190 const Color caretColor = |
| 191 node->layoutObject()->resolveColor(CSSPropertyCaretColor); |
| 191 IntRect paintRect = pixelSnappedIntRect(drawingRect); | 192 IntRect paintRect = pixelSnappedIntRect(drawingRect); |
| 192 DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, | 193 DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, |
| 193 paintRect); | 194 paintRect); |
| 194 context.fillRect(paintRect, caretColor); | 195 context.fillRect(paintRect, caretColor); |
| 195 } | 196 } |
| 196 | 197 |
| 197 String CaretBase::debugName() const { | 198 String CaretBase::debugName() const { |
| 198 return "Caret"; | 199 return "Caret"; |
| 199 } | 200 } |
| 200 | 201 |
| 201 LayoutRect CaretBase::visualRect() const { | 202 LayoutRect CaretBase::visualRect() const { |
| 202 return m_visualRect; | 203 return m_visualRect; |
| 203 } | 204 } |
| 204 | 205 |
| 205 } // namespace blink | 206 } // namespace blink |
| OLD | NEW |