OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 if (visibleRectFlags & EdgeInclusive) { | 522 if (visibleRectFlags & EdgeInclusive) { |
523 if (!rect.inclusiveIntersect(viewRectangle)) | 523 if (!rect.inclusiveIntersect(viewRectangle)) |
524 return false; | 524 return false; |
525 } else { | 525 } else { |
526 rect.intersect(viewRectangle); | 526 rect.intersect(viewRectangle); |
527 } | 527 } |
528 | 528 |
529 // Adjust for scroll offset of the view. | 529 // Adjust for scroll offset of the view. |
530 rect.moveBy(-viewRectangle.location()); | 530 rect.moveBy(-viewRectangle.location()); |
531 } | 531 } |
| 532 // Frames are painted at rounded-int position. Since we cannot efficient
ly compute the subpixel offset |
| 533 // of painting at this point in a a bottom-up walk, round to the enclosi
ng int rect, which will enclose |
| 534 // the actual visible rect. |
| 535 rect = LayoutRect(enclosingIntRect(rect)); |
532 | 536 |
533 // Adjust for frame border. | 537 // Adjust for frame border. |
534 rect.move(obj->contentBoxOffset()); | 538 rect.move(obj->contentBoxOffset()); |
535 return obj->mapToVisibleRectInAncestorSpace(ancestor, rect, visibleRectF
lags); | 539 return obj->mapToVisibleRectInAncestorSpace(ancestor, rect, visibleRectF
lags); |
536 } | 540 } |
537 | 541 |
538 return true; | 542 return true; |
539 } | 543 } |
540 | 544 |
541 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const | 545 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 | 1042 |
1039 ScrollResult LayoutView::scroll(ScrollGranularity granularity, const FloatSize&
delta) | 1043 ScrollResult LayoutView::scroll(ScrollGranularity granularity, const FloatSize&
delta) |
1040 { | 1044 { |
1041 if (!frameView()) | 1045 if (!frameView()) |
1042 return ScrollResult(); | 1046 return ScrollResult(); |
1043 | 1047 |
1044 return frame()->applyScrollDelta(granularity, delta, false); | 1048 return frame()->applyScrollDelta(granularity, delta, false); |
1045 } | 1049 } |
1046 | 1050 |
1047 } // namespace blink | 1051 } // namespace blink |
OLD | NEW |