| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserv
ed. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 class LayoutListItem; | 30 class LayoutListItem; |
| 31 | 31 |
| 32 String listMarkerText(EListStyleType, int value); | 32 String listMarkerText(EListStyleType, int value); |
| 33 | 33 |
| 34 // Used to layout the list item's marker. | 34 // Used to layout the list item's marker. |
| 35 // The LayoutListMarker always has to be a child of a LayoutListItem. | 35 // The LayoutListMarker always has to be a child of a LayoutListItem. |
| 36 class LayoutListMarker final : public LayoutBox { | 36 class LayoutListMarker final : public LayoutBox { |
| 37 public: | 37 public: |
| 38 static LayoutListMarker* createAnonymous(LayoutListItem*); | 38 static LayoutListMarker* createAnonymous(LayoutListItem*); |
| 39 | 39 ~LayoutListMarker() override; |
| 40 virtual ~LayoutListMarker(); | |
| 41 | 40 |
| 42 const String& text() const { return m_text; } | 41 const String& text() const { return m_text; } |
| 43 | 42 |
| 44 bool isInside() const; | 43 bool isInside() const; |
| 45 | 44 |
| 46 void updateMarginsAndContent(); | 45 void updateMarginsAndContent(); |
| 47 | 46 |
| 48 IntRect getRelativeMarkerRect(); | 47 IntRect getRelativeMarkerRect(); |
| 49 LayoutRect localSelectionRect(); | 48 LayoutRect localSelectionRect(); |
| 50 virtual bool isImage() const override; | 49 bool isImage() const override; |
| 51 const StyleImage* image() { return m_image.get(); } | 50 const StyleImage* image() { return m_image.get(); } |
| 52 const LayoutListItem* listItem() { return m_listItem; } | 51 const LayoutListItem* listItem() { return m_listItem; } |
| 53 | 52 |
| 54 static UChar listMarkerSuffix(EListStyleType, int value); | 53 static UChar listMarkerSuffix(EListStyleType, int value); |
| 55 | 54 |
| 56 void listItemStyleDidChange(); | 55 void listItemStyleDidChange(); |
| 57 | 56 |
| 58 virtual const char* name() const override { return "LayoutListMarker"; } | 57 const char* name() const override { return "LayoutListMarker"; } |
| 59 | 58 |
| 60 protected: | 59 protected: |
| 61 virtual void willBeDestroyed() override; | 60 void willBeDestroyed() override; |
| 62 | 61 |
| 63 private: | 62 private: |
| 64 LayoutListMarker(LayoutListItem*); | 63 LayoutListMarker(LayoutListItem*); |
| 65 | 64 |
| 66 virtual void computePreferredLogicalWidths() override; | 65 void computePreferredLogicalWidths() override; |
| 67 | 66 |
| 68 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectListMarker || LayoutBox::isOfType(type); } | 67 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectListMarker || LayoutBox::isOfType(type); } |
| 69 | 68 |
| 70 virtual void paint(const PaintInfo&, const LayoutPoint&) override; | 69 void paint(const PaintInfo&, const LayoutPoint&) override; |
| 71 | 70 |
| 72 virtual void layout() override; | 71 void layout() override; |
| 73 | 72 |
| 74 virtual void imageChanged(WrappedImagePtr, const IntRect* = nullptr) overrid
e; | 73 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; |
| 75 | 74 |
| 76 virtual InlineBox* createInlineBox() override; | 75 InlineBox* createInlineBox() override; |
| 77 | 76 |
| 78 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const override; | 77 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode =
PositionOnContainingLine) const override; |
| 79 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const override; | 78 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePo
sitionMode = PositionOnContainingLine) const override; |
| 80 | 79 |
| 81 bool isText() const { return !isImage(); } | 80 bool isText() const { return !isImage(); } |
| 82 | 81 |
| 83 virtual void setSelectionState(SelectionState) override; | 82 void setSelectionState(SelectionState) override; |
| 84 virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObj
ect* paintInvalidationContainer) const override; | 83 LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObject* pai
ntInvalidationContainer) const override; |
| 85 virtual bool canBeSelectionLeaf() const override { return true; } | 84 bool canBeSelectionLeaf() const override { return true; } |
| 86 | 85 |
| 87 void updateMargins(); | 86 void updateMargins(); |
| 88 void updateContent(); | 87 void updateContent(); |
| 89 | 88 |
| 90 virtual void styleWillChange(StyleDifference, const ComputedStyle& newStyle)
override; | 89 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid
e; |
| 91 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle)
override; | 90 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
| 92 | 91 |
| 93 String m_text; | 92 String m_text; |
| 94 RefPtr<StyleImage> m_image; | 93 RefPtr<StyleImage> m_image; |
| 95 LayoutListItem* m_listItem; | 94 LayoutListItem* m_listItem; |
| 96 }; | 95 }; |
| 97 | 96 |
| 98 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutListMarker, isListMarker()); | 97 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutListMarker, isListMarker()); |
| 99 | 98 |
| 100 } // namespace blink | 99 } // namespace blink |
| 101 | 100 |
| 102 #endif // LayoutListMarker_h | 101 #endif // LayoutListMarker_h |
| OLD | NEW |