| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Transf
ormState& transformState, MapCoordinatesFlags mode) const | 333 void LayoutView::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Transf
ormState& transformState, MapCoordinatesFlags mode) const |
| 334 { | 334 { |
| 335 if (!ancestor && mode & UseTransforms && shouldUseTransformFromContainer(0))
{ | 335 if (!ancestor && mode & UseTransforms && shouldUseTransformFromContainer(0))
{ |
| 336 TransformationMatrix t; | 336 TransformationMatrix t; |
| 337 getTransformFromContainer(0, LayoutSize(), t); | 337 getTransformFromContainer(0, LayoutSize(), t); |
| 338 transformState.applyTransform(t); | 338 transformState.applyTransform(t); |
| 339 } | 339 } |
| 340 | 340 |
| 341 if ((mode & IsFixed) && m_frameView) { | 341 if ((mode & IsFixed) && m_frameView) { |
| 342 transformState.move(toIntSize(m_frameView->scrollPosition())); | 342 transformState.move(LayoutSize(m_frameView->scrollOffset())); |
| 343 if (hasOverflowClip()) | 343 if (hasOverflowClip()) |
| 344 transformState.move(scrolledContentOffset()); | 344 transformState.move(scrolledContentOffset()); |
| 345 // IsFixed flag is only applicable within this LayoutView. | 345 // IsFixed flag is only applicable within this LayoutView. |
| 346 mode &= ~IsFixed; | 346 mode &= ~IsFixed; |
| 347 } | 347 } |
| 348 | 348 |
| 349 if (ancestor == this) | 349 if (ancestor == this) |
| 350 return; | 350 return; |
| 351 | 351 |
| 352 if (mode & TraverseDocumentBoundaries) { | 352 if (mode & TraverseDocumentBoundaries) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 const LayoutObject* LayoutView::pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 368 const LayoutObject* LayoutView::pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
| 369 { | 369 { |
| 370 LayoutSize offsetForFixedPosition; | 370 LayoutSize offsetForFixedPosition; |
| 371 LayoutSize offset; | 371 LayoutSize offset; |
| 372 LayoutObject* container = nullptr; | 372 LayoutObject* container = nullptr; |
| 373 | 373 |
| 374 if (m_frameView) { | 374 if (m_frameView) { |
| 375 offsetForFixedPosition = LayoutSize(toIntSize(m_frameView->scrollPositio
n())); | 375 offsetForFixedPosition = LayoutSize(LayoutSize(m_frameView->scrollOffset
())); |
| 376 if (hasOverflowClip()) | 376 if (hasOverflowClip()) |
| 377 offsetForFixedPosition = LayoutSize(scrolledContentOffset()); | 377 offsetForFixedPosition = LayoutSize(scrolledContentOffset()); |
| 378 } | 378 } |
| 379 | 379 |
| 380 if (geometryMap.getMapCoordinatesFlags() & TraverseDocumentBoundaries) { | 380 if (geometryMap.getMapCoordinatesFlags() & TraverseDocumentBoundaries) { |
| 381 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { | 381 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { |
| 382 offset = -LayoutSize(m_frameView->scrollOffset()); | 382 offset = -LayoutSize(m_frameView->scrollOffset()); |
| 383 offset += parentDocLayoutObject->contentBoxOffset(); | 383 offset += parentDocLayoutObject->contentBoxOffset(); |
| 384 container = parentDocLayoutObject; | 384 container = parentDocLayoutObject; |
| 385 } | 385 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 399 | 399 |
| 400 return container; | 400 return container; |
| 401 } | 401 } |
| 402 | 402 |
| 403 void LayoutView::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Transf
ormState& transformState, MapCoordinatesFlags mode) const | 403 void LayoutView::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Transf
ormState& transformState, MapCoordinatesFlags mode) const |
| 404 { | 404 { |
| 405 if (this == ancestor) | 405 if (this == ancestor) |
| 406 return; | 406 return; |
| 407 | 407 |
| 408 if (mode & IsFixed && m_frameView) | 408 if (mode & IsFixed && m_frameView) |
| 409 transformState.move(toIntSize(m_frameView->scrollPosition())); | 409 transformState.move(m_frameView->scrollOffset()); |
| 410 | 410 |
| 411 if (mode & UseTransforms && shouldUseTransformFromContainer(0)) { | 411 if (mode & UseTransforms && shouldUseTransformFromContainer(0)) { |
| 412 TransformationMatrix t; | 412 TransformationMatrix t; |
| 413 getTransformFromContainer(0, LayoutSize(), t); | 413 getTransformFromContainer(0, LayoutSize(), t); |
| 414 transformState.applyTransform(t); | 414 transformState.applyTransform(t); |
| 415 } | 415 } |
| 416 | 416 |
| 417 if (mode & TraverseDocumentBoundaries) { | 417 if (mode & TraverseDocumentBoundaries) { |
| 418 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { | 418 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { |
| 419 // A LayoutView is a containing block for fixed-position elements, s
o don't carry this state across frames. | 419 // A LayoutView is a containing block for fixed-position elements, s
o don't carry this state across frames. |
| 420 mode &= ~IsFixed; | 420 mode &= ~IsFixed; |
| 421 | 421 |
| 422 transformState.move(-frame()->view()->scrollOffset()); |
| 423 transformState.move(parentDocLayoutObject->contentBoxOffset()); |
| 424 |
| 422 parentDocLayoutObject->mapAncestorToLocal(ancestor, transformState,
mode); | 425 parentDocLayoutObject->mapAncestorToLocal(ancestor, transformState,
mode); |
| 423 transformState.move(parentDocLayoutObject->contentBoxOffset()); | |
| 424 transformState.move(-frame()->view()->scrollOffset()); | |
| 425 } | 426 } |
| 426 } else { | 427 } else { |
| 427 ASSERT(!ancestor); | 428 ASSERT(!ancestor); |
| 428 } | 429 } |
| 429 } | 430 } |
| 430 | 431 |
| 431 void LayoutView::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout
Point&) const | 432 void LayoutView::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout
Point&) const |
| 432 { | 433 { |
| 433 // Record the entire size of the contents of the frame. Note that we don't j
ust | 434 // Record the entire size of the contents of the frame. Note that we don't j
ust |
| 434 // use the viewport size (containing block) here because we want to ensure t
his includes | 435 // use the viewport size (containing block) here because we want to ensure t
his includes |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 rect.move(obj->contentBoxOffset()); | 535 rect.move(obj->contentBoxOffset()); |
| 535 return obj->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFla
gs); | 536 return obj->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFla
gs); |
| 536 } | 537 } |
| 537 | 538 |
| 538 return true; | 539 return true; |
| 539 } | 540 } |
| 540 | 541 |
| 541 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const | 542 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const |
| 542 { | 543 { |
| 543 if (m_frameView) { | 544 if (m_frameView) { |
| 544 rect.move(toIntSize(m_frameView->scrollPosition())); | 545 rect.move(LayoutSize(m_frameView->scrollOffset())); |
| 545 if (hasOverflowClip()) | 546 if (hasOverflowClip()) |
| 546 rect.move(scrolledContentOffset()); | 547 rect.move(scrolledContentOffset()); |
| 547 | 548 |
| 548 // FIXME: Paint invalidation should happen after scroll updates, so ther
e should be no pending scroll delta. | 549 // FIXME: Paint invalidation should happen after scroll updates, so ther
e should be no pending scroll delta. |
| 549 // However, we still have paint invalidation during layout, so we can't
ASSERT for now. crbug.com/434950. | 550 // However, we still have paint invalidation during layout, so we can't
ASSERT for now. crbug.com/434950. |
| 550 // ASSERT(m_frameView->pendingScrollDelta().isZero()); | 551 // ASSERT(m_frameView->pendingScrollDelta().isZero()); |
| 551 // If we have a pending scroll, invalidate the previous scroll position. | 552 // If we have a pending scroll, invalidate the previous scroll position. |
| 552 if (!m_frameView->pendingScrollDelta().isZero()) | 553 if (!m_frameView->pendingScrollDelta().isZero()) |
| 553 rect.move(-LayoutSize(m_frameView->pendingScrollDelta())); | 554 rect.move(-LayoutSize(m_frameView->pendingScrollDelta())); |
| 554 } | 555 } |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 // ASSERT(!frame()->isMainFrame()) here. All main frame scrolling should | 1043 // ASSERT(!frame()->isMainFrame()) here. All main frame scrolling should |
| 1043 // be handled by the ViewportScrollCallback. | 1044 // be handled by the ViewportScrollCallback. |
| 1044 | 1045 |
| 1045 if (!frameView()) | 1046 if (!frameView()) |
| 1046 return ScrollResult(false, false, delta.width(), delta.height()); | 1047 return ScrollResult(false, false, delta.width(), delta.height()); |
| 1047 | 1048 |
| 1048 return frameView()->getScrollableArea()->userScroll(granularity, delta); | 1049 return frameView()->getScrollableArea()->userScroll(granularity, delta); |
| 1049 } | 1050 } |
| 1050 | 1051 |
| 1051 } // namespace blink | 1052 } // namespace blink |
| OLD | NEW |