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. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 } else { | 393 } else { |
394 geometryMap.push(this, offset, 0, offsetForFixedPosition); | 394 geometryMap.push(this, offset, 0, offsetForFixedPosition); |
395 } | 395 } |
396 | 396 |
397 return container; | 397 return container; |
398 } | 398 } |
399 | 399 |
400 void LayoutView::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, | 400 void LayoutView::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, |
401 TransformState& transformState, | 401 TransformState& transformState, |
402 MapCoordinatesFlags mode) const { | 402 MapCoordinatesFlags mode) const { |
403 if (this == ancestor) | 403 if (this != ancestor && (mode & TraverseDocumentBoundaries)) { |
404 return; | |
405 | |
406 if (mode & TraverseDocumentBoundaries) { | |
407 if (LayoutPart* parentDocLayoutObject = toLayoutPart( | 404 if (LayoutPart* parentDocLayoutObject = toLayoutPart( |
408 LayoutAPIShim::layoutObjectFrom(frame()->ownerLayoutItem()))) { | 405 LayoutAPIShim::layoutObjectFrom(frame()->ownerLayoutItem()))) { |
409 // A LayoutView is a containing block for fixed-position elements, so | 406 // A LayoutView is a containing block for fixed-position elements, so |
410 // don't carry this state across frames. | 407 // don't carry this state across frames. |
411 parentDocLayoutObject->mapAncestorToLocal(ancestor, transformState, | 408 parentDocLayoutObject->mapAncestorToLocal(ancestor, transformState, |
412 mode & ~IsFixed); | 409 mode & ~IsFixed); |
413 | 410 |
414 transformState.move(parentDocLayoutObject->contentBoxOffset()); | 411 transformState.move(parentDocLayoutObject->contentBoxOffset()); |
415 transformState.move(LayoutSize(-frame()->view()->scrollOffset())); | 412 transformState.move(LayoutSize(-frame()->view()->scrollOffset())); |
416 } | 413 } |
417 } else { | 414 } else { |
418 ASSERT(!ancestor); | 415 DCHECK(this == ancestor || !ancestor); |
419 } | 416 } |
420 | 417 |
421 if (mode & IsFixed) | 418 if (mode & IsFixed) |
422 transformState.move(LayoutSize(frame()->view()->scrollOffset())); | 419 transformState.move(LayoutSize(frame()->view()->scrollOffset())); |
423 } | 420 } |
424 | 421 |
425 void LayoutView::computeSelfHitTestRects(Vector<LayoutRect>& rects, | 422 void LayoutView::computeSelfHitTestRects(Vector<LayoutRect>& rects, |
426 const LayoutPoint&) const { | 423 const LayoutPoint&) const { |
427 // Record the entire size of the contents of the frame. Note that we don't | 424 // Record the entire size of the contents of the frame. Note that we don't |
428 // just use the viewport size (containing block) here because we want to | 425 // just use the viewport size (containing block) here because we want to |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 if (block) | 1059 if (block) |
1063 block->adjustChildDebugRect(rect); | 1060 block->adjustChildDebugRect(rect); |
1064 | 1061 |
1065 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); | 1062 rect.setWidth(LayoutUnit(viewWidth(IncludeScrollbars))); |
1066 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); | 1063 rect.setHeight(LayoutUnit(viewHeight(IncludeScrollbars))); |
1067 | 1064 |
1068 return rect; | 1065 return rect; |
1069 } | 1066 } |
1070 | 1067 |
1071 } // namespace blink | 1068 } // namespace blink |
OLD | NEW |