Changeset 158163 in webkit for trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp
- Timestamp:
- Oct 28, 2013, 7:58:43 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp
r158097 r158163 96 96 // FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change. 97 97 // FIXME: Querying the style's border information doesn't work on table cells with collapsing borders. 98 int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->style() ->borderLeftWidth() - m_scrollbar->owningRenderer()->style()->borderRightWidth();99 int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style() ->width(), visibleSize, renderView);100 int minWidth = calcScrollbarThicknessUsing(MinSize, style() ->minWidth(), visibleSize, renderView);101 int maxWidth = style() ->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style()->maxWidth(), visibleSize, renderView);98 int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->style().borderLeftWidth() - m_scrollbar->owningRenderer()->style().borderRightWidth(); 99 int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style().width(), visibleSize, renderView); 100 int minWidth = calcScrollbarThicknessUsing(MinSize, style().minWidth(), visibleSize, renderView); 101 int maxWidth = style().maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style().maxWidth(), visibleSize, renderView); 102 102 setWidth(max(minWidth, min(maxWidth, w))); 103 103 104 104 // Buttons and track pieces can all have margins along the axis of the scrollbar. 105 m_marginBox.setLeft(minimumValueForLength(style() ->marginLeft(), visibleSize, renderView));106 m_marginBox.setRight(minimumValueForLength(style() ->marginRight(), visibleSize, renderView));105 m_marginBox.setLeft(minimumValueForLength(style().marginLeft(), visibleSize, renderView)); 106 m_marginBox.setRight(minimumValueForLength(style().marginRight(), visibleSize, renderView)); 107 107 } 108 108 … … 114 114 // FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change. 115 115 // FIXME: Querying the style's border information doesn't work on table cells with collapsing borders. 116 int visibleSize = m_scrollbar->owningRenderer()->height() - m_scrollbar->owningRenderer()->style() ->borderTopWidth() - m_scrollbar->owningRenderer()->style()->borderBottomWidth();117 int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style() ->height(), visibleSize, renderView);118 int minHeight = calcScrollbarThicknessUsing(MinSize, style() ->minHeight(), visibleSize, renderView);119 int maxHeight = style() ->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style()->maxHeight(), visibleSize, renderView);116 int visibleSize = m_scrollbar->owningRenderer()->height() - m_scrollbar->owningRenderer()->style().borderTopWidth() - m_scrollbar->owningRenderer()->style().borderBottomWidth(); 117 int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style().height(), visibleSize, renderView); 118 int minHeight = calcScrollbarThicknessUsing(MinSize, style().minHeight(), visibleSize, renderView); 119 int maxHeight = style().maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style().maxHeight(), visibleSize, renderView); 120 120 setHeight(max(minHeight, min(maxHeight, h))); 121 121 122 122 // Buttons and track pieces can all have margins along the axis of the scrollbar. 123 m_marginBox.setTop(minimumValueForLength(style() ->marginTop(), visibleSize, renderView));124 m_marginBox.setBottom(minimumValueForLength(style() ->marginBottom(), visibleSize, renderView));123 m_marginBox.setTop(minimumValueForLength(style().marginTop(), visibleSize, renderView)); 124 m_marginBox.setBottom(minimumValueForLength(style().marginBottom(), visibleSize, renderView)); 125 125 } 126 126 … … 167 167 setHeight(rect.height()); 168 168 169 if (graphicsContext->paintingDisabled() || !style() ->opacity())169 if (graphicsContext->paintingDisabled() || !style().opacity()) 170 170 return; 171 171 172 172 // We don't use RenderLayers for scrollbar parts, so we need to handle opacity here. 173 173 // Opacity for ScrollbarBGPart is handled by RenderScrollbarTheme::willPaintScrollbar(). 174 bool needsTransparencyLayer = m_part != ScrollbarBGPart && style() ->opacity() < 1;174 bool needsTransparencyLayer = m_part != ScrollbarBGPart && style().opacity() < 1; 175 175 if (needsTransparencyLayer) { 176 176 graphicsContext->save(); 177 177 graphicsContext->clip(rect); 178 graphicsContext->beginTransparencyLayer(style() ->opacity());178 graphicsContext->beginTransparencyLayer(style().opacity()); 179 179 } 180 180
Note:
See TracChangeset
for help on using the changeset viewer.