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

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

Issue 1817693002: Support edge-inclusive intersections in mapToVisibleRectInAncestorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-idle-callback
Patch Set: more tests Created 4 years, 8 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 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 { 1631 {
1632 return clippedOverflowRectForPaintInvalidation(view()); 1632 return clippedOverflowRectForPaintInvalidation(view());
1633 } 1633 }
1634 1634
1635 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox ModelObject*, const PaintInvalidationState*) const 1635 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox ModelObject*, const PaintInvalidationState*) const
1636 { 1636 {
1637 ASSERT_NOT_REACHED(); 1637 ASSERT_NOT_REACHED();
1638 return LayoutRect(); 1638 return LayoutRect();
1639 } 1639 }
1640 1640
1641 void LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const 1641 bool LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState, VisibleRectFlags visibleRectFlags) const
1642 { 1642 {
1643 // For any layout object that doesn't override this method (the main example is LayoutText),
1644 // the rect is assumed to be in the coordinate space of the object's parent.
1645
1643 if (ancestor == this) 1646 if (ancestor == this)
1644 return; 1647 return true;
1645 1648
1646 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances tor)) { 1649 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances tor))
1647 paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect); 1650 return paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect, visibleRectFlags);
1648 return;
1649 }
1650 1651
1651 if (LayoutObject* parent = this->parent()) { 1652 if (LayoutObject* parent = this->parent()) {
1652 if (parent->hasOverflowClip()) { 1653 if (parent->hasOverflowClip()) {
1653 LayoutBox* parentBox = toLayoutBox(parent); 1654 LayoutBox* parentBox = toLayoutBox(parent);
1654 parentBox->mapScrollingContentsRectToBoxSpace(rect); 1655 parentBox->mapScrollingContentsRectToBoxSpace(rect);
1655 if (parent != ancestor) 1656 if (parent != ancestor && !parentBox->applyOverflowClip(rect, visibl eRectFlags))
1656 parentBox->applyOverflowClip(rect); 1657 return false;
1657 if (rect.isEmpty())
1658 return;
1659 } 1658 }
1660 1659
1661 parent->mapToVisibleRectInAncestorSpace(ancestor, rect, nullptr); 1660 return parent->mapToVisibleRectInAncestorSpace(ancestor, rect, nullptr, visibleRectFlags);
1662 } 1661 }
1662 return true;
1663 } 1663 }
1664 1664
1665 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*) 1665 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*)
1666 { 1666 {
1667 } 1667 }
1668 1668
1669 #ifndef NDEBUG 1669 #ifndef NDEBUG
1670 1670
1671 void LayoutObject::showTreeForThis() const 1671 void LayoutObject::showTreeForThis() const
1672 { 1672 {
(...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after
3737 const blink::LayoutObject* root = object1; 3737 const blink::LayoutObject* root = object1;
3738 while (root->parent()) 3738 while (root->parent())
3739 root = root->parent(); 3739 root = root->parent();
3740 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3740 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3741 } else { 3741 } else {
3742 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3742 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3743 } 3743 }
3744 } 3744 }
3745 3745
3746 #endif 3746 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698