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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 years 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
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } else { 113 } else {
114 setWidth(m_scrollbar->width()); 114 setWidth(m_scrollbar->width());
115 computeScrollbarHeight(); 115 computeScrollbarHeight();
116 } 116 }
117 } 117 }
118 118
119 static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength) 119 static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength)
120 { 120 {
121 if (!length.isIntrinsicOrAuto() || (sizeType == MinSize && length.isAuto())) 121 if (!length.isIntrinsicOrAuto() || (sizeType == MinSize && length.isAuto()))
122 return minimumValueForLength(length, containingLength); 122 return minimumValueForLength(length, containingLength);
123 return ScrollbarTheme::theme()->scrollbarThickness(); 123 return ScrollbarTheme::theme().scrollbarThickness();
124 } 124 }
125 125
126 void LayoutScrollbarPart::computeScrollbarWidth() 126 void LayoutScrollbarPart::computeScrollbarWidth()
127 { 127 {
128 if (!m_scrollbar->owningLayoutObject()) 128 if (!m_scrollbar->owningLayoutObject())
129 return; 129 return;
130 // FIXME: We are querying layout information but nothing guarantees that it' s up-to-date, especially since we are called at style change. 130 // FIXME: We are querying layout information but nothing guarantees that it' s up-to-date, especially since we are called at style change.
131 // FIXME: Querying the style's border information doesn't work on table cell s with collapsing borders. 131 // FIXME: Querying the style's border information doesn't work on table cell s with collapsing borders.
132 int visibleSize = m_scrollbar->owningLayoutObject()->size().width() - m_scro llbar->owningLayoutObject()->style()->borderLeftWidth() - m_scrollbar->owningLay outObject()->style()->borderRightWidth(); 132 int visibleSize = m_scrollbar->owningLayoutObject()->size().width() - m_scro llbar->owningLayoutObject()->style()->borderLeftWidth() - m_scrollbar->owningLay outObject()->style()->borderRightWidth();
133 int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->width(), v isibleSize); 133 int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->width(), v isibleSize);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 frameView->setScrollCornerNeedsPaintInvalidation(); 209 frameView->setScrollCornerNeedsPaintInvalidation();
210 return; 210 return;
211 } 211 }
212 } 212 }
213 213
214 // This LayoutScrollbarPart belongs to a PaintLayerScrollableArea. 214 // This LayoutScrollbarPart belongs to a PaintLayerScrollableArea.
215 toLayoutBox(parent())->scrollableArea()->setScrollCornerNeedsPaintInvalidati on(); 215 toLayoutBox(parent())->scrollableArea()->setScrollCornerNeedsPaintInvalidati on();
216 } 216 }
217 217
218 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698