OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. | 2 * Copyright (C) 2009 Apple Inc. |
3 * Copyright (C) 2009 Google Inc. | 3 * Copyright (C) 2009 Google Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 int startOffset = startPosition; | 149 int startOffset = startPosition; |
150 int endOffset = rect.width() - endPosition; | 150 int endOffset = rect.width() - endPosition; |
151 int rangeWidth = endPosition - startPosition; | 151 int rangeWidth = endPosition - startPosition; |
152 | 152 |
153 if (rangeWidth <= 0) | 153 if (rangeWidth <= 0) |
154 return; | 154 return; |
155 | 155 |
156 // Make sure the range width is bigger than border radius at the edges to re
tain rounded corners. | 156 // Make sure the range width is bigger than border radius at the edges to re
tain rounded corners. |
157 if (startOffset < borderRadius && rangeWidth < borderRadius) | 157 if (startOffset < borderRadius && rangeWidth < borderRadius) |
158 rangeWidth = borderRadius; | 158 rangeWidth = borderRadius; |
159 if (endOffset < borderRadius && rangeWidth < borderRadius) { | 159 if (endOffset < borderRadius && rangeWidth < borderRadius) |
160 startPosition -= borderRadius - rangeWidth; | |
161 rangeWidth = borderRadius; | 160 rangeWidth = borderRadius; |
162 } | |
163 | 161 |
164 // Set rectangle to highlight range. | 162 // Set rectangle to highlight range. |
165 IntRect highlightRect = rect; | 163 IntRect highlightRect = rect; |
166 highlightRect.move(startOffset, 0); | 164 highlightRect.move(startOffset, 0); |
167 highlightRect.setWidth(rangeWidth); | 165 highlightRect.setWidth(rangeWidth); |
168 | 166 |
169 // Don't bother drawing an empty area. | 167 // Don't bother drawing an empty area. |
170 if (highlightRect.isEmpty()) | 168 if (highlightRect.isEmpty()) |
171 return; | 169 return; |
172 | 170 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 { | 441 { |
444 return formatChromiumMediaControlsTime(time, time); | 442 return formatChromiumMediaControlsTime(time, time); |
445 } | 443 } |
446 | 444 |
447 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl
oat duration) | 445 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl
oat duration) |
448 { | 446 { |
449 return formatChromiumMediaControlsTime(currentTime, duration); | 447 return formatChromiumMediaControlsTime(currentTime, duration); |
450 } | 448 } |
451 | 449 |
452 } // namespace WebCore | 450 } // namespace WebCore |
OLD | NEW |