| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/frame/Settings.h" | 30 #include "core/frame/Settings.h" |
| 31 #include "core/html/HTMLIFrameElement.h" | 31 #include "core/html/HTMLIFrameElement.h" |
| 32 #include "core/layout/HitTestResult.h" | 32 #include "core/layout/HitTestResult.h" |
| 33 #include "core/layout/LayoutGeometryMap.h" | 33 #include "core/layout/LayoutGeometryMap.h" |
| 34 #include "core/layout/LayoutPart.h" | 34 #include "core/layout/LayoutPart.h" |
| 35 #include "core/layout/ViewFragmentationContext.h" | 35 #include "core/layout/ViewFragmentationContext.h" |
| 36 #include "core/layout/api/LayoutAPIShim.h" | 36 #include "core/layout/api/LayoutAPIShim.h" |
| 37 #include "core/layout/api/LayoutPartItem.h" | 37 #include "core/layout/api/LayoutPartItem.h" |
| 38 #include "core/layout/api/LayoutViewItem.h" | 38 #include "core/layout/api/LayoutViewItem.h" |
| 39 #include "core/layout/compositing/PaintLayerCompositor.h" | 39 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 40 #include "core/page/ChromeClient.h" |
| 40 #include "core/page/Page.h" | 41 #include "core/page/Page.h" |
| 41 #include "core/paint/PaintLayer.h" | 42 #include "core/paint/PaintLayer.h" |
| 42 #include "core/paint/ViewPaintInvalidator.h" | 43 #include "core/paint/ViewPaintInvalidator.h" |
| 43 #include "core/paint/ViewPainter.h" | 44 #include "core/paint/ViewPainter.h" |
| 44 #include "core/svg/SVGDocumentExtensions.h" | 45 #include "core/svg/SVGDocumentExtensions.h" |
| 45 #include "platform/Histogram.h" | 46 #include "platform/Histogram.h" |
| 46 #include "platform/RuntimeEnabledFeatures.h" | 47 #include "platform/RuntimeEnabledFeatures.h" |
| 47 #include "platform/geometry/FloatQuad.h" | 48 #include "platform/geometry/FloatQuad.h" |
| 48 #include "platform/geometry/TransformState.h" | 49 #include "platform/geometry/TransformState.h" |
| 49 #include "platform/graphics/paint/PaintController.h" | 50 #include "platform/graphics/paint/PaintController.h" |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 LayoutUnit LayoutView::ViewLogicalHeightForPercentages() const { | 695 LayoutUnit LayoutView::ViewLogicalHeightForPercentages() const { |
| 695 if (ShouldUsePrintingLayout()) | 696 if (ShouldUsePrintingLayout()) |
| 696 return PageLogicalHeight(); | 697 return PageLogicalHeight(); |
| 697 return LayoutUnit(ViewLogicalHeight()); | 698 return LayoutUnit(ViewLogicalHeight()); |
| 698 } | 699 } |
| 699 | 700 |
| 700 float LayoutView::ZoomFactor() const { | 701 float LayoutView::ZoomFactor() const { |
| 701 return frame_view_->GetFrame().PageZoomFactor(); | 702 return frame_view_->GetFrame().PageZoomFactor(); |
| 702 } | 703 } |
| 703 | 704 |
| 705 void LayoutView::UpdateAfterLayout() { |
| 706 // Unlike every other layer, the root PaintLayer takes its size from the |
| 707 // layout viewport size. The call to AdjustViewSize() will update the |
| 708 // frame's contents size, which will also update the page's minimum scale |
| 709 // factor. The call to ResizeAfterLayout() will calculate the layout viewport |
| 710 // size based on the page minimum scale factor, and then update the FrameView |
| 711 // with the new size. |
| 712 if (HasOverflowClip()) |
| 713 GetScrollableArea()->ClampScrollOffsetAfterOverflowChange(); |
| 714 LocalFrame& frame = GetFrameView()->GetFrame(); |
| 715 if (!GetDocument().Printing()) |
| 716 GetFrameView()->AdjustViewSize(); |
| 717 frame.GetChromeClient().ResizeAfterLayout(&frame); |
| 718 LayoutBlockFlow::UpdateAfterLayout(); |
| 719 } |
| 720 |
| 704 void LayoutView::UpdateHitTestResult(HitTestResult& result, | 721 void LayoutView::UpdateHitTestResult(HitTestResult& result, |
| 705 const LayoutPoint& point) { | 722 const LayoutPoint& point) { |
| 706 if (result.InnerNode()) | 723 if (result.InnerNode()) |
| 707 return; | 724 return; |
| 708 | 725 |
| 709 Node* node = GetDocument().documentElement(); | 726 Node* node = GetDocument().documentElement(); |
| 710 if (node) { | 727 if (node) { |
| 711 LayoutPoint adjusted_point = point; | 728 LayoutPoint adjusted_point = point; |
| 712 OffsetForContents(adjusted_point); | 729 OffsetForContents(adjusted_point); |
| 713 result.SetNodeAndPosition(node, adjusted_point); | 730 result.SetNodeAndPosition(node, adjusted_point); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 // Frame scroll corner is painted using LayoutView as the display item client. | 824 // Frame scroll corner is painted using LayoutView as the display item client. |
| 808 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 825 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
| 809 (GetFrameView()->HorizontalScrollbar() || | 826 (GetFrameView()->HorizontalScrollbar() || |
| 810 GetFrameView()->VerticalScrollbar())) | 827 GetFrameView()->VerticalScrollbar())) |
| 811 return false; | 828 return false; |
| 812 | 829 |
| 813 return LayoutBlockFlow::PaintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 830 return LayoutBlockFlow::PaintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
| 814 } | 831 } |
| 815 | 832 |
| 816 } // namespace blink | 833 } // namespace blink |
| OLD | NEW |