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

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

Issue 1820483002: Untangle multicol coordinate space conversion from offsetFromContainer(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review comment. 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 // If this box has a transform, it acts as a fixed position container fo r fixed descendants, 1700 // If this box has a transform, it acts as a fixed position container fo r fixed descendants,
1701 // and may itself also be fixed position. So propagate 'fixed' up only i f this box is fixed position. 1701 // and may itself also be fixed position. So propagate 'fixed' up only i f this box is fixed position.
1702 mode &= ~IsFixed; 1702 mode &= ~IsFixed;
1703 } else if (isFixedPos) { 1703 } else if (isFixedPos) {
1704 mode |= IsFixed; 1704 mode |= IsFixed;
1705 } 1705 }
1706 1706
1707 LayoutBoxModelObject::mapAncestorToLocal(ancestor, transformState, mode); 1707 LayoutBoxModelObject::mapAncestorToLocal(ancestor, transformState, mode);
1708 } 1708 }
1709 1709
1710 LayoutSize LayoutBox::offsetFromContainer(const LayoutObject* o, const LayoutPoi nt& point, bool* offsetDependsOnPoint) const 1710 LayoutSize LayoutBox::offsetFromContainer(const LayoutObject* o) const
1711 { 1711 {
1712 ASSERT(o == container()); 1712 ASSERT(o == container());
1713 1713
1714 LayoutSize offset; 1714 LayoutSize offset;
1715 if (isInFlowPositioned()) 1715 if (isInFlowPositioned())
1716 offset += offsetForInFlowPosition(); 1716 offset += offsetForInFlowPosition();
1717 1717
1718 offset += topLeftLocationOffset(); 1718 offset += topLeftLocationOffset();
1719 if (o->isLayoutFlowThread()) {
1720 // So far the point has been in flow thread coordinates (i.e. as if ever ything in
1721 // the fragmentation context lived in one tall single column). Convert i t to a
1722 // visual point now.
1723 LayoutPoint pointInContainer = point + offset;
1724 offset += o->columnOffset(pointInContainer);
1725 if (offsetDependsOnPoint)
1726 *offsetDependsOnPoint = true;
1727 }
1728 1719
1729 if (o->hasOverflowClip()) 1720 if (o->hasOverflowClip())
1730 offset -= toLayoutBox(o)->scrolledContentOffset(); 1721 offset -= toLayoutBox(o)->scrolledContentOffset();
1731 1722
1732 if (style()->position() == AbsolutePosition && o->isInFlowPositioned() && o- >isLayoutInline()) 1723 if (style()->position() == AbsolutePosition && o->isInFlowPositioned() && o- >isLayoutInline())
1733 offset += toLayoutInline(o)->offsetForInFlowPositionedInline(*this); 1724 offset += toLayoutInline(o)->offsetForInFlowPositionedInline(*this);
1734 1725
1735 return offset; 1726 return offset;
1736 } 1727 }
1737 1728
(...skipping 2975 matching lines...) Expand 10 before | Expand all | Expand 10 after
4713 4704
4714 void LayoutBox::clearPercentHeightDescendants() 4705 void LayoutBox::clearPercentHeightDescendants()
4715 { 4706 {
4716 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4707 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4717 if (curr->isBox()) 4708 if (curr->isBox())
4718 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4709 toLayoutBox(curr)->removeFromPercentHeightContainer();
4719 } 4710 }
4720 } 4711 }
4721 4712
4722 } // namespace blink 4713 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698