| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 LayoutFlexibleBox::layout(); | 122 LayoutFlexibleBox::layout(); |
| 123 | 123 |
| 124 mutableStyleRef().setDirection(oldTextDirection); | 124 mutableStyleRef().setDirection(oldTextDirection); |
| 125 // These should always exist, unless someone mutates the shadow DOM (e.g., i
n the inspector). | 125 // These should always exist, unless someone mutates the shadow DOM (e.g., i
n the inspector). |
| 126 if (!thumb || !track) | 126 if (!thumb || !track) |
| 127 return; | 127 return; |
| 128 | 128 |
| 129 double percentageOffset = sliderPosition(input).toDouble(); | 129 double percentageOffset = sliderPosition(input).toDouble(); |
| 130 LayoutUnit availableExtent = isVertical ? track->contentHeight() : track->co
ntentWidth(); | 130 LayoutUnit availableExtent = isVertical ? track->contentHeight() : track->co
ntentWidth(); |
| 131 availableExtent -= isVertical ? thumb->size().height() : thumb->size().width
(); | 131 availableExtent -= isVertical ? thumb->size().height() : thumb->size().width
(); |
| 132 LayoutUnit offset = percentageOffset * availableExtent; | 132 LayoutUnit offset(percentageOffset * availableExtent); |
| 133 LayoutPoint thumbLocation = thumb->location(); | 133 LayoutPoint thumbLocation = thumb->location(); |
| 134 if (isVertical) | 134 if (isVertical) |
| 135 thumbLocation.setY(thumbLocation.y() + track->contentHeight() - thumb->s
ize().height() - offset); | 135 thumbLocation.setY(thumbLocation.y() + track->contentHeight() - thumb->s
ize().height() - offset); |
| 136 else if (style()->isLeftToRightDirection()) | 136 else if (style()->isLeftToRightDirection()) |
| 137 thumbLocation.setX(thumbLocation.x() + offset); | 137 thumbLocation.setX(thumbLocation.x() + offset); |
| 138 else | 138 else |
| 139 thumbLocation.setX(thumbLocation.x() - offset); | 139 thumbLocation.setX(thumbLocation.x() - offset); |
| 140 thumb->setLocation(thumbLocation); | 140 thumb->setLocation(thumbLocation); |
| 141 | 141 |
| 142 // We need one-off invalidation code here because painting of the timeline e
lement does not go through style. | 142 // We need one-off invalidation code here because painting of the timeline e
lement does not go through style. |
| 143 // Instead it has a custom implementation in C++ code. | 143 // Instead it has a custom implementation in C++ code. |
| 144 // Therefore the style system cannot understand when it needs to be paint in
validated. | 144 // Therefore the style system cannot understand when it needs to be paint in
validated. |
| 145 setShouldDoFullPaintInvalidation(); | 145 setShouldDoFullPaintInvalidation(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace blink | 148 } // namespace blink |
| OLD | NEW |