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

Unified 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, 6 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/LayoutState.h ('k') | Source/core/rendering/RenderInline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/LayoutState.cpp
diff --git a/Source/core/rendering/LayoutState.cpp b/Source/core/rendering/LayoutState.cpp
index 2e682604835a2d4fc050ba9b6abb89136d2a4773..7de0f292751087a61dfa3001ed04024ad77c65b1 100644
--- a/Source/core/rendering/LayoutState.cpp
+++ b/Source/core/rendering/LayoutState.cpp
@@ -122,6 +122,33 @@ LayoutState::LayoutState(RenderBox& renderer, const LayoutSize& offset, LayoutUn
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
}
+LayoutState::LayoutState(RenderInline& renderer)
+ : m_next(renderer.view()->layoutState())
+ , m_renderer(renderer)
+{
+ ASSERT(m_next);
+
+ renderer.view()->pushLayoutState(*this);
+ m_cachedOffsetsEnabled = m_next->m_cachedOffsetsEnabled && renderer.supportsLayoutStateCachedOffsets();
+
+ m_paintOffset = m_next->m_paintOffset;
+ // Handle relative positioned inline.
+ if (renderer.style()->hasInFlowPosition() && renderer.layer())
+ m_paintOffset += renderer.layer()->offsetForInFlowPosition();
+
+ // RenderInline can't be out-of-flow positioned.
+
+ // The following can't apply to RenderInline so we just propagate them.
+ m_clipped = m_next->m_clipped;
+ m_clipRect = m_next->m_clipRect;
+
+ m_pageLogicalHeight = m_next->m_pageLogicalHeight;
+ m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged;
+ m_pageOffset = m_next->m_pageOffset;
+
+ m_columnInfo = m_next->m_columnInfo;
+}
+
inline static bool shouldDisableLayoutStateForSubtree(RenderObject& renderer)
{
RenderObject* object = &renderer;
« 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