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

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: Address comments, add mapToVisibleRectInContainerSpace test Created 4 years, 9 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 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 { 1630 {
1631 return clippedOverflowRectForPaintInvalidation(view()); 1631 return clippedOverflowRectForPaintInvalidation(view());
1632 } 1632 }
1633 1633
1634 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox ModelObject*, const PaintInvalidationState*) const 1634 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox ModelObject*, const PaintInvalidationState*) const
1635 { 1635 {
1636 ASSERT_NOT_REACHED(); 1636 ASSERT_NOT_REACHED();
1637 return LayoutRect(); 1637 return LayoutRect();
1638 } 1638 }
1639 1639
1640 void LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const 1640 bool LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState, VisibleRectFlags visibleRectFlags) const
1641 { 1641 {
1642 if (ancestor == this) 1642 if (ancestor == this)
1643 return; 1643 return true;
1644 1644
1645 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances tor)) { 1645 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances tor))
1646 paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect); 1646 return paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect, visibleRectFlags);
1647 return;
1648 }
1649 1647
1650 if (LayoutObject* parent = this->parent()) { 1648 if (LayoutObject* parent = this->parent()) {
1651 if (parent->hasOverflowClip()) { 1649 if (parent->hasOverflowClip()) {
1652 LayoutBox* parentBox = toLayoutBox(parent); 1650 LayoutBox* parentBox = toLayoutBox(parent);
1653 parentBox->mapScrollingContentsRectToBoxSpace(rect); 1651 parentBox->mapScrollingContentsRectToBoxSpace(rect);
1654 if (parent != ancestor) 1652 if (parent != ancestor && !parentBox->applyOverflowClip(rect, visibl eRectFlags))
1655 parentBox->applyOverflowClip(rect); 1653 return false;
1656 if (rect.isEmpty())
1657 return;
1658 } 1654 }
1659 1655
1660 parent->mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidatio nState); 1656 return parent->mapToVisibleRectInAncestorSpace(ancestor, rect, paintInva lidationState, visibleRectFlags);
1661 } 1657 }
1658 return true;
1662 } 1659 }
1663 1660
1664 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*) 1661 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*)
1665 { 1662 {
1666 } 1663 }
1667 1664
1668 #ifndef NDEBUG 1665 #ifndef NDEBUG
1669 1666
1670 void LayoutObject::showTreeForThis() const 1667 void LayoutObject::showTreeForThis() const
1671 { 1668 {
(...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after
3727 const blink::LayoutObject* root = object1; 3724 const blink::LayoutObject* root = object1;
3728 while (root->parent()) 3725 while (root->parent())
3729 root = root->parent(); 3726 root = root->parent();
3730 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3727 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3731 } else { 3728 } else {
3732 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3729 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3733 } 3730 }
3734 } 3731 }
3735 3732
3736 #endif 3733 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698