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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 } | 398 } |
399 } | 399 } |
400 | 400 |
401 void StyleAdjuster::adjustStyleForDisplay(ComputedStyle& style, const ComputedSt
yle& parentStyle, Document* document) | 401 void StyleAdjuster::adjustStyleForDisplay(ComputedStyle& style, const ComputedSt
yle& parentStyle, Document* document) |
402 { | 402 { |
403 if (style.display() == BLOCK && !style.isFloating()) | 403 if (style.display() == BLOCK && !style.isFloating()) |
404 return; | 404 return; |
405 | 405 |
406 // FIXME: Don't support this mutation for pseudo styles like first-letter or
first-line, since it's not completely | 406 // FIXME: Don't support this mutation for pseudo styles like first-letter or
first-line, since it's not completely |
407 // clear how that should work. | 407 // clear how that should work. |
408 if (style.display() == INLINE && style.styleType() == NOPSEUDO && style.writ
ingMode() != parentStyle.writingMode()) | 408 if (style.display() == INLINE && style.styleType() == NOPSEUDO && style.getW
ritingMode() != parentStyle.getWritingMode()) |
409 style.setDisplay(INLINE_BLOCK); | 409 style.setDisplay(INLINE_BLOCK); |
410 | 410 |
411 // After performing the display mutation, check table rows. We do not honor
position: relative table rows or cells. | 411 // After performing the display mutation, check table rows. We do not honor
position: relative table rows or cells. |
412 // This has been established for position: relative in CSS2.1 (and caused a
crash in containingBlock() | 412 // This has been established for position: relative in CSS2.1 (and caused a
crash in containingBlock() |
413 // on some sites). | 413 // on some sites). |
414 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G
ROUP | 414 if ((style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW_G
ROUP |
415 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW
) | 415 || style.display() == TABLE_FOOTER_GROUP || style.display() == TABLE_ROW
) |
416 && style.position() == RelativePosition) | 416 && style.position() == RelativePosition) |
417 style.setPosition(StaticPosition); | 417 style.setPosition(StaticPosition); |
418 | 418 |
419 // writing-mode does not apply to table row groups, table column groups, tab
le rows, and table columns. | 419 // writing-mode does not apply to table row groups, table column groups, tab
le rows, and table columns. |
420 // FIXME: Table cells should be allowed to be perpendicular or flipped with
respect to the table, though. | 420 // FIXME: Table cells should be allowed to be perpendicular or flipped with
respect to the table, though. |
421 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP
|| style.display() == TABLE_FOOTER_GROUP | 421 if (style.display() == TABLE_COLUMN || style.display() == TABLE_COLUMN_GROUP
|| style.display() == TABLE_FOOTER_GROUP |
422 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW
|| style.display() == TABLE_ROW_GROUP | 422 || style.display() == TABLE_HEADER_GROUP || style.display() == TABLE_ROW
|| style.display() == TABLE_ROW_GROUP |
423 || style.display() == TABLE_CELL) | 423 || style.display() == TABLE_CELL) |
424 style.setWritingMode(parentStyle.writingMode()); | 424 style.setWritingMode(parentStyle.getWritingMode()); |
425 | 425 |
426 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow
setting | 426 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow
setting |
427 // of block-flow to anything other than TopToBottomWritingMode. | 427 // of block-flow to anything other than TopToBottomWritingMode. |
428 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. | 428 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. |
429 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX
|| style.display() == INLINE_BOX)) | 429 if (style.getWritingMode() != TopToBottomWritingMode && (style.display() ==
BOX || style.display() == INLINE_BOX)) |
430 style.setWritingMode(TopToBottomWritingMode); | 430 style.setWritingMode(TopToBottomWritingMode); |
431 | 431 |
432 if (parentStyle.isDisplayFlexibleOrGridBox()) { | 432 if (parentStyle.isDisplayFlexibleOrGridBox()) { |
433 style.setFloating(NoFloat); | 433 style.setFloating(NoFloat); |
434 style.setDisplay(equivalentBlockDisplay(style.display())); | 434 style.setDisplay(equivalentBlockDisplay(style.display())); |
435 | 435 |
436 // We want to count vertical percentage paddings/margins on flex items b
ecause our current | 436 // We want to count vertical percentage paddings/margins on flex items b
ecause our current |
437 // behavior is different from the spec and we want to gather compatibili
ty data. | 437 // behavior is different from the spec and we want to gather compatibili
ty data. |
438 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen
t()) | 438 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen
t()) |
439 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert
ical); | 439 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert
ical); |
440 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent(
)) | 440 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent(
)) |
441 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti
cal); | 441 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti
cal); |
442 } | 442 } |
443 } | 443 } |
444 | 444 |
445 } // namespace blink | 445 } // namespace blink |
OLD | NEW |