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

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

Issue 1786513002: Fix paint invalidation of paintInvalidationContainer itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 { 1631 {
1632 ASSERT_NOT_REACHED(); 1632 ASSERT_NOT_REACHED();
1633 return LayoutRect(); 1633 return LayoutRect();
1634 } 1634 }
1635 1635
1636 void LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const 1636 void LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const
1637 { 1637 {
1638 if (ancestor == this) 1638 if (ancestor == this)
1639 return; 1639 return;
1640 1640
1641 if (paintInvalidationState && paintInvalidationState->canMapToContainer(ance stor)) { 1641 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances tor)) {
1642 rect.move(paintInvalidationState->paintOffset()); 1642 paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect);
1643 if (paintInvalidationState->isClipped())
1644 rect.intersect(paintInvalidationState->clipRect());
1645 return; 1643 return;
1646 } 1644 }
1647 1645
1648 if (LayoutObject* parent = this->parent()) { 1646 if (LayoutObject* parent = this->parent()) {
1649 if (parent->hasOverflowClip()) { 1647 if (parent->hasOverflowClip()) {
1650 LayoutBox* parentBox = toLayoutBox(parent); 1648 LayoutBox* parentBox = toLayoutBox(parent);
1651 parentBox->mapScrollingContentsRectToBoxSpace(rect); 1649 parentBox->mapScrollingContentsRectToBoxSpace(rect);
1652 if (parent != ancestor) 1650 if (parent != ancestor)
1653 parentBox->applyOverflowClip(rect); 1651 parentBox->applyOverflowClip(rect);
1654 if (rect.isEmpty()) 1652 if (rect.isEmpty())
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 mapAncestorToLocal(ancestor, transformState, mode); 2226 mapAncestorToLocal(ancestor, transformState, mode);
2229 transformState.flatten(); 2227 transformState.flatten();
2230 return transformState.lastPlanarQuad(); 2228 return transformState.lastPlanarQuad();
2231 } 2229 }
2232 2230
2233 void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tran sformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const Pain tInvalidationState* paintInvalidationState) const 2231 void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tran sformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const Pain tInvalidationState* paintInvalidationState) const
2234 { 2232 {
2235 if (ancestor == this) 2233 if (ancestor == this)
2236 return; 2234 return;
2237 2235
2238 if (paintInvalidationState && paintInvalidationState->canMapToContainer(ance stor)) { 2236 if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ances tor)) {
2239 LayoutSize offset = paintInvalidationState->paintOffset(); 2237 LayoutSize offset = paintInvalidationState->paintOffset();
2240 if (const LayoutBox* layoutBox = isBox() ? toLayoutBox(this) : nullptr) 2238 if (const LayoutBox* layoutBox = isBox() ? toLayoutBox(this) : nullptr)
2241 offset += layoutBox->locationOffset(); 2239 offset += layoutBox->locationOffset();
2242 if (const PaintLayer* layer = style()->hasInFlowPosition() && hasLayer() ? toLayoutBoxModelObject(this)->layer() : nullptr) 2240 if (const PaintLayer* layer = style()->hasInFlowPosition() && hasLayer() ? toLayoutBoxModelObject(this)->layer() : nullptr)
2243 offset += layer->offsetForInFlowPosition(); 2241 offset += layer->offsetForInFlowPosition();
2244 transformState.move(offset); 2242 transformState.move(offset);
2245 return; 2243 return;
2246 } 2244 }
2247 2245
2248 if (wasFixed) 2246 if (wasFixed)
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
3728 const blink::LayoutObject* root = object1; 3726 const blink::LayoutObject* root = object1;
3729 while (root->parent()) 3727 while (root->parent())
3730 root = root->parent(); 3728 root = root->parent();
3731 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3729 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3732 } else { 3730 } else {
3733 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3731 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3734 } 3732 }
3735 } 3733 }
3736 3734
3737 #endif 3735 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698