Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Applying root scroll offset better Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 m_hiddenForThrottling(false), 189 m_hiddenForThrottling(false),
188 m_subtreeThrottled(false), 190 m_subtreeThrottled(false),
189 m_lifecycleUpdatesThrottled(false), 191 m_lifecycleUpdatesThrottled(false),
190 m_needsPaintPropertyUpdate(true), 192 m_needsPaintPropertyUpdate(true),
191 m_currentUpdateLifecyclePhasesTargetState( 193 m_currentUpdateLifecyclePhasesTargetState(
192 DocumentLifecycle::Uninitialized), 194 DocumentLifecycle::Uninitialized),
193 m_scrollAnchor(this), 195 m_scrollAnchor(this),
194 m_scrollbarManager(*this), 196 m_scrollbarManager(*this),
195 m_needsScrollbarsUpdate(false), 197 m_needsScrollbarsUpdate(false),
196 m_suppressAdjustViewSize(false), 198 m_suppressAdjustViewSize(false),
197 m_allowsLayoutInvalidationAfterLayoutClean(true) { 199 m_allowsLayoutInvalidationAfterLayoutClean(true),
200 m_remoteViewportIntersection(0, 0, 0, 0) {
198 init(); 201 init();
199 } 202 }
200 203
201 FrameView* FrameView::create(LocalFrame& frame) { 204 FrameView* FrameView::create(LocalFrame& frame) {
202 FrameView* view = new FrameView(frame); 205 FrameView* view = new FrameView(frame);
203 view->show(); 206 view->show();
204 return view; 207 return view;
205 } 208 }
206 209
207 FrameView* FrameView::create(LocalFrame& frame, const IntSize& initialSize) { 210 FrameView* FrameView::create(LocalFrame& frame, const IntSize& initialSize) {
(...skipping 4464 matching lines...) Expand 10 before | Expand all | Expand 10 after
4672 int FrameView::initialViewportWidth() const { 4675 int FrameView::initialViewportWidth() const {
4673 DCHECK(m_frame->isMainFrame()); 4676 DCHECK(m_frame->isMainFrame());
4674 return m_initialViewportSize.width(); 4677 return m_initialViewportSize.width();
4675 } 4678 }
4676 4679
4677 int FrameView::initialViewportHeight() const { 4680 int FrameView::initialViewportHeight() const {
4678 DCHECK(m_frame->isMainFrame()); 4681 DCHECK(m_frame->isMainFrame());
4679 return m_initialViewportSize.height(); 4682 return m_initialViewportSize.height();
4680 } 4683 }
4681 4684
4685 void FrameView::setViewportIntersectionFromParent(
4686 const IntRect& viewportIntersection) {
4687 if (m_remoteViewportIntersection != viewportIntersection) {
4688 m_remoteViewportIntersection = viewportIntersection;
4689 scheduleAnimation();
4690 }
4691 }
4692
4693 IntRect FrameView::remoteViewportIntersection() {
4694 IntRect intersection(m_remoteViewportIntersection);
4695 intersection.move(scrollOffsetInt());
4696 return intersection;
4697 }
4698
4699 void FrameView::mapQuadToAncestorFrameIncludingScrollOffset(
4700 LayoutRect& rect,
4701 const LayoutObject* descendant,
4702 const LayoutView* ancestor,
4703 MapCoordinatesFlags mode) {
4704 FloatQuad mappedQuad = descendant->localToAncestorQuad(
4705 FloatQuad(FloatRect(rect)), ancestor, mode);
4706 rect = LayoutRect(mappedQuad.boundingBox());
4707
4708 // localToAncestorQuad accounts for scroll offset if it encounters a remote
4709 // frame in the ancestor chain, otherwise it needs to be added explicitly.
4710 if (frame().localFrameRoot() == frame().tree().top() ||
4711 (ancestor && ancestor->frame() != frame().tree().top())) {
szager1 2016/12/16 03:42:34 I think the 'ancestor->frame() != frame().tree().t
kenrb 2016/12/16 16:17:35 I think that situation is covered, because this ev
4712 FrameView* ancestorView =
4713 (ancestor ? ancestor->frameView()
4714 : toLocalFrame(frame().tree().top())->view());
4715 LayoutSize scrollPosition = LayoutSize(ancestorView->getScrollOffset());
4716 rect.move(-scrollPosition);
4717 }
4718 }
4719
4682 } // namespace blink 4720 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698