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

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

Issue 686633002: First pass at removing position:fixed. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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) 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 30 matching lines...) Expand all
41 ASSERT(!view.layoutState()); 41 ASSERT(!view.layoutState());
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 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position( ) == FixedPosition; 51 m_layoutOffset = m_next->m_layoutOffset + offset;
52 if (fixed) {
53 // FIXME: This doesn't work correctly with transforms.
54 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(), IsFixed);
55 m_layoutOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset;
56 } else {
57 m_layoutOffset = m_next->m_layoutOffset + offset;
58 }
59 52
60 if (renderer.isOutOfFlowPositioned() && !fixed) { 53 if (renderer.isOutOfFlowPositioned()) {
61 if (RenderObject* container = renderer.container()) { 54 if (RenderObject* container = renderer.container()) {
62 if (container->style()->hasInFlowPosition() && container->isRenderIn line()) 55 if (container->style()->hasInFlowPosition() && container->isRenderIn line())
63 m_layoutOffset += toRenderInline(container)->offsetForInFlowPosi tionedInline(renderer); 56 m_layoutOffset += toRenderInline(container)->offsetForInFlowPosi tionedInline(renderer);
64 } 57 }
65 } 58 }
66 59
67 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present. 60 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
68 } 61 }
69 62
70 LayoutState::LayoutState(RenderObject& root) 63 LayoutState::LayoutState(RenderObject& root)
(...skipping 15 matching lines...) Expand all
86 79
87 LayoutState::~LayoutState() 80 LayoutState::~LayoutState()
88 { 81 {
89 if (m_renderer.view()->layoutState()) { 82 if (m_renderer.view()->layoutState()) {
90 ASSERT(m_renderer.view()->layoutState() == this); 83 ASSERT(m_renderer.view()->layoutState() == this);
91 m_renderer.view()->popLayoutState(); 84 m_renderer.view()->popLayoutState();
92 } 85 }
93 } 86 }
94 87
95 } // namespace blink 88 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/ClipRects.h ('k') | sky/engine/core/rendering/PaintInvalidationState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698