| 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. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // Ditto when not in compositing mode. | 311 // Ditto when not in compositing mode. |
| 312 if (!usesCompositing()) | 312 if (!usesCompositing()) |
| 313 return LayoutBlockFlow::visualOverflowRect(); | 313 return LayoutBlockFlow::visualOverflowRect(); |
| 314 | 314 |
| 315 // In normal compositing mode, LayoutView doesn't actually apply clipping | 315 // In normal compositing mode, LayoutView doesn't actually apply clipping |
| 316 // on its descendants. Instead their visual overflow is propagated to | 316 // on its descendants. Instead their visual overflow is propagated to |
| 317 // compositor()->m_rootContentLayer for accelerated scrolling. | 317 // compositor()->m_rootContentLayer for accelerated scrolling. |
| 318 return layoutOverflowRect(); | 318 return layoutOverflowRect(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 LayoutRect LayoutView::localOverflowRectForPaintInvalidation() const { | 321 LayoutRect LayoutView::localVisualRect() const { |
| 322 // TODO(wangxianzhu): This is only required without rootLayerScrolls (though | 322 // TODO(wangxianzhu): This is only required without rootLayerScrolls (though |
| 323 // it is also correct but unnecessary with rootLayerScrolls) because of the | 323 // it is also correct but unnecessary with rootLayerScrolls) because of the |
| 324 // special LayoutView overflow model. | 324 // special LayoutView overflow model. |
| 325 return visualOverflowRect(); | 325 return visualOverflowRect(); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, | 328 void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, |
| 329 TransformState& transformState, | 329 TransformState& transformState, |
| 330 MapCoordinatesFlags mode) const { | 330 MapCoordinatesFlags mode) const { |
| 331 if (!ancestor && mode & UseTransforms && shouldUseTransformFromContainer(0)) { | 331 if (!ancestor && mode & UseTransforms && shouldUseTransformFromContainer(0)) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 ASSERT(ancestor); | 479 ASSERT(ancestor); |
| 480 if (ancestor == this) | 480 if (ancestor == this) |
| 481 return true; | 481 return true; |
| 482 | 482 |
| 483 Element* owner = document().localOwner(); | 483 Element* owner = document().localOwner(); |
| 484 if (!owner) | 484 if (!owner) |
| 485 return true; | 485 return true; |
| 486 | 486 |
| 487 if (LayoutBox* obj = owner->layoutBox()) { | 487 if (LayoutBox* obj = owner->layoutBox()) { |
| 488 if (!(mode & InputIsInFrameCoordinates)) { | 488 if (!(mode & InputIsInFrameCoordinates)) { |
| 489 // Intersect the viewport with the paint invalidation rect. | 489 // Intersect the viewport with the visual rect. |
| 490 LayoutRect viewRectangle = viewRect(); | 490 LayoutRect viewRectangle = viewRect(); |
| 491 if (visualRectFlags & EdgeInclusive) { | 491 if (visualRectFlags & EdgeInclusive) { |
| 492 if (!rect.inclusiveIntersect(viewRectangle)) | 492 if (!rect.inclusiveIntersect(viewRectangle)) |
| 493 return false; | 493 return false; |
| 494 } else { | 494 } else { |
| 495 rect.intersect(viewRectangle); | 495 rect.intersect(viewRectangle); |
| 496 } | 496 } |
| 497 | 497 |
| 498 // Adjust for scroll offset of the view. | 498 // Adjust for scroll offset of the view. |
| 499 rect.moveBy(-viewRectangle.location()); | 499 rect.moveBy(-viewRectangle.location()); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 // Objects each have a single selection rect to examine. | 671 // Objects each have a single selection rect to examine. |
| 672 typedef HashMap<LayoutObject*, SelectionState> SelectedObjectMap; | 672 typedef HashMap<LayoutObject*, SelectionState> SelectedObjectMap; |
| 673 SelectedObjectMap oldSelectedObjects; | 673 SelectedObjectMap oldSelectedObjects; |
| 674 // FIXME: |newSelectedObjects| doesn't really need to store the | 674 // FIXME: |newSelectedObjects| doesn't really need to store the |
| 675 // SelectionState, it's just more convenient to have it use the same data | 675 // SelectionState, it's just more convenient to have it use the same data |
| 676 // structure as |oldSelectedObjects|. | 676 // structure as |oldSelectedObjects|. |
| 677 SelectedObjectMap newSelectedObjects; | 677 SelectedObjectMap newSelectedObjects; |
| 678 | 678 |
| 679 // Blocks contain selected objects and fill gaps between them, either on the | 679 // Blocks contain selected objects and fill gaps between them, either on the |
| 680 // left, right, or in between lines and blocks. | 680 // left, right, or in between lines and blocks. |
| 681 // In order to get the paint invalidation rect right, we have to examine left, | 681 // In order to get the visual rect right, we have to examine left, middle, and |
| 682 // middle, and right rects individually, since otherwise the union of those | 682 // right rects individually, since otherwise the union of those rects might |
| 683 // rects might remain the same even when changes have occurred. | 683 // remain the same even when changes have occurred. |
| 684 typedef HashMap<LayoutBlock*, SelectionState> SelectedBlockMap; | 684 typedef HashMap<LayoutBlock*, SelectionState> SelectedBlockMap; |
| 685 SelectedBlockMap oldSelectedBlocks; | 685 SelectedBlockMap oldSelectedBlocks; |
| 686 // FIXME: |newSelectedBlocks| doesn't really need to store the SelectionState, | 686 // FIXME: |newSelectedBlocks| doesn't really need to store the SelectionState, |
| 687 // it's just more convenient to have it use the same data structure as | 687 // it's just more convenient to have it use the same data structure as |
| 688 // |oldSelectedBlocks|. | 688 // |oldSelectedBlocks|. |
| 689 SelectedBlockMap newSelectedBlocks; | 689 SelectedBlockMap newSelectedBlocks; |
| 690 | 690 |
| 691 LayoutObject* os = m_selectionStart; | 691 LayoutObject* os = m_selectionStart; |
| 692 LayoutObject* stop = | 692 LayoutObject* stop = |
| 693 layoutObjectAfterPosition(m_selectionEnd, m_selectionEndPos); | 693 layoutObjectAfterPosition(m_selectionEnd, m_selectionEndPos); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 if (block) | 1057 if (block) |
| 1058 block->adjustChildDebugRect(rect); | 1058 block->adjustChildDebugRect(rect); |
| 1059 | 1059 |
| 1060 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); | 1060 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); |
| 1061 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); | 1061 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); |
| 1062 | 1062 |
| 1063 return rect; | 1063 return rect; |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 } // namespace blink | 1066 } // namespace blink |
| OLD | NEW |