OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/layout/LayoutBlock.h" | 29 #include "core/layout/LayoutBlock.h" |
30 #include "platform/scroll/ScrollTypes.h" | 30 #include "platform/scroll/ScrollTypes.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class LayoutScrollbar; | 34 class LayoutScrollbar; |
35 | 35 |
36 class LayoutScrollbarPart final : public LayoutBlock { | 36 class LayoutScrollbarPart final : public LayoutBlock { |
37 public: | 37 public: |
38 static LayoutScrollbarPart* createAnonymous(Document*, LayoutScrollbar* = 0,
ScrollbarPart = NoPart); | 38 static LayoutScrollbarPart* createAnonymous(Document*, LayoutScrollbar* = nu
llptr, ScrollbarPart = NoPart); |
39 | 39 |
40 virtual ~LayoutScrollbarPart(); | 40 virtual ~LayoutScrollbarPart(); |
41 | 41 |
42 virtual const char* name() const override { return "LayoutScrollbarPart"; } | 42 virtual const char* name() const override { return "LayoutScrollbarPart"; } |
43 | 43 |
44 virtual DeprecatedPaintLayerType layerTypeRequired() const override { return
NoDeprecatedPaintLayer; } | 44 virtual DeprecatedPaintLayerType layerTypeRequired() const override { return
NoDeprecatedPaintLayer; } |
45 | 45 |
46 virtual void layout() override; | 46 virtual void layout() override; |
47 | 47 |
48 // Scrollbar parts needs to be rendered at device pixel boundaries. | 48 // Scrollbar parts needs to be rendered at device pixel boundaries. |
(...skipping 22 matching lines...) Expand all Loading... |
71 ASSERT(isIntegerValue(LayoutBlock::marginRight())); | 71 ASSERT(isIntegerValue(LayoutBlock::marginRight())); |
72 return LayoutBlock::marginRight(); | 72 return LayoutBlock::marginRight(); |
73 } | 73 } |
74 | 74 |
75 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectLayoutScrollbarPart || LayoutBlock::isOfType(type); } | 75 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectLayoutScrollbarPart || LayoutBlock::isOfType(type); } |
76 LayoutObject* layoutObjectOwningScrollbar() const; | 76 LayoutObject* layoutObjectOwningScrollbar() const; |
77 | 77 |
78 protected: | 78 protected: |
79 virtual void styleWillChange(StyleDifference, const ComputedStyle& newStyle)
override; | 79 virtual void styleWillChange(StyleDifference, const ComputedStyle& newStyle)
override; |
80 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle)
override; | 80 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle)
override; |
81 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override; | 81 virtual void imageChanged(WrappedImagePtr, const IntRect* = nullptr) overrid
e; |
82 | 82 |
83 private: | 83 private: |
84 LayoutScrollbarPart(LayoutScrollbar*, ScrollbarPart); | 84 LayoutScrollbarPart(LayoutScrollbar*, ScrollbarPart); |
85 | 85 |
86 virtual void computePreferredLogicalWidths() override; | 86 virtual void computePreferredLogicalWidths() override; |
87 | 87 |
88 // Have all padding getters return 0. The important point here is to avoid r
esolving percents | 88 // Have all padding getters return 0. The important point here is to avoid r
esolving percents |
89 // against the containing block, since scroll bar corners don't always have
one (so it would | 89 // against the containing block, since scroll bar corners don't always have
one (so it would |
90 // crash). Scroll bar corners are not actually laid out, and they don't have
child content, so | 90 // crash). Scroll bar corners are not actually laid out, and they don't have
child content, so |
91 // what we return here doesn't really matter. | 91 // what we return here doesn't really matter. |
(...skipping 14 matching lines...) Expand all Loading... |
106 | 106 |
107 LayoutScrollbar* m_scrollbar; | 107 LayoutScrollbar* m_scrollbar; |
108 ScrollbarPart m_part; | 108 ScrollbarPart m_part; |
109 }; | 109 }; |
110 | 110 |
111 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutScrollbarPart, isLayoutScrollbarPart()); | 111 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutScrollbarPart, isLayoutScrollbarPart()); |
112 | 112 |
113 } // namespace blink | 113 } // namespace blink |
114 | 114 |
115 #endif // LayoutScrollbarPart_h | 115 #endif // LayoutScrollbarPart_h |
OLD | NEW |