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

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

Issue 2218703002: [mapToVisualRectInAncestorSpace] Check for detached iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Simplify test Created 4 years, 4 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 // Frames are painted at rounded-int position. Since we cannot efficient ly compute the subpixel offset 472 // Frames are painted at rounded-int position. Since we cannot efficient ly compute the subpixel offset
473 // of painting at this point in a a bottom-up walk, round to the enclosi ng int rect, which will enclose 473 // of painting at this point in a a bottom-up walk, round to the enclosi ng int rect, which will enclose
474 // the actual visible rect. 474 // the actual visible rect.
475 rect = LayoutRect(enclosingIntRect(rect)); 475 rect = LayoutRect(enclosingIntRect(rect));
476 476
477 // Adjust for frame border. 477 // Adjust for frame border.
478 rect.move(obj->contentBoxOffset()); 478 rect.move(obj->contentBoxOffset());
479 return obj->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFla gs); 479 return obj->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFla gs);
480 } 480 }
481 481
482 return true; 482 // This can happen, e.g., if the iframe element has display:none.
483 rect = LayoutRect();
484 return false;
483 } 485 }
484 486
485 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const 487 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const
486 { 488 {
487 if (m_frameView) { 489 if (m_frameView) {
488 rect.move(LayoutSize(m_frameView->scrollOffset())); 490 rect.move(LayoutSize(m_frameView->scrollOffset()));
489 if (hasOverflowClip()) 491 if (hasOverflowClip())
490 rect.move(scrolledContentOffset()); 492 rect.move(scrolledContentOffset());
491 493
492 // FIXME: Paint invalidation should happen after scroll updates, so ther e should be no pending scroll delta. 494 // FIXME: Paint invalidation should happen after scroll updates, so ther e should be no pending scroll delta.
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 // of this override. All frame scrolling should be handled by 994 // of this override. All frame scrolling should be handled by
993 // ViewportScrollCallback. 995 // ViewportScrollCallback.
994 996
995 if (!frameView()) 997 if (!frameView())
996 return ScrollResult(false, false, delta.width(), delta.height()); 998 return ScrollResult(false, false, delta.width(), delta.height());
997 999
998 return frameView()->getScrollableArea()->userScroll(granularity, delta); 1000 return frameView()->getScrollableArea()->userScroll(granularity, delta);
999 } 1001 }
1000 1002
1001 } // namespace blink 1003 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698