OLD | NEW |
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 243 } |
244 | 244 |
245 adjustStyleForAlignment(*style, *parentStyle); | 245 adjustStyleForAlignment(*style, *parentStyle); |
246 } | 246 } |
247 | 247 |
248 void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyl
e& parentStyle) | 248 void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyl
e& parentStyle) |
249 { | 249 { |
250 bool isFlexOrGrid = style.isDisplayFlexibleOrGridBox(); | 250 bool isFlexOrGrid = style.isDisplayFlexibleOrGridBox(); |
251 bool absolutePositioned = style.position() == AbsolutePosition; | 251 bool absolutePositioned = style.position() == AbsolutePosition; |
252 | 252 |
| 253 // The default overflow alignment is 'true' for flex or grid items/contaners
, 'safe' otherwise. |
| 254 if (style.justifyItemsOverflowAlignment() == OverflowAlignmentDefault) |
| 255 style.setJustifyItemsOverflowAlignment(isFlexOrGrid ? OverflowAlignmentT
rue : OverflowAlignmentSafe); |
| 256 if (style.justifySelfOverflowAlignment() == OverflowAlignmentDefault) |
| 257 style.setJustifySelfOverflowAlignment(isFlexOrGrid ? OverflowAlignmentTr
ue : OverflowAlignmentSafe); |
| 258 |
253 // If the inherited value of justify-items includes the legacy keyword, 'aut
o' | 259 // If the inherited value of justify-items includes the legacy keyword, 'aut
o' |
254 // computes to the the inherited value. | 260 // computes to the the inherited value. |
255 // Otherwise, auto computes to: | 261 // Otherwise, auto computes to: |
256 // - 'stretch' for flex containers and grid containers. | 262 // - 'stretch' for flex containers and grid containers. |
257 // - 'start' for everything else. | 263 // - 'start' for everything else. |
258 if (style.justifyItems() == ItemPositionAuto) { | 264 if (style.justifyItems() == ItemPositionAuto) { |
259 if (parentStyle.justifyItemsPositionType() == LegacyPosition) { | 265 if (parentStyle.justifyItemsPositionType() == LegacyPosition) { |
260 style.setJustifyItems(parentStyle.justifyItems()); | 266 style.setJustifyItems(parentStyle.justifyItems()); |
261 style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionTy
pe()); | 267 style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionTy
pe()); |
262 } else if (isFlexOrGrid) { | 268 } else if (isFlexOrGrid) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B
OX || style->display() == INLINE_BOX)) | 455 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B
OX || style->display() == INLINE_BOX)) |
450 style->setWritingMode(TopToBottomWritingMode); | 456 style->setWritingMode(TopToBottomWritingMode); |
451 | 457 |
452 if (parentStyle->isDisplayFlexibleOrGridBox()) { | 458 if (parentStyle->isDisplayFlexibleOrGridBox()) { |
453 style->setFloating(NoFloat); | 459 style->setFloating(NoFloat); |
454 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa
ting(), !m_useQuirksModeStyles)); | 460 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa
ting(), !m_useQuirksModeStyles)); |
455 } | 461 } |
456 } | 462 } |
457 | 463 |
458 } | 464 } |
OLD | NEW |