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

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

Issue 1325323002: A block that establishes a new formatting context is pushed by floats. (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
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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 LayoutUnit startPosition = borderStart() + paddingStart(); 466 LayoutUnit startPosition = borderStart() + paddingStart();
467 LayoutUnit initialStartPosition = startPosition; 467 LayoutUnit initialStartPosition = startPosition;
468 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 468 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
469 startPosition -= verticalScrollbarWidth(); 469 startPosition -= verticalScrollbarWidth();
470 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + ava ilableLogicalWidth(); 470 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + ava ilableLogicalWidth();
471 471
472 LayoutUnit childMarginStart = marginStartForChild(child); 472 LayoutUnit childMarginStart = marginStartForChild(child);
473 LayoutUnit newPosition = startPosition + childMarginStart; 473 LayoutUnit newPosition = startPosition + childMarginStart;
474 474
475 LayoutUnit positionToAvoidFloats; 475 LayoutUnit positionToAvoidFloats;
476 if (child.avoidsFloats() && containsFloats() && !flowThreadContainingBlock() ) 476 if (child.avoidsFloats() && containsFloats())
477 positionToAvoidFloats = startOffsetForLine(logicalTopForChild(child), fa lse, logicalHeightForChild(child)); 477 positionToAvoidFloats = startOffsetForLine(logicalTopForChild(child), fa lse, logicalHeightForChild(child));
478 478
479 // If the child has an offset from the content edge to avoid floats then use that, otherwise let any negative 479 // If the child has an offset from the content edge to avoid floats then use that, otherwise let any negative
480 // margin pull it back over the content edge or any positive margin push it out. 480 // margin pull it back over the content edge or any positive margin push it out.
481 // If the child is being centred then the margin calculated to do that has f actored in any offset required to 481 // If the child is being centred then the margin calculated to do that has f actored in any offset required to
482 // avoid floats, so use it if necessary. 482 // avoid floats, so use it if necessary.
483 if (style()->textAlign() == WEBKIT_CENTER || child.style()->marginStartUsing (style()).isAuto()) 483 if (style()->textAlign() == WEBKIT_CENTER || child.style()->marginStartUsing (style()).isAuto())
484 newPosition = std::max(newPosition, positionToAvoidFloats + childMarginS tart); 484 newPosition = std::max(newPosition, positionToAvoidFloats + childMarginS tart);
485 else if (positionToAvoidFloats > initialStartPosition) 485 else if (positionToAvoidFloats > initialStartPosition)
486 newPosition = std::max(newPosition, positionToAvoidFloats); 486 newPosition = std::max(newPosition, positionToAvoidFloats);
(...skipping 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after
3070 FrameView* frameView = document().view(); 3070 FrameView* frameView = document().view();
3071 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3071 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3072 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3072 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3073 if (size().height() < visibleHeight) 3073 if (size().height() < visibleHeight)
3074 top += (visibleHeight - size().height()) / 2; 3074 top += (visibleHeight - size().height()) / 2;
3075 setY(top); 3075 setY(top);
3076 dialog->setCentered(top); 3076 dialog->setCentered(top);
3077 } 3077 }
3078 3078
3079 } // namespace blink 3079 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698