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

Side by Side Diff: Source/core/layout/LayoutBlockFlow.cpp

Issue 1343163005: Remove special pagination code for floats and out-of-flow objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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/layout/LayoutBlock.cpp ('k') | Source/core/layout/LayoutState.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 // Create the special object entry & append it to the list 2278 // Create the special object entry & append it to the list
2279 2279
2280 OwnPtr<FloatingObject> newObj = FloatingObject::create(&floatBox); 2280 OwnPtr<FloatingObject> newObj = FloatingObject::create(&floatBox);
2281 2281
2282 // Our location is irrelevant if we're unsplittable or no pagination is in e ffect. 2282 // Our location is irrelevant if we're unsplittable or no pagination is in e ffect.
2283 // Just go ahead and lay out the float. 2283 // Just go ahead and lay out the float.
2284 bool isChildLayoutBlock = floatBox.isLayoutBlock(); 2284 bool isChildLayoutBlock = floatBox.isLayoutBlock();
2285 if (isChildLayoutBlock && !floatBox.needsLayout() && view()->layoutState()-> pageLogicalHeightChanged()) 2285 if (isChildLayoutBlock && !floatBox.needsLayout() && view()->layoutState()-> pageLogicalHeightChanged())
2286 floatBox.setChildNeedsLayout(MarkOnlyThis); 2286 floatBox.setChildNeedsLayout(MarkOnlyThis);
2287 2287
2288 bool needsBlockDirectionLocationSetBeforeLayout = isChildLayoutBlock && view ()->layoutState()->needsBlockDirectionLocationSetBeforeLayout(); 2288 floatBox.layoutIfNeeded();
2289 if (!needsBlockDirectionLocationSetBeforeLayout || isWritingModeRoot()) { // We are unsplittable if we're a block flow root.
2290 floatBox.layoutIfNeeded();
2291 } else {
2292 floatBox.updateLogicalWidth();
2293 floatBox.computeAndSetBlockDirectionMargins(this);
2294 }
2295 2289
2296 setLogicalWidthForFloat(*newObj, logicalWidthForChild(floatBox) + marginStar tForChild(floatBox) + marginEndForChild(floatBox)); 2290 setLogicalWidthForFloat(*newObj, logicalWidthForChild(floatBox) + marginStar tForChild(floatBox) + marginEndForChild(floatBox));
2297 2291
2298 return m_floatingObjects->add(newObj.release()); 2292 return m_floatingObjects->add(newObj.release());
2299 } 2293 }
2300 2294
2301 void LayoutBlockFlow::removeFloatingObject(LayoutBox* floatBox) 2295 void LayoutBlockFlow::removeFloatingObject(LayoutBox* floatBox)
2302 { 2296 {
2303 if (m_floatingObjects) { 2297 if (m_floatingObjects) {
2304 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 2298 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
3083 FrameView* frameView = document().view(); 3077 FrameView* frameView = document().view();
3084 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3078 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3085 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3079 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3086 if (size().height() < visibleHeight) 3080 if (size().height() < visibleHeight)
3087 top += (visibleHeight - size().height()) / 2; 3081 top += (visibleHeight - size().height()) / 2;
3088 setY(top); 3082 setY(top);
3089 dialog->setCentered(top); 3083 dialog->setCentered(top);
3090 } 3084 }
3091 3085
3092 } // namespace blink 3086 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/layout/LayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698