| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class GraphicsContext; | 38 class GraphicsContext; |
| 39 class LayoutBlock; | 39 class LayoutBlock; |
| 40 | 40 |
| 41 class CaretBase final : public DisplayItemClient { | 41 class CaretBase final : public DisplayItemClient { |
| 42 WTF_MAKE_NONCOPYABLE(CaretBase); | 42 WTF_MAKE_NONCOPYABLE(CaretBase); |
| 43 | 43 |
| 44 public: | 44 public: |
| 45 CaretBase(); | 45 CaretBase(); |
| 46 virtual ~CaretBase(); | 46 virtual ~CaretBase(); |
| 47 | 47 |
| 48 void invalidateCaretRect(Node*, const LayoutRect&); | |
| 49 // Creating VisiblePosition causes synchronous layout so we should use the | 48 // Creating VisiblePosition causes synchronous layout so we should use the |
| 50 // PositionWithAffinity version if possible. | 49 // PositionWithAffinity version if possible. |
| 51 // A position in HTMLTextFromControlElement is a typical example. | 50 // A position in HTMLTextFromControlElement is a typical example. |
| 52 static LayoutRect computeCaretRect(const PositionWithAffinity& caretPosition); | 51 static LayoutRect computeCaretRect(const PositionWithAffinity& caretPosition); |
| 53 | 52 |
| 54 void paintCaret(Node*, | 53 void paintCaret(Node*, |
| 55 GraphicsContext&, | 54 GraphicsContext&, |
| 56 const LayoutRect& caretLocalRect, | 55 const LayoutRect& caretLocalRect, |
| 57 const LayoutPoint&, | 56 const LayoutPoint&, |
| 58 DisplayItem::Type); | 57 DisplayItem::Type); |
| 59 | 58 |
| 60 static LayoutBlock* caretLayoutObject(Node*); | 59 static LayoutBlock* caretLayoutObject(Node*); |
| 61 void invalidateLocalCaretRect(Node*, const LayoutRect&); | 60 void invalidateLocalCaretRect(Node*, const LayoutRect&); |
| 62 | 61 |
| 63 // DisplayItemClient methods. | 62 // DisplayItemClient methods. |
| 64 LayoutRect visualRect() const final; | 63 LayoutRect visualRect() const final; |
| 65 String debugName() const final; | 64 String debugName() const final; |
| 66 | 65 |
| 67 private: | 66 private: |
| 68 LayoutRect m_visualRect; | 67 LayoutRect m_visualRect; |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 } // namespace blink | 70 } // namespace blink |
| 72 | 71 |
| 73 #endif // CaretBase_h | 72 #endif // CaretBase_h |
| OLD | NEW |