| 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* = nu
llptr, ScrollbarPart = NoPart); | 38 static LayoutScrollbarPart* createAnonymous(Document*, ScrollableArea*, |
| 39 LayoutScrollbar* = nullptr, ScrollbarPart = NoPart); |
| 39 ~LayoutScrollbarPart() override; | 40 ~LayoutScrollbarPart() override; |
| 40 | 41 |
| 41 const char* name() const override { return "LayoutScrollbarPart"; } | 42 const char* name() const override { return "LayoutScrollbarPart"; } |
| 42 | 43 |
| 43 PaintLayerType layerTypeRequired() const override { return NoPaintLayer; } | 44 PaintLayerType layerTypeRequired() const override { return NoPaintLayer; } |
| 44 | 45 |
| 45 void layout() override; | 46 void layout() override; |
| 46 | 47 |
| 47 // Scrollbar parts needs to be rendered at device pixel boundaries. | 48 // Scrollbar parts needs to be rendered at device pixel boundaries. |
| 48 LayoutRectOutsets marginBoxOutsets() const override | 49 LayoutRectOutsets marginBoxOutsets() const override |
| (...skipping 29 matching lines...) Expand all Loading... |
| 78 void setStyle(PassRefPtr<ComputedStyle>) = delete; | 79 void setStyle(PassRefPtr<ComputedStyle>) = delete; |
| 79 | 80 |
| 80 LayoutRect visualRect() const override; | 81 LayoutRect visualRect() const override; |
| 81 | 82 |
| 82 protected: | 83 protected: |
| 83 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid
e; | 84 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid
e; |
| 84 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; | 85 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
| 85 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; | 86 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; |
| 86 | 87 |
| 87 private: | 88 private: |
| 88 LayoutScrollbarPart(LayoutScrollbar*, ScrollbarPart); | 89 LayoutScrollbarPart(ScrollableArea*, LayoutScrollbar*, ScrollbarPart); |
| 89 | 90 |
| 90 void computePreferredLogicalWidths() override; | 91 void computePreferredLogicalWidths() override; |
| 91 | 92 |
| 92 // Have all padding getters return 0. The important point here is to avoid r
esolving percents | 93 // Have all padding getters return 0. The important point here is to avoid r
esolving percents |
| 93 // against the containing block, since scroll bar corners don't always have
one (so it would | 94 // against the containing block, since scroll bar corners don't always have
one (so it would |
| 94 // crash). Scroll bar corners are not actually laid out, and they don't have
child content, so | 95 // crash). Scroll bar corners are not actually laid out, and they don't have
child content, so |
| 95 // what we return here doesn't really matter. | 96 // what we return here doesn't really matter. |
| 96 LayoutUnit paddingTop() const override { return LayoutUnit(); } | 97 LayoutUnit paddingTop() const override { return LayoutUnit(); } |
| 97 LayoutUnit paddingBottom() const override { return LayoutUnit(); } | 98 LayoutUnit paddingBottom() const override { return LayoutUnit(); } |
| 98 LayoutUnit paddingLeft() const override { return LayoutUnit(); } | 99 LayoutUnit paddingLeft() const override { return LayoutUnit(); } |
| 99 LayoutUnit paddingRight() const override { return LayoutUnit(); } | 100 LayoutUnit paddingRight() const override { return LayoutUnit(); } |
| 100 LayoutUnit paddingBefore() const override { return LayoutUnit(); } | 101 LayoutUnit paddingBefore() const override { return LayoutUnit(); } |
| 101 LayoutUnit paddingAfter() const override { return LayoutUnit(); } | 102 LayoutUnit paddingAfter() const override { return LayoutUnit(); } |
| 102 LayoutUnit paddingStart() const override { return LayoutUnit(); } | 103 LayoutUnit paddingStart() const override { return LayoutUnit(); } |
| 103 LayoutUnit paddingEnd() const override { return LayoutUnit(); } | 104 LayoutUnit paddingEnd() const override { return LayoutUnit(); } |
| 104 | 105 |
| 105 void layoutHorizontalPart(); | 106 void layoutHorizontalPart(); |
| 106 void layoutVerticalPart(); | 107 void layoutVerticalPart(); |
| 107 | 108 |
| 108 void computeScrollbarWidth(); | 109 void computeScrollbarWidth(); |
| 109 void computeScrollbarHeight(); | 110 void computeScrollbarHeight(); |
| 110 | 111 |
| 111 void setNeedsPaintInvalidation(); | 112 void setNeedsPaintInvalidation(); |
| 112 | 113 |
| 113 bool allowsOverflowClip() const override { return false; } | 114 bool allowsOverflowClip() const override { return false; } |
| 114 | 115 |
| 116 UntracedMember<ScrollableArea> m_scrollableArea; |
| 115 UntracedMember<LayoutScrollbar> m_scrollbar; | 117 UntracedMember<LayoutScrollbar> m_scrollbar; |
| 116 ScrollbarPart m_part; | 118 ScrollbarPart m_part; |
| 117 }; | 119 }; |
| 118 | 120 |
| 119 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutScrollbarPart, isLayoutScrollbarPart()); | 121 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutScrollbarPart, isLayoutScrollbarPart()); |
| 120 | 122 |
| 121 } // namespace blink | 123 } // namespace blink |
| 122 | 124 |
| 123 #endif // LayoutScrollbarPart_h | 125 #endif // LayoutScrollbarPart_h |
| OLD | NEW |