| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 { | 283 { |
| 284 ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & I
sFixed)); | 284 ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & I
sFixed)); |
| 285 | 285 |
| 286 if (!paintInvalidationContainer && mode & UseTransforms && shouldUseTransfor
mFromContainer(0)) { | 286 if (!paintInvalidationContainer && mode & UseTransforms && shouldUseTransfor
mFromContainer(0)) { |
| 287 TransformationMatrix t; | 287 TransformationMatrix t; |
| 288 getTransformFromContainer(0, LayoutSize(), t); | 288 getTransformFromContainer(0, LayoutSize(), t); |
| 289 transformState.applyTransform(t); | 289 transformState.applyTransform(t); |
| 290 } | 290 } |
| 291 | 291 |
| 292 if ((mode & IsFixed) && m_frameView) { | 292 if ((mode & IsFixed) && m_frameView) { |
| 293 transformState.move(m_frameView->scrollOffsetForViewportConstrainedObjec
ts()); | 293 transformState.move(toIntSize(m_frameView->scrollPosition())); |
| 294 if (hasOverflowClip()) | 294 if (hasOverflowClip()) |
| 295 transformState.move(scrolledContentOffset()); | 295 transformState.move(scrolledContentOffset()); |
| 296 // IsFixed flag is only applicable within this LayoutView. | 296 // IsFixed flag is only applicable within this LayoutView. |
| 297 mode &= ~IsFixed; | 297 mode &= ~IsFixed; |
| 298 } | 298 } |
| 299 | 299 |
| 300 if (paintInvalidationContainer == this) | 300 if (paintInvalidationContainer == this) |
| 301 return; | 301 return; |
| 302 | 302 |
| 303 if (mode & TraverseDocumentBoundaries) { | 303 if (mode & TraverseDocumentBoundaries) { |
| 304 if (LayoutObject* parentDocLayoutObject = frame()->ownerLayoutObject())
{ | 304 if (LayoutObject* parentDocLayoutObject = frame()->ownerLayoutObject())
{ |
| 305 transformState.move(-frame()->view()->scrollOffset()); | 305 transformState.move(-frame()->view()->scrollOffset()); |
| 306 if (parentDocLayoutObject->isBox()) | 306 if (parentDocLayoutObject->isBox()) |
| 307 transformState.move(toLayoutBox(parentDocLayoutObject)->contentB
oxOffset()); | 307 transformState.move(toLayoutBox(parentDocLayoutObject)->contentB
oxOffset()); |
| 308 parentDocLayoutObject->mapLocalToContainer(paintInvalidationContaine
r, transformState, mode, wasFixed, paintInvalidationState); | 308 parentDocLayoutObject->mapLocalToContainer(paintInvalidationContaine
r, transformState, mode, wasFixed, paintInvalidationState); |
| 309 return; | 309 return; |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 | 313 |
| 314 const LayoutObject* LayoutView::pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 314 const LayoutObject* LayoutView::pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
| 315 { | 315 { |
| 316 LayoutSize offsetForFixedPosition; | 316 LayoutSize offsetForFixedPosition; |
| 317 LayoutSize offset; | 317 LayoutSize offset; |
| 318 LayoutObject* container = 0; | 318 LayoutObject* container = 0; |
| 319 | 319 |
| 320 if (m_frameView) { | 320 if (m_frameView) { |
| 321 offsetForFixedPosition = LayoutSize(m_frameView->scrollOffsetForViewport
ConstrainedObjects()); | 321 offsetForFixedPosition = LayoutSize(toIntSize(m_frameView->scrollPositio
n())); |
| 322 if (hasOverflowClip()) | 322 if (hasOverflowClip()) |
| 323 offsetForFixedPosition = LayoutSize(scrolledContentOffset()); | 323 offsetForFixedPosition = LayoutSize(scrolledContentOffset()); |
| 324 } | 324 } |
| 325 | 325 |
| 326 if (geometryMap.mapCoordinatesFlags() & TraverseDocumentBoundaries) { | 326 if (geometryMap.mapCoordinatesFlags() & TraverseDocumentBoundaries) { |
| 327 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { | 327 if (LayoutPart* parentDocLayoutObject = frame()->ownerLayoutObject()) { |
| 328 offset = -LayoutSize(m_frameView->scrollOffset()); | 328 offset = -LayoutSize(m_frameView->scrollOffset()); |
| 329 offset += parentDocLayoutObject->contentBoxOffset(); | 329 offset += parentDocLayoutObject->contentBoxOffset(); |
| 330 container = parentDocLayoutObject; | 330 container = parentDocLayoutObject; |
| 331 } | 331 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 342 } else { | 342 } else { |
| 343 geometryMap.push(this, offset, false, false, false, false, offsetForFixe
dPosition); | 343 geometryMap.push(this, offset, false, false, false, false, offsetForFixe
dPosition); |
| 344 } | 344 } |
| 345 | 345 |
| 346 return container; | 346 return container; |
| 347 } | 347 } |
| 348 | 348 |
| 349 void LayoutView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformStat
e& transformState) const | 349 void LayoutView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformStat
e& transformState) const |
| 350 { | 350 { |
| 351 if (mode & IsFixed && m_frameView) | 351 if (mode & IsFixed && m_frameView) |
| 352 transformState.move(m_frameView->scrollOffsetForViewportConstrainedObjec
ts()); | 352 transformState.move(toIntSize(m_frameView->scrollPosition())); |
| 353 | 353 |
| 354 if (mode & UseTransforms && shouldUseTransformFromContainer(0)) { | 354 if (mode & UseTransforms && shouldUseTransformFromContainer(0)) { |
| 355 TransformationMatrix t; | 355 TransformationMatrix t; |
| 356 getTransformFromContainer(0, LayoutSize(), t); | 356 getTransformFromContainer(0, LayoutSize(), t); |
| 357 transformState.applyTransform(t); | 357 transformState.applyTransform(t); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 | 360 |
| 361 void LayoutView::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout
Point&) const | 361 void LayoutView::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout
Point&) const |
| 362 { | 362 { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 obj->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect,
0); | 466 obj->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect,
0); |
| 467 } | 467 } |
| 468 } | 468 } |
| 469 | 469 |
| 470 void LayoutView::adjustViewportConstrainedOffset(LayoutRect& rect, ViewportConst
rainedPosition viewportConstraint) const | 470 void LayoutView::adjustViewportConstrainedOffset(LayoutRect& rect, ViewportConst
rainedPosition viewportConstraint) const |
| 471 { | 471 { |
| 472 if (viewportConstraint != IsFixedPosition) | 472 if (viewportConstraint != IsFixedPosition) |
| 473 return; | 473 return; |
| 474 | 474 |
| 475 if (m_frameView) { | 475 if (m_frameView) { |
| 476 rect.move(m_frameView->scrollOffsetForViewportConstrainedObjects()); | 476 rect.move(toIntSize(m_frameView->scrollPosition())); |
| 477 if (hasOverflowClip()) | 477 if (hasOverflowClip()) |
| 478 rect.move(scrolledContentOffset()); | 478 rect.move(scrolledContentOffset()); |
| 479 | 479 |
| 480 // FIXME: Paint invalidation should happen after scroll updates, so ther
e should be no pending scroll delta. | 480 // FIXME: Paint invalidation should happen after scroll updates, so ther
e should be no pending scroll delta. |
| 481 // However, we still have paint invalidation during layout, so we can't
ASSERT for now. crbug.com/434950. | 481 // However, we still have paint invalidation during layout, so we can't
ASSERT for now. crbug.com/434950. |
| 482 // ASSERT(m_frameView->pendingScrollDelta().isZero()); | 482 // ASSERT(m_frameView->pendingScrollDelta().isZero()); |
| 483 // If we have a pending scroll, invalidate the previous scroll position. | 483 // If we have a pending scroll, invalidate the previous scroll position. |
| 484 if (!m_frameView->pendingScrollDelta().isZero()) | 484 if (!m_frameView->pendingScrollDelta().isZero()) |
| 485 rect.move(-LayoutSize(m_frameView->pendingScrollDelta())); | 485 rect.move(-LayoutSize(m_frameView->pendingScrollDelta())); |
| 486 } | 486 } |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 return viewHeight(IncludeScrollbars) / scale; | 992 return viewHeight(IncludeScrollbars) / scale; |
| 993 } | 993 } |
| 994 | 994 |
| 995 void LayoutView::willBeDestroyed() | 995 void LayoutView::willBeDestroyed() |
| 996 { | 996 { |
| 997 LayoutBlockFlow::willBeDestroyed(); | 997 LayoutBlockFlow::willBeDestroyed(); |
| 998 m_compositor.clear(); | 998 m_compositor.clear(); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 } // namespace blink | 1001 } // namespace blink |
| OLD | NEW |