| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 IntRect RenderScrollbarTheme::forwardButtonRect(ScrollbarThemeClient* scrollbar,
ScrollbarPart partType, bool) | 78 IntRect RenderScrollbarTheme::forwardButtonRect(ScrollbarThemeClient* scrollbar,
ScrollbarPart partType, bool) |
| 79 { | 79 { |
| 80 return toRenderScrollbar(scrollbar)->buttonRect(partType); | 80 return toRenderScrollbar(scrollbar)->buttonRect(partType); |
| 81 } | 81 } |
| 82 | 82 |
| 83 IntRect RenderScrollbarTheme::trackRect(ScrollbarThemeClient* scrollbar, bool) | 83 IntRect RenderScrollbarTheme::trackRect(ScrollbarThemeClient* scrollbar, bool) |
| 84 { | 84 { |
| 85 if (!hasButtons(scrollbar)) | 85 if (!hasButtons(scrollbar)) |
| 86 return scrollbar->frameRect(); | 86 return scrollbar->frameRect(); |
| 87 | 87 |
| 88 int startLength; | 88 int startLength; |
| 89 int endLength; | 89 int endLength; |
| 90 buttonSizesAlongTrackAxis(scrollbar, startLength, endLength); | 90 buttonSizesAlongTrackAxis(scrollbar, startLength, endLength); |
| 91 | 91 |
| 92 return toRenderScrollbar(scrollbar)->trackRect(startLength, endLength); | 92 return toRenderScrollbar(scrollbar)->trackRect(startLength, endLength); |
| 93 } | 93 } |
| 94 | 94 |
| 95 IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(ScrollbarThemeClie
nt* scrollbar, const IntRect& rect) | 95 IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(ScrollbarThemeClie
nt* scrollbar, const IntRect& rect) |
| 96 { | 96 { |
| 97 IntRect backRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(B
ackTrackPart, rect); | 97 IntRect backRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(B
ackTrackPart, rect); |
| 98 IntRect forwardRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargin
s(ForwardTrackPart, rect); | 98 IntRect forwardRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargin
s(ForwardTrackPart, rect); |
| 99 IntRect result = rect; | 99 IntRect result = rect; |
| 100 if (scrollbar->orientation() == HorizontalScrollbar) { | 100 if (scrollbar->orientation() == HorizontalScrollbar) { |
| 101 result.setX(backRect.x()); | 101 result.setX(backRect.x()); |
| 102 result.setWidth(forwardRect.maxX() - backRect.x()); | 102 result.setWidth(forwardRect.maxX() - backRect.x()); |
| 103 } else { | 103 } else { |
| 104 result.setY(backRect.y()); | 104 result.setY(backRect.y()); |
| 105 result.setHeight(forwardRect.maxY() - backRect.y()); | 105 result.setHeight(forwardRect.maxY() - backRect.y()); |
| 106 } | 106 } |
| 107 return result; | 107 return result; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void RenderScrollbarTheme::paintScrollCorner(ScrollView*, GraphicsContext* conte
xt, const IntRect& cornerRect) | 110 void RenderScrollbarTheme::paintScrollCorner(ScrollView*, GraphicsContext* conte
xt, const IntRect& cornerRect) |
| 111 { | 111 { |
| 112 // FIXME: Implement. | 112 // FIXME: Implement. |
| 113 context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); | 113 context->fillRect(cornerRect, Color::white); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext* context, Sc
rollbarThemeClient* scrollbar) | 116 void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext* context, Sc
rollbarThemeClient* scrollbar) |
| 117 { | 117 { |
| 118 toRenderScrollbar(scrollbar)->paintPart(context, ScrollbarBGPart, scrollbar-
>frameRect()); | 118 toRenderScrollbar(scrollbar)->paintPart(context, ScrollbarBGPart, scrollbar-
>frameRect()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void RenderScrollbarTheme::paintTrackBackground(GraphicsContext* context, Scroll
barThemeClient* scrollbar, const IntRect& rect) | 121 void RenderScrollbarTheme::paintTrackBackground(GraphicsContext* context, Scroll
barThemeClient* scrollbar, const IntRect& rect) |
| 122 { | 122 { |
| 123 toRenderScrollbar(scrollbar)->paintPart(context, TrackBGPart, rect); | 123 toRenderScrollbar(scrollbar)->paintPart(context, TrackBGPart, rect); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 137 { | 137 { |
| 138 toRenderScrollbar(scrollbar)->paintPart(context, ThumbPart, rect); | 138 toRenderScrollbar(scrollbar)->paintPart(context, ThumbPart, rect); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void RenderScrollbarTheme::paintTickmarks(GraphicsContext* context, ScrollbarThe
meClient* scrollbar, const IntRect& rect) | 141 void RenderScrollbarTheme::paintTickmarks(GraphicsContext* context, ScrollbarThe
meClient* scrollbar, const IntRect& rect) |
| 142 { | 142 { |
| 143 ScrollbarTheme::theme()->paintTickmarks(context, scrollbar, rect); | 143 ScrollbarTheme::theme()->paintTickmarks(context, scrollbar, rect); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } | 146 } |
| OLD | NEW |