| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 473 |
| 474 if (compositor()->inCompositingMode()) | 474 if (compositor()->inCompositingMode()) |
| 475 compositor()->fullyInvalidatePaint(); | 475 compositor()->fullyInvalidatePaint(); |
| 476 } | 476 } |
| 477 | 477 |
| 478 void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc
estor, LayoutRect& rect, const PaintInvalidationState* invalidationState) const | 478 void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc
estor, LayoutRect& rect, const PaintInvalidationState* invalidationState) const |
| 479 { | 479 { |
| 480 mapToVisibleRectInAncestorSpace(ancestor, rect, IsNotFixedPosition, invalida
tionState); | 480 mapToVisibleRectInAncestorSpace(ancestor, rect, IsNotFixedPosition, invalida
tionState); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc
estor, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, const P
aintInvalidationState* state) const | 483 void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc
estor, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, |
| 484 const PaintInvalidationState* paintInvalidationState) const |
| 484 { | 485 { |
| 485 if (document().printing()) | 486 if (document().printing()) |
| 486 return; | 487 return; |
| 487 | 488 |
| 489 // TODO(chrishtr): fix PaintInvalidationState offsets for LayoutViews. |
| 490 |
| 488 if (style()->isFlippedBlocksWritingMode()) { | 491 if (style()->isFlippedBlocksWritingMode()) { |
| 489 // We have to flip by hand since the view's logical height has not been
determined. We | 492 // We have to flip by hand since the view's logical height has not been
determined. We |
| 490 // can use the viewport width and height. | 493 // can use the viewport width and height. |
| 491 if (style()->isHorizontalWritingMode()) | 494 if (style()->isHorizontalWritingMode()) |
| 492 rect.setY(viewHeight() - rect.maxY()); | 495 rect.setY(viewHeight() - rect.maxY()); |
| 493 else | 496 else |
| 494 rect.setX(viewWidth() - rect.maxX()); | 497 rect.setX(viewWidth() - rect.maxX()); |
| 495 } | 498 } |
| 496 | 499 |
| 497 adjustViewportConstrainedOffset(rect, viewportConstraint); | 500 adjustViewportConstrainedOffset(rect, viewportConstraint); |
| 498 | 501 |
| 499 // Apply our transform if we have one (because of full page zooming). | 502 // Apply our transform if we have one (because of full page zooming). |
| 500 if (!ancestor && layer() && layer()->transform()) | 503 if (!ancestor && layer() && layer()->transform()) |
| 501 rect = layer()->transform()->mapRect(rect); | 504 rect = layer()->transform()->mapRect(rect); |
| 502 | 505 |
| 503 ASSERT(ancestor); | 506 ASSERT(ancestor); |
| 504 if (ancestor == this) | 507 if (ancestor == this) |
| 505 return; | 508 return; |
| 506 | 509 |
| 507 Element* owner = document().ownerElement(); | 510 Element* owner = document().ownerElement(); |
| 508 if (!owner) | 511 if (!owner) |
| 509 return; | 512 return; |
| 510 | 513 |
| 511 if (LayoutBox* obj = owner->layoutBox()) { | 514 if (LayoutBox* obj = owner->layoutBox()) { |
| 512 if (!state || !state->viewClippingAndScrollOffsetDisabled()) { | 515 if (!paintInvalidationState || !paintInvalidationState->viewClippingAndS
crollOffsetDisabled()) { |
| 513 // Intersect the viewport with the paint invalidation rect. | 516 // Intersect the viewport with the paint invalidation rect. |
| 514 LayoutRect viewRectangle = viewRect(); | 517 LayoutRect viewRectangle = viewRect(); |
| 515 rect.intersect(viewRectangle); | 518 rect.intersect(viewRectangle); |
| 516 | 519 |
| 517 // Adjust for scroll offset of the view. | 520 // Adjust for scroll offset of the view. |
| 518 rect.moveBy(-viewRectangle.location()); | 521 rect.moveBy(-viewRectangle.location()); |
| 519 } | 522 } |
| 520 | 523 |
| 521 // Adjust for frame border. | 524 // Adjust for frame border. |
| 522 rect.move(obj->contentBoxOffset()); | 525 rect.move(obj->contentBoxOffset()); |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 | 1030 |
| 1028 ScrollResult LayoutView::scroll(ScrollGranularity granularity, const FloatSize&
delta) | 1031 ScrollResult LayoutView::scroll(ScrollGranularity granularity, const FloatSize&
delta) |
| 1029 { | 1032 { |
| 1030 if (!frameView()) | 1033 if (!frameView()) |
| 1031 return ScrollResult(); | 1034 return ScrollResult(); |
| 1032 | 1035 |
| 1033 return frame()->applyScrollDelta(granularity, delta, false); | 1036 return frame()->applyScrollDelta(granularity, delta, false); |
| 1034 } | 1037 } |
| 1035 | 1038 |
| 1036 } // namespace blink | 1039 } // namespace blink |
| OLD | NEW |