OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); | 428 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); |
429 } | 429 } |
430 | 430 |
431 LayoutUnit LayoutBox::scrollWidth() const | 431 LayoutUnit LayoutBox::scrollWidth() const |
432 { | 432 { |
433 if (hasOverflowClip()) | 433 if (hasOverflowClip()) |
434 return layer()->scrollableArea()->scrollWidth(); | 434 return layer()->scrollableArea()->scrollWidth(); |
435 // For objects with visible overflow, this matches IE. | 435 // For objects with visible overflow, this matches IE. |
436 // FIXME: Need to work right with writing modes. | 436 // FIXME: Need to work right with writing modes. |
437 if (style()->isLeftToRightDirection()) | 437 if (style()->isLeftToRightDirection()) |
438 return std::max(clientWidth(), layoutOverflowRect().maxX() - borderLeft( )); | 438 return std::max(clientWidth(), static_cast<LayoutUnit>((layoutOverflowRe ct().maxX() - borderLeft()))); |
439 return clientWidth() - std::min(LayoutUnit(), layoutOverflowRect().x() - bor derLeft()); | 439 return clientWidth() - std::min(LayoutUnit(), static_cast<LayoutUnit>((layou tOverflowRect().x() - borderLeft()))); |
440 } | 440 } |
441 | 441 |
442 LayoutUnit LayoutBox::scrollHeight() const | 442 LayoutUnit LayoutBox::scrollHeight() const |
443 { | 443 { |
444 if (hasOverflowClip()) | 444 if (hasOverflowClip()) |
445 return layer()->scrollableArea()->scrollHeight(); | 445 return layer()->scrollableArea()->scrollHeight(); |
446 // For objects with visible overflow, this matches IE. | 446 // For objects with visible overflow, this matches IE. |
447 // FIXME: Need to work right with writing modes. | 447 // FIXME: Need to work right with writing modes. |
448 return std::max(clientHeight(), layoutOverflowRect().maxY() - borderTop()); | 448 return std::max(clientHeight(), static_cast<LayoutUnit>((layoutOverflowRect( ).maxY() - borderTop()))); |
alancutter (OOO until 2018)
2016/01/20 06:06:23
Use LayoutUnit() instead of static_cast<LayoutUnit
| |
449 } | 449 } |
450 | 450 |
451 LayoutUnit LayoutBox::scrollLeft() const | 451 LayoutUnit LayoutBox::scrollLeft() const |
452 { | 452 { |
453 return hasOverflowClip() ? layer()->scrollableArea()->scrollXOffset() : 0; | 453 return hasOverflowClip() ? layer()->scrollableArea()->scrollXOffset() : 0; |
454 } | 454 } |
455 | 455 |
456 LayoutUnit LayoutBox::scrollTop() const | 456 LayoutUnit LayoutBox::scrollTop() const |
457 { | 457 { |
458 return hasOverflowClip() ? layer()->scrollableArea()->scrollYOffset() : 0; | 458 return hasOverflowClip() ? layer()->scrollableArea()->scrollYOffset() : 0; |
(...skipping 4445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4904 } | 4904 } |
4905 | 4905 |
4906 void LayoutBox::clearPreviousPaintInvalidationRects() | 4906 void LayoutBox::clearPreviousPaintInvalidationRects() |
4907 { | 4907 { |
4908 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); | 4908 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); |
4909 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) | 4909 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) |
4910 scrollableArea->clearPreviousPaintInvalidationRects(); | 4910 scrollableArea->clearPreviousPaintInvalidationRects(); |
4911 } | 4911 } |
4912 | 4912 |
4913 } // namespace blink | 4913 } // namespace blink |
OLD | NEW |