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

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

Issue 2436283002: Fix LayoutObject::mapLocalToAncestor() for fixed under absolute (Closed)
Patch Set: Rebaseline after rebase Created 4 years, 1 month 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
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. 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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698