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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 8 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 { 255 {
256 Page* page = box().frame()->page(); 256 Page* page = box().frame()->page();
257 return page && page->focusController().isActive(); 257 return page && page->focusController().isActive();
258 } 258 }
259 259
260 bool DeprecatedPaintLayerScrollableArea::isScrollCornerVisible() const 260 bool DeprecatedPaintLayerScrollableArea::isScrollCornerVisible() const
261 { 261 {
262 return !scrollCornerRect().isEmpty(); 262 return !scrollCornerRect().isEmpty();
263 } 263 }
264 264
265 static int cornerStart(const LayoutStyle& style, int minX, int maxX, int thickne ss) 265 static int cornerStart(const ComputedStyle& style, int minX, int maxX, int thick ness)
266 { 266 {
267 if (style.shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 267 if (style.shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
268 return minX + style.borderLeftWidth(); 268 return minX + style.borderLeftWidth();
269 return maxX - thickness - style.borderRightWidth(); 269 return maxX - thickness - style.borderRightWidth();
270 } 270 }
271 271
272 static IntRect cornerRect(const LayoutStyle& style, const Scrollbar* horizontalS crollbar, const Scrollbar* verticalScrollbar, const IntRect& bounds) 272 static IntRect cornerRect(const ComputedStyle& style, const Scrollbar* horizonta lScrollbar, const Scrollbar* verticalScrollbar, const IntRect& bounds)
273 { 273 {
274 int horizontalThickness; 274 int horizontalThickness;
275 int verticalThickness; 275 int verticalThickness;
276 if (!verticalScrollbar && !horizontalScrollbar) { 276 if (!verticalScrollbar && !horizontalScrollbar) {
277 // FIXME: This isn't right. We need to know the thickness of custom scro llbars 277 // FIXME: This isn't right. We need to know the thickness of custom scro llbars
278 // even when they don't exist in order to set the resizer square size pr operly. 278 // even when they don't exist in order to set the resizer square size pr operly.
279 horizontalThickness = ScrollbarTheme::theme()->scrollbarThickness(); 279 horizontalThickness = ScrollbarTheme::theme()->scrollbarThickness();
280 verticalThickness = horizontalThickness; 280 verticalThickness = horizontalThickness;
281 } else if (verticalScrollbar && !horizontalScrollbar) { 281 } else if (verticalScrollbar && !horizontalScrollbar) {
282 horizontalThickness = verticalScrollbar->width(); 282 horizontalThickness = verticalScrollbar->width();
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 // opposed to the 'viewport' scrollbars managed by the DeprecatedPaintLayerCompo sitor). 768 // opposed to the 'viewport' scrollbars managed by the DeprecatedPaintLayerCompo sitor).
769 // FIXME: we should use the same scrolling machinery for both the viewport and 769 // FIXME: we should use the same scrolling machinery for both the viewport and
770 // overflow. Currently, we need to avoid producing scrollbars here if they'll be 770 // overflow. Currently, we need to avoid producing scrollbars here if they'll be
771 // handled externally in the RLC. 771 // handled externally in the RLC.
772 static bool canHaveOverflowScrollbars(const LayoutBox& box) 772 static bool canHaveOverflowScrollbars(const LayoutBox& box)
773 { 773 {
774 bool rootLayerScrolls = box.document().settings() && box.document().settings ()->rootLayerScrolls(); 774 bool rootLayerScrolls = box.document().settings() && box.document().settings ()->rootLayerScrolls();
775 return (rootLayerScrolls || !box.isLayoutView()) && box.document().viewportD efiningElement() != box.node(); 775 return (rootLayerScrolls || !box.isLayoutView()) && box.document().viewportD efiningElement() != box.node();
776 } 776 }
777 777
778 void DeprecatedPaintLayerScrollableArea::updateAfterStyleChange(const LayoutStyl e* oldStyle) 778 void DeprecatedPaintLayerScrollableArea::updateAfterStyleChange(const ComputedSt yle* oldStyle)
779 { 779 {
780 if (!m_scrollDimensionsDirty) 780 if (!m_scrollDimensionsDirty)
781 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow()); 781 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow());
782 782
783 if (!canHaveOverflowScrollbars(box())) 783 if (!canHaveOverflowScrollbars(box()))
784 return; 784 return;
785 785
786 EOverflow overflowX = box().style()->overflowX(); 786 EOverflow overflowX = box().style()->overflowX();
787 EOverflow overflowY = box().style()->overflowY(); 787 EOverflow overflowY = box().style()->overflowY();
788 788
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 } 1052 }
1053 1053
1054 void DeprecatedPaintLayerScrollableArea::updateScrollCornerStyle() 1054 void DeprecatedPaintLayerScrollableArea::updateScrollCornerStyle()
1055 { 1055 {
1056 if (!m_scrollCorner && !hasScrollbar()) 1056 if (!m_scrollCorner && !hasScrollbar())
1057 return; 1057 return;
1058 if (!m_scrollCorner && hasOverlayScrollbars()) 1058 if (!m_scrollCorner && hasOverlayScrollbars())
1059 return; 1059 return;
1060 1060
1061 LayoutObject* actualRenderer = rendererForScrollbar(box()); 1061 LayoutObject* actualRenderer = rendererForScrollbar(box());
1062 RefPtr<LayoutStyle> corner = box().hasOverflowClip() ? actualRenderer->getUn cachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()) : PassRefPtr<LayoutStyle>(nullptr); 1062 RefPtr<ComputedStyle> corner = box().hasOverflowClip() ? actualRenderer->get UncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style( )) : PassRefPtr<ComputedStyle>(nullptr);
1063 if (corner) { 1063 if (corner) {
1064 if (!m_scrollCorner) { 1064 if (!m_scrollCorner) {
1065 m_scrollCorner = LayoutScrollbarPart::createAnonymous(&box().documen t()); 1065 m_scrollCorner = LayoutScrollbarPart::createAnonymous(&box().documen t());
1066 m_scrollCorner->setParent(&box()); 1066 m_scrollCorner->setParent(&box());
1067 } 1067 }
1068 m_scrollCorner->setStyle(corner.release()); 1068 m_scrollCorner->setStyle(corner.release());
1069 } else if (m_scrollCorner) { 1069 } else if (m_scrollCorner) {
1070 m_scrollCorner->destroy(); 1070 m_scrollCorner->destroy();
1071 m_scrollCorner = nullptr; 1071 m_scrollCorner = nullptr;
1072 } 1072 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 else 1180 else
1181 frameView->removeResizerArea(box()); 1181 frameView->removeResizerArea(box());
1182 } 1182 }
1183 1183
1184 void DeprecatedPaintLayerScrollableArea::updateResizerStyle() 1184 void DeprecatedPaintLayerScrollableArea::updateResizerStyle()
1185 { 1185 {
1186 if (!m_resizer && !box().canResize()) 1186 if (!m_resizer && !box().canResize())
1187 return; 1187 return;
1188 1188
1189 LayoutObject* actualRenderer = rendererForScrollbar(box()); 1189 LayoutObject* actualRenderer = rendererForScrollbar(box());
1190 RefPtr<LayoutStyle> resizer = box().hasOverflowClip() ? actualRenderer->getU ncachedPseudoStyle(PseudoStyleRequest(RESIZER), actualRenderer->style()) : PassR efPtr<LayoutStyle>(nullptr); 1190 RefPtr<ComputedStyle> resizer = box().hasOverflowClip() ? actualRenderer->ge tUncachedPseudoStyle(PseudoStyleRequest(RESIZER), actualRenderer->style()) : Pas sRefPtr<ComputedStyle>(nullptr);
1191 if (resizer) { 1191 if (resizer) {
1192 if (!m_resizer) { 1192 if (!m_resizer) {
1193 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document()); 1193 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document());
1194 m_resizer->setParent(&box()); 1194 m_resizer->setParent(&box());
1195 } 1195 }
1196 m_resizer->setStyle(resizer.release()); 1196 m_resizer->setStyle(resizer.release());
1197 } else if (m_resizer) { 1197 } else if (m_resizer) {
1198 m_resizer->destroy(); 1198 m_resizer->destroy();
1199 m_resizer = nullptr; 1199 m_resizer = nullptr;
1200 } 1200 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 void DeprecatedPaintLayerScrollableArea::setTopmostScrollChild(DeprecatedPaintLa yer* scrollChild) 1386 void DeprecatedPaintLayerScrollableArea::setTopmostScrollChild(DeprecatedPaintLa yer* scrollChild)
1387 { 1387 {
1388 // We only want to track the topmost scroll child for scrollable areas with 1388 // We only want to track the topmost scroll child for scrollable areas with
1389 // overlay scrollbars. 1389 // overlay scrollbars.
1390 if (!hasOverlayScrollbars()) 1390 if (!hasOverlayScrollbars())
1391 return; 1391 return;
1392 m_nextTopmostScrollChild = scrollChild; 1392 m_nextTopmostScrollChild = scrollChild;
1393 } 1393 }
1394 1394
1395 } // namespace blink 1395 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerScrollableArea.h ('k') | Source/core/paint/DeprecatedPaintLayerStackingNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698