summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderListItem.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/RenderListItem.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/rendering/RenderListItem.h')
-rw-r--r--Source/WebCore/rendering/RenderListItem.h55
1 files changed, 29 insertions, 26 deletions
diff --git a/Source/WebCore/rendering/RenderListItem.h b/Source/WebCore/rendering/RenderListItem.h
index 035991a9b..27c7ccd9f 100644
--- a/Source/WebCore/rendering/RenderListItem.h
+++ b/Source/WebCore/rendering/RenderListItem.h
@@ -20,8 +20,7 @@
*
*/
-#ifndef RenderListItem_h
-#define RenderListItem_h
+#pragma once
#include "RenderBlockFlow.h"
#include "RenderPtr.h"
@@ -33,8 +32,9 @@ class RenderListMarker;
class RenderListItem final : public RenderBlockFlow {
public:
- RenderListItem(Element&, PassRef<RenderStyle>);
- Element& element() const { return toElement(nodeForNonAnonymous()); }
+ RenderListItem(Element&, RenderStyle&&);
+ virtual ~RenderListItem();
+ Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }
int value() const { if (!m_isValueUpToDate) updateValueNow(); return m_value; }
void updateValue();
@@ -47,37 +47,40 @@ public:
void setNotInList(bool notInList) { m_notInList = notInList; }
bool notInList() const { return m_notInList; }
- const String& markerText() const;
+ WEBCORE_EXPORT const String& markerText() const;
String markerTextWithSuffix() const;
void updateListMarkerNumbers();
- static void updateItemValuesForOrderedList(const HTMLOListElement*);
- static unsigned itemCountForOrderedList(const HTMLOListElement*);
+ static void updateItemValuesForOrderedList(const HTMLOListElement&);
+ static unsigned itemCountForOrderedList(const HTMLOListElement&);
+
+ void didDestroyListMarker() { m_marker = nullptr; }
+
+#if !ASSERT_DISABLED
+ bool inLayout() const { return m_inLayout; }
+#endif
private:
- virtual const char* renderName() const override { return "RenderListItem"; }
+ void willBeDestroyed() override;
- virtual bool isListItem() const override { return true; }
-
- virtual void willBeDestroyed() override;
+ const char* renderName() const override { return "RenderListItem"; }
- virtual void insertedIntoTree() override;
- virtual void willBeRemovedFromTree() override;
+ bool isListItem() const override { return true; }
+
+ void insertedIntoTree() override;
+ void willBeRemovedFromTree() override;
- virtual bool isEmpty() const override;
- virtual void paint(PaintInfo&, const LayoutPoint&) override;
+ void paint(PaintInfo&, const LayoutPoint&) override;
- virtual void layout() override;
+ void layout() override;
void positionListMarker();
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
+ void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
- virtual bool requiresForcedStyleRecalcPropagation() const override { return true; }
-
- virtual void addOverflowFromChildren() override;
- virtual void computePreferredLogicalWidths() override;
+ void addOverflowFromChildren() override;
+ void computePreferredLogicalWidths() override;
void insertOrMoveMarkerRendererIfNeeded();
inline int calcValue() const;
@@ -85,16 +88,16 @@ private:
void explicitValueChanged();
int m_explicitValue;
- RenderPtr<RenderListMarker> m_marker;
+ RenderListMarker* m_marker;
mutable int m_value;
-
+#if !ASSERT_DISABLED
+ bool m_inLayout { false };
+#endif
bool m_hasExplicitValue : 1;
mutable bool m_isValueUpToDate : 1;
bool m_notInList : 1;
};
-RENDER_OBJECT_TYPE_CASTS(RenderListItem, isListItem())
-
} // namespace WebCore
-#endif // RenderListItem_h
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderListItem, isListItem())