Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Side by Side Diff: Source/core/layout/LayoutListMarker.h

Issue 778003003: List marker pseudo elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/layout/LayoutListMarker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 #define LayoutListMarker_h 24 #define LayoutListMarker_h
25 25
26 #include "core/layout/LayoutBox.h" 26 #include "core/layout/LayoutBox.h"
27 27
28 namespace blink { 28 namespace blink {
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 render 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 LayoutListMarker(Element*, LayoutListItem*);
39 40
40 virtual ~LayoutListMarker(); 41 virtual ~LayoutListMarker();
41 virtual void destroy() override; 42 virtual void destroy() override;
42 43
43 const String& text() const { return m_text; } 44 const String& text() const { return m_text; }
44 45
45 bool isInside() const; 46 bool isInside() const;
46 47
47 void updateMarginsAndContent(); 48 void updateMarginsAndContent();
48 49
49 IntRect getRelativeMarkerRect(); 50 IntRect getRelativeMarkerRect();
50 LayoutRect localSelectionRect(); 51 LayoutRect localSelectionRect();
51 virtual bool isImage() const override; 52 virtual bool isImage() const override;
52 const StyleImage* image() { return m_image.get(); } 53 const StyleImage* image() { return m_image.get(); }
53 const LayoutListItem* listItem() { return m_listItem; } 54 const LayoutListItem* listItem() const { return m_listItem; }
55 LayoutListItem* mutableListItem() const { return m_listItem; }
54 56
55 static UChar listMarkerSuffix(EListStyleType, int value); 57 static UChar listMarkerSuffix(EListStyleType, int value);
56 58
57 void listItemStyleDidChange(); 59 void listItemStyleDidChange();
58 60
59 virtual const char* name() const override { return "LayoutListMarker"; } 61 virtual const char* name() const override { return "LayoutListMarker"; }
60 62
61 private: 63 private:
62 LayoutListMarker(LayoutListItem*); 64 LayoutListMarker(LayoutListItem*);
63 65
(...skipping 27 matching lines...) Expand all
91 String m_text; 93 String m_text;
92 RefPtr<StyleImage> m_image; 94 RefPtr<StyleImage> m_image;
93 LayoutListItem* m_listItem; 95 LayoutListItem* m_listItem;
94 }; 96 };
95 97
96 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutListMarker, isListMarker()); 98 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutListMarker, isListMarker());
97 99
98 } // namespace blink 100 } // namespace blink
99 101
100 #endif // LayoutListMarker_h 102 #endif // LayoutListMarker_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/layout/LayoutListMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698