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

Side by Side Diff: Source/core/rendering/LayoutState.cpp

Issue 358033003: Fix LayoutState for relatively positioned inlines (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Damn Windows. Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/LayoutState.h ('k') | Source/core/rendering/RenderInline.h » ('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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 m_isPaginated = m_pageLogicalHeight || m_next->m_columnInfo || rende rer.flowThreadContainingBlock(); 115 m_isPaginated = m_pageLogicalHeight || m_next->m_columnInfo || rende rer.flowThreadContainingBlock();
116 } 116 }
117 } 117 }
118 118
119 if (!m_columnInfo) 119 if (!m_columnInfo)
120 m_columnInfo = m_next->m_columnInfo; 120 m_columnInfo = m_next->m_columnInfo;
121 121
122 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present. 122 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
123 } 123 }
124 124
125 LayoutState::LayoutState(RenderInline& renderer)
126 : m_next(renderer.view()->layoutState())
127 , m_renderer(renderer)
128 {
129 ASSERT(m_next);
130
131 renderer.view()->pushLayoutState(*this);
132 m_cachedOffsetsEnabled = m_next->m_cachedOffsetsEnabled && renderer.supports LayoutStateCachedOffsets();
133
134 m_paintOffset = m_next->m_paintOffset;
135 // Handle relative positioned inline.
136 if (renderer.style()->hasInFlowPosition() && renderer.layer())
137 m_paintOffset += renderer.layer()->offsetForInFlowPosition();
138
139 // RenderInline can't be out-of-flow positioned.
140
141 // The following can't apply to RenderInline so we just propagate them.
142 m_clipped = m_next->m_clipped;
143 m_clipRect = m_next->m_clipRect;
144
145 m_pageLogicalHeight = m_next->m_pageLogicalHeight;
146 m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged;
147 m_pageOffset = m_next->m_pageOffset;
148
149 m_columnInfo = m_next->m_columnInfo;
150 }
151
125 inline static bool shouldDisableLayoutStateForSubtree(RenderObject& renderer) 152 inline static bool shouldDisableLayoutStateForSubtree(RenderObject& renderer)
126 { 153 {
127 RenderObject* object = &renderer; 154 RenderObject* object = &renderer;
128 while (object) { 155 while (object) {
129 if (object->supportsLayoutStateCachedOffsets()) 156 if (object->supportsLayoutStateCachedOffsets())
130 return true; 157 return true;
131 object = object->container(); 158 object = object->container();
132 } 159 }
133 return false; 160 return false;
134 } 161 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 213 }
187 214
188 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit& childLogicalOffset) 215 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit& childLogicalOffset)
189 { 216 {
190 if (!m_columnInfo || m_columnInfo->columnHeight()) 217 if (!m_columnInfo || m_columnInfo->columnHeight())
191 return; 218 return;
192 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); 219 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset));
193 } 220 }
194 221
195 } // namespace WebCore 222 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/LayoutState.h ('k') | Source/core/rendering/RenderInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698