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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 2300703003: [Layout API] Remove ownerLayoutObject() from layout/LayoutView (Closed)
Patch Set: Created 4 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 #include "core/editing/FrameSelection.h" 25 #include "core/editing/FrameSelection.h"
26 #include "core/frame/FrameView.h" 26 #include "core/frame/FrameView.h"
27 #include "core/frame/LocalFrame.h" 27 #include "core/frame/LocalFrame.h"
28 #include "core/frame/Settings.h" 28 #include "core/frame/Settings.h"
29 #include "core/html/HTMLIFrameElement.h" 29 #include "core/html/HTMLIFrameElement.h"
30 #include "core/layout/HitTestResult.h" 30 #include "core/layout/HitTestResult.h"
31 #include "core/layout/LayoutGeometryMap.h" 31 #include "core/layout/LayoutGeometryMap.h"
32 #include "core/layout/LayoutMedia.h" 32 #include "core/layout/LayoutMedia.h"
33 #include "core/layout/LayoutPart.h" 33 #include "core/layout/LayoutPart.h"
34 #include "core/layout/ViewFragmentationContext.h" 34 #include "core/layout/ViewFragmentationContext.h"
35 #include "core/layout/api/LayoutAPIShim.h"
35 #include "core/layout/compositing/PaintLayerCompositor.h" 36 #include "core/layout/compositing/PaintLayerCompositor.h"
36 #include "core/page/Page.h" 37 #include "core/page/Page.h"
37 #include "core/paint/PaintLayer.h" 38 #include "core/paint/PaintLayer.h"
38 #include "core/paint/ViewPainter.h" 39 #include "core/paint/ViewPainter.h"
39 #include "core/svg/SVGDocumentExtensions.h" 40 #include "core/svg/SVGDocumentExtensions.h"
40 #include "platform/Histogram.h" 41 #include "platform/Histogram.h"
41 #include "platform/TraceEvent.h" 42 #include "platform/TraceEvent.h"
42 #include "platform/TracedValue.h" 43 #include "platform/TracedValue.h"
43 #include "platform/geometry/FloatQuad.h" 44 #include "platform/geometry/FloatQuad.h"
44 #include "platform/geometry/TransformState.h" 45 #include "platform/geometry/TransformState.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 LayoutSize offset; 344 LayoutSize offset;
344 LayoutObject* container = nullptr; 345 LayoutObject* container = nullptr;
345 346
346 if (m_frameView) { 347 if (m_frameView) {
347 offsetForFixedPosition = LayoutSize(LayoutSize(m_frameView->scrollOffset ())); 348 offsetForFixedPosition = LayoutSize(LayoutSize(m_frameView->scrollOffset ()));
348 if (hasOverflowClip()) 349 if (hasOverflowClip())
349 offsetForFixedPosition = LayoutSize(scrolledContentOffset()); 350 offsetForFixedPosition = LayoutSize(scrolledContentOffset());
350 } 351 }
351 352
352 if (geometryMap.getMapCoordinatesFlags() & TraverseDocumentBoundaries) { 353 if (geometryMap.getMapCoordinatesFlags() & TraverseDocumentBoundaries) {
353 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { 354 if (LayoutPart* parentDocLayoutObject = toLayoutPart(LayoutAPIShim::layo utObjectFrom(frame()->ownerLayoutItem()))) {
354 offset = -LayoutSize(m_frameView->scrollOffset()); 355 offset = -LayoutSize(m_frameView->scrollOffset());
355 offset += parentDocLayoutObject->contentBoxOffset(); 356 offset += parentDocLayoutObject->contentBoxOffset();
356 container = parentDocLayoutObject; 357 container = parentDocLayoutObject;
357 } 358 }
358 } 359 }
359 360
360 // If a container was specified, and was not 0 or the LayoutView, then we 361 // If a container was specified, and was not 0 or the LayoutView, then we
361 // should have found it by now unless we're traversing to a parent document. 362 // should have found it by now unless we're traversing to a parent document.
362 DCHECK(!ancestorToStopAt || ancestorToStopAt == this || container); 363 DCHECK(!ancestorToStopAt || ancestorToStopAt == this || container);
363 364
364 if ((!ancestorToStopAt || container) && shouldUseTransformFromContainer(cont ainer)) { 365 if ((!ancestorToStopAt || container) && shouldUseTransformFromContainer(cont ainer)) {
365 TransformationMatrix t; 366 TransformationMatrix t;
366 getTransformFromContainer(container, LayoutSize(), t); 367 getTransformFromContainer(container, LayoutSize(), t);
367 geometryMap.push(this, t, ContainsFixedPosition, offsetForFixedPosition) ; 368 geometryMap.push(this, t, ContainsFixedPosition, offsetForFixedPosition) ;
368 } else { 369 } else {
369 geometryMap.push(this, offset, 0, offsetForFixedPosition); 370 geometryMap.push(this, offset, 0, offsetForFixedPosition);
370 } 371 }
371 372
372 return container; 373 return container;
373 } 374 }
374 375
375 void LayoutView::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Transf ormState& transformState, MapCoordinatesFlags mode) const 376 void LayoutView::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Transf ormState& transformState, MapCoordinatesFlags mode) const
376 { 377 {
377 if (this == ancestor) 378 if (this == ancestor)
378 return; 379 return;
379 380
380 if (mode & TraverseDocumentBoundaries) { 381 if (mode & TraverseDocumentBoundaries) {
381 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { 382 if (LayoutPart* parentDocLayoutObject = toLayoutPart(LayoutAPIShim::layo utObjectFrom(frame()->ownerLayoutItem()))) {
382 // A LayoutView is a containing block for fixed-position elements, s o don't carry this state across frames. 383 // A LayoutView is a containing block for fixed-position elements, s o don't carry this state across frames.
383 parentDocLayoutObject->mapAncestorToLocal(ancestor, transformState, mode & ~IsFixed); 384 parentDocLayoutObject->mapAncestorToLocal(ancestor, transformState, mode & ~IsFixed);
384 385
385 transformState.move(parentDocLayoutObject->contentBoxOffset()); 386 transformState.move(parentDocLayoutObject->contentBoxOffset());
386 transformState.move(-frame()->view()->scrollOffset()); 387 transformState.move(-frame()->view()->scrollOffset());
387 } 388 }
388 } else { 389 } else {
389 ASSERT(!ancestor); 390 ASSERT(!ancestor);
390 } 391 }
391 392
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 // of this override. All frame scrolling should be handled by 990 // of this override. All frame scrolling should be handled by
990 // ViewportScrollCallback. 991 // ViewportScrollCallback.
991 992
992 if (!frameView()) 993 if (!frameView())
993 return ScrollResult(false, false, delta.width(), delta.height()); 994 return ScrollResult(false, false, delta.width(), delta.height());
994 995
995 return frameView()->getScrollableArea()->userScroll(granularity, delta); 996 return frameView()->getScrollableArea()->userScroll(granularity, delta);
996 } 997 }
997 998
998 } // namespace blink 999 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698