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

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

Issue 708843002: Remove -webkit-auto, -webkit-center, -webkit-left, -webkit-right. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT 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) 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 LayoutUnit startPosition = borderStart() + paddingStart(); 130 LayoutUnit startPosition = borderStart() + paddingStart();
131 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 131 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
132 startPosition -= verticalScrollbarWidth(); 132 startPosition -= verticalScrollbarWidth();
133 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + ava ilableLogicalWidth(); 133 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + ava ilableLogicalWidth();
134 134
135 LayoutUnit childMarginStart = marginStartForChild(child); 135 LayoutUnit childMarginStart = marginStartForChild(child);
136 LayoutUnit newPosition = startPosition + childMarginStart; 136 LayoutUnit newPosition = startPosition + childMarginStart;
137 137
138 // If the child has an offset from the content edge to avoid floats then use that, otherwise let any negative 138 // If the child has an offset from the content edge to avoid floats then use that, otherwise let any negative
139 // margin pull it back over the content edge or any positive margin push it out. 139 // margin pull it back over the content edge or any positive margin push it out.
140 // If the child is being centred then the margin calculated to do that has f actored in any offset required to 140 if (child->style()->marginStartUsing(style()).isAuto())
141 // avoid floats, so use it if necessary.
142 if (style()->textAlign() == WEBKIT_CENTER || child->style()->marginStartUsin g(style()).isAuto())
143 newPosition = std::max(newPosition, childMarginStart); 141 newPosition = std::max(newPosition, childMarginStart);
144 142
145 child->setX(style()->isLeftToRightDirection() ? newPosition : totalAvailable LogicalWidth - newPosition - logicalWidthForChild(child)); 143 child->setX(style()->isLeftToRightDirection() ? newPosition : totalAvailable LogicalWidth - newPosition - logicalWidthForChild(child));
146 } 144 }
147 145
148 void RenderBlockFlow::layoutBlockChild(RenderBox* child) 146 void RenderBlockFlow::layoutBlockChild(RenderBox* child)
149 { 147 {
150 child->computeAndSetBlockDirectionMargins(this); 148 child->computeAndSetBlockDirectionMargins(this);
151 LayoutUnit marginBefore = marginBeforeForChild(child); 149 LayoutUnit marginBefore = marginBeforeForChild(child);
152 child->setY(logicalHeight() + marginBefore); 150 child->setY(logicalHeight() + marginBefore);
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 349 }
352 return logicalRight; 350 return logicalRight;
353 } 351 }
354 352
355 RootInlineBox* RenderBlockFlow::createRootInlineBox() 353 RootInlineBox* RenderBlockFlow::createRootInlineBox()
356 { 354 {
357 return new RootInlineBox(*this); 355 return new RootInlineBox(*this);
358 } 356 }
359 357
360 } // namespace blink 358 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/editing/EditingStyle.cpp ('k') | sky/engine/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698