OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "core/editing/markers/DocumentMarkerController.h" | 45 #include "core/editing/markers/DocumentMarkerController.h" |
46 #include "core/events/ErrorEvent.h" | 46 #include "core/events/ErrorEvent.h" |
47 #include "core/fetch/ResourceFetcher.h" | 47 #include "core/fetch/ResourceFetcher.h" |
48 #include "core/frame/BrowserControls.h" | 48 #include "core/frame/BrowserControls.h" |
49 #include "core/frame/EventHandlerRegistry.h" | 49 #include "core/frame/EventHandlerRegistry.h" |
50 #include "core/frame/FrameHost.h" | 50 #include "core/frame/FrameHost.h" |
51 #include "core/frame/LocalFrame.h" | 51 #include "core/frame/LocalFrame.h" |
52 #include "core/frame/Location.h" | 52 #include "core/frame/Location.h" |
53 #include "core/frame/PageScaleConstraintsSet.h" | 53 #include "core/frame/PageScaleConstraintsSet.h" |
54 #include "core/frame/PerformanceMonitor.h" | 54 #include "core/frame/PerformanceMonitor.h" |
| 55 #include "core/frame/RemoteFrame.h" |
| 56 #include "core/frame/RemoteFrameView.h" |
55 #include "core/frame/Settings.h" | 57 #include "core/frame/Settings.h" |
56 #include "core/frame/VisualViewport.h" | 58 #include "core/frame/VisualViewport.h" |
57 #include "core/html/HTMLFrameElement.h" | 59 #include "core/html/HTMLFrameElement.h" |
58 #include "core/html/HTMLPlugInElement.h" | 60 #include "core/html/HTMLPlugInElement.h" |
59 #include "core/html/TextControlElement.h" | 61 #include "core/html/TextControlElement.h" |
60 #include "core/html/parser/TextResourceDecoder.h" | 62 #include "core/html/parser/TextResourceDecoder.h" |
61 #include "core/input/EventHandler.h" | 63 #include "core/input/EventHandler.h" |
62 #include "core/inspector/InspectorInstrumentation.h" | 64 #include "core/inspector/InspectorInstrumentation.h" |
63 #include "core/inspector/InspectorTraceEvents.h" | 65 #include "core/inspector/InspectorTraceEvents.h" |
64 #include "core/layout/LayoutAnalyzer.h" | 66 #include "core/layout/LayoutAnalyzer.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #include "core/svg/SVGSVGElement.h" | 103 #include "core/svg/SVGSVGElement.h" |
102 #include "platform/Histogram.h" | 104 #include "platform/Histogram.h" |
103 #include "platform/HostWindow.h" | 105 #include "platform/HostWindow.h" |
104 #include "platform/RuntimeEnabledFeatures.h" | 106 #include "platform/RuntimeEnabledFeatures.h" |
105 #include "platform/ScriptForbiddenScope.h" | 107 #include "platform/ScriptForbiddenScope.h" |
106 #include "platform/WebFrameScheduler.h" | 108 #include "platform/WebFrameScheduler.h" |
107 #include "platform/fonts/FontCache.h" | 109 #include "platform/fonts/FontCache.h" |
108 #include "platform/geometry/DoubleRect.h" | 110 #include "platform/geometry/DoubleRect.h" |
109 #include "platform/geometry/FloatRect.h" | 111 #include "platform/geometry/FloatRect.h" |
110 #include "platform/geometry/LayoutRect.h" | 112 #include "platform/geometry/LayoutRect.h" |
| 113 #include "platform/geometry/TransformState.h" |
111 #include "platform/graphics/GraphicsContext.h" | 114 #include "platform/graphics/GraphicsContext.h" |
112 #include "platform/graphics/GraphicsLayer.h" | 115 #include "platform/graphics/GraphicsLayer.h" |
113 #include "platform/graphics/GraphicsLayerDebugInfo.h" | 116 #include "platform/graphics/GraphicsLayerDebugInfo.h" |
114 #include "platform/graphics/compositing/PaintArtifactCompositor.h" | 117 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
115 #include "platform/graphics/paint/CullRect.h" | 118 #include "platform/graphics/paint/CullRect.h" |
116 #include "platform/graphics/paint/PaintController.h" | 119 #include "platform/graphics/paint/PaintController.h" |
117 #include "platform/graphics/paint/ScopedPaintChunkProperties.h" | 120 #include "platform/graphics/paint/ScopedPaintChunkProperties.h" |
118 #include "platform/instrumentation/tracing/TraceEvent.h" | 121 #include "platform/instrumentation/tracing/TraceEvent.h" |
119 #include "platform/instrumentation/tracing/TracedValue.h" | 122 #include "platform/instrumentation/tracing/TracedValue.h" |
120 #include "platform/json/JSONValues.h" | 123 #include "platform/json/JSONValues.h" |
(...skipping 4780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4901 for (uint32_t reason = 1; | 4904 for (uint32_t reason = 1; |
4902 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; | 4905 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; |
4903 ++reason) { | 4906 ++reason) { |
4904 if (m_mainThreadScrollingReasonsCounter[reason] > 0) { | 4907 if (m_mainThreadScrollingReasonsCounter[reason] > 0) { |
4905 reasons |= 1 << (reason - 1); | 4908 reasons |= 1 << (reason - 1); |
4906 } | 4909 } |
4907 } | 4910 } |
4908 return reasons; | 4911 return reasons; |
4909 } | 4912 } |
4910 | 4913 |
| 4914 void FrameView::setViewportIntersectionFromParent( |
| 4915 const IntRect& viewportIntersection) { |
| 4916 if (m_remoteViewportIntersection != viewportIntersection) { |
| 4917 m_remoteViewportIntersection = viewportIntersection; |
| 4918 scheduleAnimation(); |
| 4919 } |
| 4920 } |
| 4921 |
| 4922 IntRect FrameView::remoteViewportIntersection() { |
| 4923 IntRect intersection(m_remoteViewportIntersection); |
| 4924 intersection.move(scrollOffsetInt()); |
| 4925 return intersection; |
| 4926 } |
| 4927 |
| 4928 void FrameView::mapQuadToAncestorFrameIncludingScrollOffset( |
| 4929 LayoutRect& rect, |
| 4930 const LayoutObject* descendant, |
| 4931 const LayoutView* ancestor, |
| 4932 MapCoordinatesFlags mode) { |
| 4933 FloatQuad mappedQuad = descendant->localToAncestorQuad( |
| 4934 FloatQuad(FloatRect(rect)), ancestor, mode); |
| 4935 rect = LayoutRect(mappedQuad.boundingBox()); |
| 4936 |
| 4937 // localToAncestorQuad accounts for scroll offset if it encounters a remote |
| 4938 // frame in the ancestor chain, otherwise it needs to be added explicitly. |
| 4939 if (frame().localFrameRoot() == frame().tree().top() || |
| 4940 (ancestor && |
| 4941 ancestor->frame()->localFrameRoot() == frame().localFrameRoot())) { |
| 4942 FrameView* ancestorView = |
| 4943 (ancestor ? ancestor->frameView() |
| 4944 : toLocalFrame(frame().tree().top())->view()); |
| 4945 LayoutSize scrollPosition = LayoutSize(ancestorView->getScrollOffset()); |
| 4946 rect.move(-scrollPosition); |
| 4947 } |
| 4948 } |
| 4949 |
| 4950 bool FrameView::mapToVisualRectInTopFrameSpace(LayoutRect& rect) { |
| 4951 // This is the top-level frame, so no mapping necessary. |
| 4952 if (m_frame->isMainFrame()) |
| 4953 return true; |
| 4954 |
| 4955 LayoutRect viewportIntersectionRect(remoteViewportIntersection()); |
| 4956 rect.intersect(viewportIntersectionRect); |
| 4957 if (rect.isEmpty()) |
| 4958 return false; |
| 4959 return true; |
| 4960 } |
| 4961 |
| 4962 void FrameView::applyTransformForTopFrameSpace(TransformState& transformState) { |
| 4963 // This is the top-level frame, so no mapping necessary. |
| 4964 if (m_frame->isMainFrame()) |
| 4965 return; |
| 4966 |
| 4967 LayoutRect viewportIntersectionRect(remoteViewportIntersection()); |
| 4968 transformState.move( |
| 4969 LayoutSize(-viewportIntersectionRect.x(), -viewportIntersectionRect.y())); |
| 4970 } |
| 4971 |
4911 } // namespace blink | 4972 } // namespace blink |
OLD | NEW |