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

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: 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
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 rect.moveBy(-viewRectangle.location()); 470 rect.moveBy(-viewRectangle.location());
471 } 471 }
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 return true;
480 } 481 }
481 482
482 return true; 483 // This can happen, e.g., if the iframe element has display:none.
484 rect = LayoutRect();
485 return false;
483 } 486 }
484 487
485 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const 488 void LayoutView::adjustOffsetForFixedPosition(LayoutRect& rect) const
486 { 489 {
487 if (m_frameView) { 490 if (m_frameView) {
488 rect.move(LayoutSize(m_frameView->scrollOffset())); 491 rect.move(LayoutSize(m_frameView->scrollOffset()));
489 if (hasOverflowClip()) 492 if (hasOverflowClip())
490 rect.move(scrolledContentOffset()); 493 rect.move(scrolledContentOffset());
491 494
492 // FIXME: Paint invalidation should happen after scroll updates, so ther e should be no pending scroll delta. 495 // 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 995 // of this override. All frame scrolling should be handled by
993 // ViewportScrollCallback. 996 // ViewportScrollCallback.
994 997
995 if (!frameView()) 998 if (!frameView())
996 return ScrollResult(false, false, delta.width(), delta.height()); 999 return ScrollResult(false, false, delta.width(), delta.height());
997 1000
998 return frameView()->getScrollableArea()->userScroll(granularity, delta); 1001 return frameView()->getScrollableArea()->userScroll(granularity, delta);
999 } 1002 }
1000 1003
1001 } // namespace blink 1004 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698