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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp

Issue 1625993004: [css-align] Avoid the style Reattach whenever align-items changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the parsing tests and skipping the rest. Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 290
291 // The 'auto' keyword computes to: 291 // The 'auto' keyword computes to:
292 // - 'stretch' for flex containers and grid containers, 292 // - 'stretch' for flex containers and grid containers,
293 // - 'start' for everything else. 293 // - 'start' for everything else.
294 if (style.alignItemsPosition() == ItemPositionAuto) { 294 if (style.alignItemsPosition() == ItemPositionAuto) {
295 if (isFlexOrGrid) 295 if (isFlexOrGrid)
296 style.setAlignItemsPosition(ItemPositionStretch); 296 style.setAlignItemsPosition(ItemPositionStretch);
297 } 297 }
298 298
299 // The 'auto' keyword computes to 'stretch' on absolutely-positioned element s,
300 // and to the computed value of align-items on the parent (minus
301 // any 'legacy' keywords) on all other boxes.
302 if (style.alignSelfPosition() == ItemPositionAuto) {
303 if (absolutePositioned)
304 style.setAlignSelfPosition(ItemPositionStretch);
305 else
306 style.setAlignSelf(parentStyle.alignItems());
307 }
308
309 // Block Containers: For table cells, the behavior of the 'auto' depends on the computed 299 // Block Containers: For table cells, the behavior of the 'auto' depends on the computed
310 // value of 'vertical-align', otherwise behaves as 'start'. 300 // value of 'vertical-align', otherwise behaves as 'start'.
311 // Flex Containers: 'auto' computes to 'flex-start'. 301 // Flex Containers: 'auto' computes to 'flex-start'.
312 // Grid Containers: 'auto' computes to 'start', and 'stretch' behaves like ' start'. 302 // Grid Containers: 'auto' computes to 'start', and 'stretch' behaves like ' start'.
313 if ((style.justifyContentPosition() == ContentPositionAuto) && (style.justif yContentDistribution() == ContentDistributionDefault)) { 303 if ((style.justifyContentPosition() == ContentPositionAuto) && (style.justif yContentDistribution() == ContentDistributionDefault)) {
314 if (style.isDisplayFlexibleOrGridBox()) { 304 if (style.isDisplayFlexibleOrGridBox()) {
315 if (style.isDisplayFlexibleBox()) 305 if (style.isDisplayFlexibleBox())
316 style.setJustifyContentPosition(ContentPositionFlexStart); 306 style.setJustifyContentPosition(ContentPositionFlexStart);
317 else 307 else
318 style.setJustifyContentPosition(ContentPositionStart); 308 style.setJustifyContentPosition(ContentPositionStart);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 // We want to count vertical percentage paddings/margins on flex items b ecause our current 473 // We want to count vertical percentage paddings/margins on flex items b ecause our current
484 // behavior is different from the spec and we want to gather compatibili ty data. 474 // behavior is different from the spec and we want to gather compatibili ty data.
485 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) 475 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t())
486 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); 476 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical);
487 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) 477 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( ))
488 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); 478 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal);
489 } 479 }
490 } 480 }
491 481
492 } 482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698