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

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

Issue 138443013: Remove iframe@seamless (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Include remove tests Created 6 years, 11 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/RenderView.h ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 0e3c3f240697022aa13ea42e511b8f3a59b63ed2..1d15878e9d682af4c0fd407a9e3f44c23492fe5d 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -192,67 +192,18 @@ void RenderView::checkLayoutState(const LayoutState& state)
}
#endif
-static RenderBox* enclosingSeamlessRenderer(const Document& doc)
-{
- Element* ownerElement = doc.seamlessParentIFrame();
- if (!ownerElement)
- return 0;
- return ownerElement->renderBox();
-}
-
void RenderView::addChild(RenderObject* newChild, RenderObject* beforeChild)
eseidel 2014/01/25 02:07:04 This whole method can be removed.
{
- // Seamless iframes are considered part of an enclosing render flow thread from the parent document. This is necessary for them to look
- // up regions in the parent document during layout.
- if (newChild && !newChild->isRenderFlowThread()) {
- RenderBox* seamlessBox = enclosingSeamlessRenderer(document());
- if (seamlessBox && seamlessBox->flowThreadContainingBlock())
- newChild->setFlowThreadState(seamlessBox->flowThreadState());
- }
RenderBlock::addChild(newChild, beforeChild);
}
-bool RenderView::initializeLayoutState(LayoutState& state)
+void RenderView::initializeLayoutState(LayoutState& state)
{
- bool isSeamlessAncestorInFlowThread = false;
-
// FIXME: May be better to push a clip and avoid issuing offscreen repaints.
state.m_clipped = false;
-
- // Check the writing mode of the seamless ancestor. It has to match our document's writing mode, or we won't inherit any
- // pagination information.
- RenderBox* seamlessAncestor = enclosingSeamlessRenderer(document());
- LayoutState* seamlessLayoutState = seamlessAncestor ? seamlessAncestor->view()->layoutState() : 0;
- bool shouldInheritPagination = seamlessLayoutState && !m_pageLogicalHeight && seamlessAncestor->style()->writingMode() == style()->writingMode();
-
- state.m_pageLogicalHeight = shouldInheritPagination ? seamlessLayoutState->m_pageLogicalHeight : m_pageLogicalHeight;
- state.m_pageLogicalHeightChanged = shouldInheritPagination ? seamlessLayoutState->m_pageLogicalHeightChanged : m_pageLogicalHeightChanged;
+ state.m_pageLogicalHeight = m_pageLogicalHeight;
+ state.m_pageLogicalHeightChanged = m_pageLogicalHeightChanged;
state.m_isPaginated = state.m_pageLogicalHeight;
- if (state.m_isPaginated && shouldInheritPagination) {
- // Set up the correct pagination offset. We can use a negative offset in order to push the top of the RenderView into its correct place
- // on a page. We can take the iframe's offset from the logical top of the first page and make the negative into the pagination offset within the child
- // view.
- bool isFlipped = seamlessAncestor->style()->isFlippedBlocksWritingMode();
- LayoutSize layoutOffset = seamlessLayoutState->layoutOffset();
- LayoutSize iFrameOffset(layoutOffset.width() + seamlessAncestor->x() + (!isFlipped ? seamlessAncestor->borderLeft() + seamlessAncestor->paddingLeft() :
- seamlessAncestor->borderRight() + seamlessAncestor->paddingRight()),
- layoutOffset.height() + seamlessAncestor->y() + (!isFlipped ? seamlessAncestor->borderTop() + seamlessAncestor->paddingTop() :
- seamlessAncestor->borderBottom() + seamlessAncestor->paddingBottom()));
-
- LayoutSize offsetDelta = seamlessLayoutState->m_pageOffset - iFrameOffset;
- state.m_pageOffset = offsetDelta;
-
- // Set the current render flow thread to point to our ancestor. This will allow the seamless document to locate the correct
- // regions when doing a layout.
- if (seamlessAncestor->flowThreadContainingBlock()) {
- flowThreadController()->setCurrentRenderFlowThread(seamlessAncestor->view()->flowThreadController()->currentRenderFlowThread());
- isSeamlessAncestorInFlowThread = true;
- }
- }
-
- // FIXME: We need to make line grids and exclusions work with seamless iframes as well here. Basically all layout state information needs
- // to propagate here and not just pagination information.
- return isSeamlessAncestorInFlowThread;
}
// The algorithm below assumes this is a full layout. In case there are previously computed values for regions, supplemental steps are taken
@@ -333,7 +284,7 @@ void RenderView::layout()
return;
LayoutState state;
- bool isSeamlessAncestorInFlowThread = initializeLayoutState(state);
+ initializeLayoutState(state);
m_pageLogicalHeightChanged = false;
m_layoutState = &state;
@@ -353,9 +304,6 @@ void RenderView::layout()
#endif
m_layoutState = 0;
clearNeedsLayout();
-
- if (isSeamlessAncestorInFlowThread)
- flowThreadController()->setCurrentRenderFlowThread(0);
}
void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698