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

Unified Diff: Source/core/rendering/RenderFlowThread.cpp

Issue 459603002: Remove RenderFlowThread::adjustedPositionRelativeToOffsetParent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderFlowThread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFlowThread.cpp
diff --git a/Source/core/rendering/RenderFlowThread.cpp b/Source/core/rendering/RenderFlowThread.cpp
index b699e66b1fdbd06cc991d75e3fad392dfa3525f8..71e7e3c6f7d11ff37bb7eea02bbfd18cd8c57387 100644
--- a/Source/core/rendering/RenderFlowThread.cpp
+++ b/Source/core/rendering/RenderFlowThread.cpp
@@ -36,7 +36,6 @@
#include "core/rendering/HitTestRequest.h"
#include "core/rendering/HitTestResult.h"
#include "core/rendering/PaintInfo.h"
-#include "core/rendering/RenderInline.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderMultiColumnSet.h"
#include "core/rendering/RenderView.h"
@@ -176,82 +175,6 @@ void RenderFlowThread::repaintRectangleInRegions(const LayoutRect& repaintRect)
}
}
-LayoutPoint RenderFlowThread::adjustedPositionRelativeToOffsetParent(const RenderBoxModelObject& boxModelObject, const LayoutPoint& startPoint)
-{
- LayoutPoint referencePoint = startPoint;
-
- // FIXME: This needs to be adapted for different writing modes inside the flow thread.
- RenderMultiColumnSet* startColumnSet = columnSetAtBlockOffset(referencePoint.y());
- if (startColumnSet) {
- // Take into account the offset coordinates of the columnSet.
- RenderObject* currObject = startColumnSet;
- for (Element* currOffsetParentElement = currObject->offsetParent(); currOffsetParentElement; currOffsetParentElement = currObject->offsetParent()) {
- RenderObject* currOffsetParentRenderer = currOffsetParentElement->renderer();
- if (!currOffsetParentRenderer)
- break;
- if (currObject->isBoxModelObject())
- referencePoint.move(toRenderBoxModelObject(currObject)->offsetLeft(), toRenderBoxModelObject(currObject)->offsetTop());
-
- // Since we're looking for the offset relative to the body, we must also
- // take into consideration the borders of the columnSet's offsetParent.
- if (currOffsetParentRenderer->isBox() && !currOffsetParentRenderer->isBody())
- referencePoint.move(toRenderBox(currOffsetParentRenderer)->borderLeft(), toRenderBox(currOffsetParentRenderer)->borderTop());
-
- currObject = currOffsetParentRenderer;
- }
-
- // We need to check if any of this box's containing blocks start in a different columnSet
- // and if so, drop the object's top position (which was computed relative to its containing block
- // and is no longer valid) and recompute it using the columnSet in which it flows as reference.
- bool wasComputedRelativeToOtherRegion = false;
- const RenderBlock* objContainingBlock = boxModelObject.containingBlock();
- while (objContainingBlock) {
- // Check if this object is in a different columnSet.
- RenderMultiColumnSet* parentStartRegion = 0;
- RenderMultiColumnSet* parentEndRegion = 0;
- getRegionRangeForBox(objContainingBlock, parentStartRegion, parentEndRegion);
- if (parentStartRegion && parentStartRegion != startColumnSet) {
- wasComputedRelativeToOtherRegion = true;
- break;
- }
- objContainingBlock = objContainingBlock->containingBlock();
- }
-
- if (wasComputedRelativeToOtherRegion) {
- // Get the logical top coordinate of the current object.
- LayoutUnit top = 0;
- if (boxModelObject.isRenderBlock()) {
- top = toRenderBlock(boxModelObject).offsetFromLogicalTopOfFirstPage();
- } else {
- if (boxModelObject.containingBlock())
- top = boxModelObject.containingBlock()->offsetFromLogicalTopOfFirstPage();
-
- if (boxModelObject.isBox())
- top += toRenderBox(boxModelObject).topLeftLocation().y();
- else if (boxModelObject.isRenderInline())
- top -= toRenderInline(boxModelObject).borderTop();
- }
-
- // Get the logical top of the columnSet this object starts in
- // and compute the object's top, relative to the columnSet's top.
- LayoutUnit regionLogicalTop = startColumnSet->pageLogicalTopForOffset(top);
- LayoutUnit topRelativeToRegion = top - regionLogicalTop;
- referencePoint.setY(startColumnSet->offsetTop() + topRelativeToRegion);
-
- // Since the top has been overriden, check if the
- // relative positioning must be reconsidered.
- if (boxModelObject.isRelPositioned())
- referencePoint.move(0, boxModelObject.relativePositionOffset().height());
- }
-
- // Since we're looking for the offset relative to the body, we must also
- // take into consideration the borders of the columnSet.
- referencePoint.move(startColumnSet->borderLeft(), startColumnSet->borderTop());
- }
-
- return referencePoint;
-}
-
LayoutUnit RenderFlowThread::pageLogicalHeightForOffset(LayoutUnit offset)
{
RenderMultiColumnSet* columnSet = columnSetAtBlockOffset(offset);
« no previous file with comments | « Source/core/rendering/RenderFlowThread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698