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/LayoutBox.cpp

Issue 2577893004: position:fixed content is not offset by relative positioned ancestors (Closed)
Patch Set: Created 4 years 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. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
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 4148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4159 const LayoutBox* child, 4159 const LayoutBox* child,
4160 const LayoutBoxModelObject* containerBlock) { 4160 const LayoutBoxModelObject* containerBlock) {
4161 if (!logicalTop.isAuto() || !logicalBottom.isAuto()) 4161 if (!logicalTop.isAuto() || !logicalBottom.isAuto())
4162 return; 4162 return;
4163 4163
4164 // FIXME: The static distance computation has not been patched for mixed 4164 // FIXME: The static distance computation has not been patched for mixed
4165 // writing modes. 4165 // writing modes.
4166 LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition(); 4166 LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition();
4167 for (LayoutObject* curr = child->parent(); curr && curr != containerBlock; 4167 for (LayoutObject* curr = child->parent(); curr && curr != containerBlock;
4168 curr = curr->container()) { 4168 curr = curr->container()) {
4169 if (!curr->isBox() || curr->isTableRow()) 4169 if (!curr->isBox())
4170 continue; 4170 continue;
4171 const LayoutBox& box = *toLayoutBox(curr); 4171 const LayoutBox& box = *toLayoutBox(curr);
4172 staticLogicalTop += box.logicalTop(); 4172 if (!curr->isTableRow())
4173 staticLogicalTop += box.logicalTop();
mstensho (USE GERRIT) 2016/12/16 11:53:00 The table rows change here doesn't look right. I s
Anton Obzhirov 2016/12/16 14:46:31 Will do, probably I already got an issue with a la
4174 if (box.isInFlowPositioned())
4175 staticLogicalTop += box.offsetForInFlowPosition().height();
4173 if (!box.isLayoutFlowThread()) 4176 if (!box.isLayoutFlowThread())
4174 continue; 4177 continue;
4175 // We're walking out of a flowthread here. This flow thread is not in the 4178 // We're walking out of a flowthread here. This flow thread is not in the
4176 // containing block chain, so we need to convert the position from the 4179 // containing block chain, so we need to convert the position from the
4177 // coordinate space of this flowthread to the containing coordinate space. 4180 // coordinate space of this flowthread to the containing coordinate space.
4178 // The inline position cannot affect the block position, so we don't bother 4181 // The inline position cannot affect the block position, so we don't bother
4179 // calculating it. 4182 // calculating it.
4180 LayoutUnit dummyInlinePosition; 4183 LayoutUnit dummyInlinePosition;
4181 toLayoutFlowThread(box).flowThreadToContainingCoordinateSpace( 4184 toLayoutFlowThread(box).flowThreadToContainingCoordinateSpace(
4182 staticLogicalTop, dummyInlinePosition); 4185 staticLogicalTop, dummyInlinePosition);
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
5660 block->adjustChildDebugRect(rect); 5663 block->adjustChildDebugRect(rect);
5661 5664
5662 return rect; 5665 return rect;
5663 } 5666 }
5664 5667
5665 bool LayoutBox::shouldClipOverflow() const { 5668 bool LayoutBox::shouldClipOverflow() const {
5666 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); 5669 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip();
5667 } 5670 }
5668 5671
5669 } // namespace blink 5672 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698