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

Side by Side Diff: sky/engine/core/rendering/LayoutState.cpp

Issue 938193004: Remove dead position:relative code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 view.pushLayoutState(*this); 42 view.pushLayoutState(*this);
43 } 43 }
44 44
45 LayoutState::LayoutState(RenderBox& renderer, const LayoutSize& offset, bool con tainingBlockLogicalWidthChanged) 45 LayoutState::LayoutState(RenderBox& renderer, const LayoutSize& offset, bool con tainingBlockLogicalWidthChanged)
46 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged) 46 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged)
47 , m_next(renderer.view()->layoutState()) 47 , m_next(renderer.view()->layoutState())
48 , m_renderer(renderer) 48 , m_renderer(renderer)
49 { 49 {
50 renderer.view()->pushLayoutState(*this); 50 renderer.view()->pushLayoutState(*this);
51 m_layoutOffset = m_next->m_layoutOffset + offset; 51 m_layoutOffset = m_next->m_layoutOffset + offset;
52
53 if (renderer.isOutOfFlowPositioned()) {
54 if (RenderObject* container = renderer.container()) {
55 if (container->style()->hasInFlowPosition() && container->isRenderIn line())
56 m_layoutOffset += toRenderInline(container)->offsetForInFlowPosi tionedInline(renderer);
esprehn 2015/02/20 05:55:53 Isn't this position: absolute inside an inline?
ojan 2015/02/20 05:57:21 offsetForInFlowPositionedInline doesn't do anythin
57 }
58 }
59
60 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present. 52 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
61 } 53 }
62 54
63 LayoutState::LayoutState(RenderObject& root) 55 LayoutState::LayoutState(RenderObject& root)
64 : m_containingBlockLogicalWidthChanged(false) 56 : m_containingBlockLogicalWidthChanged(false)
65 , m_next(root.view()->layoutState()) 57 , m_next(root.view()->layoutState())
66 , m_renderer(root) 58 , m_renderer(root)
67 { 59 {
68 ASSERT(!m_next); 60 ASSERT(!m_next);
69 // We'll end up pushing in RenderView itself, so don't bother adding it. 61 // We'll end up pushing in RenderView itself, so don't bother adding it.
70 if (root.isRenderView()) 62 if (root.isRenderView())
71 return; 63 return;
72 64
73 root.view()->pushLayoutState(*this); 65 root.view()->pushLayoutState(*this);
74 66
75 RenderObject* container = root.container(); 67 RenderObject* container = root.container();
76 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTra nsforms); 68 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTra nsforms);
77 m_layoutOffset = LayoutSize(absContentPoint.x(), absContentPoint.y()); 69 m_layoutOffset = LayoutSize(absContentPoint.x(), absContentPoint.y());
78 } 70 }
79 71
80 LayoutState::~LayoutState() 72 LayoutState::~LayoutState()
81 { 73 {
82 if (m_renderer.view()->layoutState()) { 74 if (m_renderer.view()->layoutState()) {
83 ASSERT(m_renderer.view()->layoutState() == this); 75 ASSERT(m_renderer.view()->layoutState() == this);
84 m_renderer.view()->popLayoutState(); 76 m_renderer.view()->popLayoutState();
85 } 77 }
86 } 78 }
87 79
88 } // namespace blink 80 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698