| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 void CaretBase::invalidateLocalCaretRect(Node* node, const LayoutRect& rect) | 129 void CaretBase::invalidateLocalCaretRect(Node* node, const LayoutRect& rect) |
| 130 { | 130 { |
| 131 LayoutBlock* caretPainter = caretLayoutObject(node); | 131 LayoutBlock* caretPainter = caretLayoutObject(node); |
| 132 if (!caretPainter) | 132 if (!caretPainter) |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 // FIXME: Need to over-paint 1 pixel to workaround some rounding problems. | 135 // FIXME: Need to over-paint 1 pixel to workaround some rounding problems. |
| 136 // https://bugs.webkit.org/show_bug.cgi?id=108283 | 136 // https://bugs.webkit.org/show_bug.cgi?id=108283 |
| 137 LayoutRect inflatedRect = rect; | 137 LayoutRect inflatedRect = rect; |
| 138 inflatedRect.inflate(1); | 138 inflatedRect.inflate(LayoutUnit(1)); |
| 139 | 139 |
| 140 // FIXME: We should use mapLocalToAncestor() since we know we're not un-root
ed. | 140 // FIXME: We should use mapLocalToAncestor() since we know we're not un-root
ed. |
| 141 mapCaretRectToCaretPainter(node->layoutObject(), caretPainter, inflatedRect)
; | 141 mapCaretRectToCaretPainter(node->layoutObject(), caretPainter, inflatedRect)
; |
| 142 | 142 |
| 143 // FIXME: We should not allow paint invalidation out of paint invalidation s
tate. crbug.com/457415 | 143 // FIXME: We should not allow paint invalidation out of paint invalidation s
tate. crbug.com/457415 |
| 144 DisablePaintInvalidationStateAsserts disabler; | 144 DisablePaintInvalidationStateAsserts disabler; |
| 145 caretPainter->invalidatePaintRectangle(inflatedRect); | 145 caretPainter->invalidatePaintRectangle(inflatedRect); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool CaretBase::shouldRepaintCaret(Node& node) const | 148 bool CaretBase::shouldRepaintCaret(Node& node) const |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 else | 192 else |
| 193 element = node->parentElement(); | 193 element = node->parentElement(); |
| 194 | 194 |
| 195 if (element && element->layoutObject()) | 195 if (element && element->layoutObject()) |
| 196 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); | 196 caretColor = element->layoutObject()->resolveColor(CSSPropertyColor); |
| 197 | 197 |
| 198 context.fillRect(FloatRect(drawingRect), caretColor); | 198 context.fillRect(FloatRect(drawingRect), caretColor); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace blink | 201 } // namespace blink |
| OLD | NEW |