| 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. 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |