| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 6 * reserved. |
| 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) |
| 8 * | 10 * |
| 9 * This library is free software; you can redistribute it and/or | 11 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 12 * modify it under the terms of the GNU Library General Public |
| 11 * License as published by the Free Software Foundation; either | 13 * License as published by the Free Software Foundation; either |
| 12 * version 2 of the License, or (at your option) any later version. | 14 * version 2 of the License, or (at your option) any later version. |
| 13 * | 15 * |
| 14 * This library is distributed in the hope that it will be useful, | 16 * This library is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Library General Public License for more details. | 19 * Library General Public License for more details. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 #include "core/ComputedStyleBaseConstants.h" | 31 #include "core/ComputedStyleBaseConstants.h" |
| 30 #include <cstddef> | 32 #include <cstddef> |
| 31 | 33 |
| 32 namespace blink { | 34 namespace blink { |
| 33 | 35 |
| 34 // TODO(sashab): Change these enums to enum classes with an unsigned underlying | 36 // TODO(sashab): Change these enums to enum classes with an unsigned underlying |
| 35 // type. Enum classes provide better type safety, and forcing an unsigned | 37 // type. Enum classes provide better type safety, and forcing an unsigned |
| 36 // underlying type prevents msvc from interpreting enums as negative numbers. | 38 // underlying type prevents msvc from interpreting enums as negative numbers. |
| 37 // See: crbug.com/628043 | 39 // See: crbug.com/628043 |
| 38 | 40 |
| 39 // Sides used when drawing borders and outlines. The values should run clockwise
from top. | 41 // Sides used when drawing borders and outlines. The values should run clockwise |
| 42 // from top. |
| 40 enum BoxSide { BSTop, BSRight, BSBottom, BSLeft }; | 43 enum BoxSide { BSTop, BSRight, BSBottom, BSLeft }; |
| 41 | 44 |
| 42 enum StyleRecalcChange { | 45 enum StyleRecalcChange { |
| 43 NoChange, | 46 NoChange, |
| 44 NoInherit, | 47 NoInherit, |
| 45 UpdatePseudoElements, | 48 UpdatePseudoElements, |
| 46 IndependentInherit, | 49 IndependentInherit, |
| 47 Inherit, | 50 Inherit, |
| 48 Force, | 51 Force, |
| 49 Reattach, | 52 Reattach, |
| 50 ReattachNoLayoutObject | 53 ReattachNoLayoutObject |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 static const size_t PrintColorAdjustBits = 1; | 56 static const size_t PrintColorAdjustBits = 1; |
| 54 enum PrintColorAdjust { PrintColorAdjustEconomy, PrintColorAdjustExact }; | 57 enum PrintColorAdjust { PrintColorAdjustEconomy, PrintColorAdjustExact }; |
| 55 | 58 |
| 56 // Static pseudo styles. Dynamic ones are produced on the fly. | 59 // Static pseudo styles. Dynamic ones are produced on the fly. |
| 57 enum PseudoId { | 60 enum PseudoId { |
| 58 // The order must be NOP ID, public IDs, and then internal IDs. | 61 // The order must be NOP ID, public IDs, and then internal IDs. |
| 59 // If you add or remove a public ID, you must update _pseudoBits in ComputedSt
yle. | 62 // If you add or remove a public ID, you must update _pseudoBits in |
| 63 // ComputedStyle. |
| 60 PseudoIdNone, | 64 PseudoIdNone, |
| 61 PseudoIdFirstLine, | 65 PseudoIdFirstLine, |
| 62 PseudoIdFirstLetter, | 66 PseudoIdFirstLetter, |
| 63 PseudoIdBefore, | 67 PseudoIdBefore, |
| 64 PseudoIdAfter, | 68 PseudoIdAfter, |
| 65 PseudoIdBackdrop, | 69 PseudoIdBackdrop, |
| 66 PseudoIdSelection, | 70 PseudoIdSelection, |
| 67 PseudoIdFirstLineInherited, | 71 PseudoIdFirstLineInherited, |
| 68 PseudoIdScrollbar, | 72 PseudoIdScrollbar, |
| 69 // Internal IDs follow: | 73 // Internal IDs follow: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 84 (1 << (PseudoIdAfter - 1)) | | 88 (1 << (PseudoIdAfter - 1)) | |
| 85 (1 << (PseudoIdBackdrop - 1)) | 89 (1 << (PseudoIdBackdrop - 1)) |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 enum ColumnFill { ColumnFillBalance, ColumnFillAuto }; | 92 enum ColumnFill { ColumnFillBalance, ColumnFillAuto }; |
| 89 | 93 |
| 90 enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll }; | 94 enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll }; |
| 91 | 95 |
| 92 enum EBorderCollapse { BorderCollapseSeparate = 0, BorderCollapseCollapse = 1 }; | 96 enum EBorderCollapse { BorderCollapseSeparate = 0, BorderCollapseCollapse = 1 }; |
| 93 | 97 |
| 94 // These have been defined in the order of their precedence for border-collapsin
g. Do | 98 // These have been defined in the order of their precedence for |
| 95 // not change this order! This order also must match the order in CSSValueKeywor
ds.in. | 99 // border-collapsing. Do not change this order! This order also must match the |
| 100 // order in CSSValueKeywords.in. |
| 96 enum EBorderStyle { | 101 enum EBorderStyle { |
| 97 BorderStyleNone, | 102 BorderStyleNone, |
| 98 BorderStyleHidden, | 103 BorderStyleHidden, |
| 99 BorderStyleInset, | 104 BorderStyleInset, |
| 100 BorderStyleGroove, | 105 BorderStyleGroove, |
| 101 BorderStyleOutset, | 106 BorderStyleOutset, |
| 102 BorderStyleRidge, | 107 BorderStyleRidge, |
| 103 BorderStyleDotted, | 108 BorderStyleDotted, |
| 104 BorderStyleDashed, | 109 BorderStyleDashed, |
| 105 BorderStyleSolid, | 110 BorderStyleSolid, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 enum LineBreak { | 260 enum LineBreak { |
| 256 LineBreakAuto, | 261 LineBreakAuto, |
| 257 LineBreakLoose, | 262 LineBreakLoose, |
| 258 LineBreakNormal, | 263 LineBreakNormal, |
| 259 LineBreakStrict, | 264 LineBreakStrict, |
| 260 LineBreakAfterWhiteSpace | 265 LineBreakAfterWhiteSpace |
| 261 }; | 266 }; |
| 262 | 267 |
| 263 enum EResize { RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL }; | 268 enum EResize { RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL }; |
| 264 | 269 |
| 265 // The order of this enum must match the order of the list style types in CSSVal
ueKeywords.in. | 270 // The order of this enum must match the order of the list style types in |
| 271 // CSSValueKeywords.in. |
| 266 enum EListStyleType { | 272 enum EListStyleType { |
| 267 Disc, | 273 Disc, |
| 268 Circle, | 274 Circle, |
| 269 Square, | 275 Square, |
| 270 DecimalListStyle, | 276 DecimalListStyle, |
| 271 DecimalLeadingZero, | 277 DecimalLeadingZero, |
| 272 ArabicIndic, | 278 ArabicIndic, |
| 273 Bengali, | 279 Bengali, |
| 274 Cambodian, | 280 Cambodian, |
| 275 Khmer, | 281 Khmer, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 KatakanaIroha, | 327 KatakanaIroha, |
| 322 NoneListStyle | 328 NoneListStyle |
| 323 }; | 329 }; |
| 324 | 330 |
| 325 enum QuoteType { OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE }; | 331 enum QuoteType { OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE }; |
| 326 | 332 |
| 327 enum EAnimPlayState { AnimPlayStatePlaying, AnimPlayStatePaused }; | 333 enum EAnimPlayState { AnimPlayStatePlaying, AnimPlayStatePaused }; |
| 328 | 334 |
| 329 enum EWhiteSpace { NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP }; | 335 enum EWhiteSpace { NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP }; |
| 330 | 336 |
| 331 // The order of this enum must match the order of the text align values in CSSVa
lueKeywords.in. | 337 // The order of this enum must match the order of the text align values in |
| 338 // CSSValueKeywords.in. |
| 332 enum ETextAlign { | 339 enum ETextAlign { |
| 333 LEFT, | 340 LEFT, |
| 334 RIGHT, | 341 RIGHT, |
| 335 CENTER, | 342 CENTER, |
| 336 JUSTIFY, | 343 JUSTIFY, |
| 337 WEBKIT_LEFT, | 344 WEBKIT_LEFT, |
| 338 WEBKIT_RIGHT, | 345 WEBKIT_RIGHT, |
| 339 WEBKIT_CENTER, | 346 WEBKIT_CENTER, |
| 340 TASTART, | 347 TASTART, |
| 341 TAEND, | 348 TAEND, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // FIXME: Implement support for 'under left' and 'under right' values. | 387 // FIXME: Implement support for 'under left' and 'under right' values. |
| 381 TextUnderlinePositionAuto, | 388 TextUnderlinePositionAuto, |
| 382 TextUnderlinePositionUnder | 389 TextUnderlinePositionUnder |
| 383 }; | 390 }; |
| 384 | 391 |
| 385 enum EBreak { | 392 enum EBreak { |
| 386 BreakAuto, | 393 BreakAuto, |
| 387 BreakAvoid, | 394 BreakAvoid, |
| 388 BreakAvoidColumn, | 395 BreakAvoidColumn, |
| 389 BreakAvoidPage, | 396 BreakAvoidPage, |
| 390 // Values below are only allowed for break-after and break-before. Values abov
e are also | 397 // Values below are only allowed for break-after and break-before. Values |
| 391 // allowed for break-inside (in addition to break-after and break-before). | 398 // above are also allowed for break-inside (in addition to break-after and |
| 399 // break-before). |
| 392 BreakValueLastAllowedForBreakInside = BreakAvoidPage, | 400 BreakValueLastAllowedForBreakInside = BreakAvoidPage, |
| 393 BreakColumn, | 401 BreakColumn, |
| 394 BreakLeft, | 402 BreakLeft, |
| 395 BreakPage, | 403 BreakPage, |
| 396 BreakRecto, | 404 BreakRecto, |
| 397 BreakRight, | 405 BreakRight, |
| 398 BreakVerso, | 406 BreakVerso, |
| 399 BreakValueLastAllowedForBreakAfterAndBefore = BreakVerso, | 407 BreakValueLastAllowedForBreakAfterAndBefore = BreakVerso, |
| 400 BreakAlways // Only needed by {page,-webkit-column}-break-{after,before} shor
thands. | 408 BreakAlways // Only needed by {page,-webkit-column}-break-{after,before} |
| 409 // shorthands. |
| 401 }; | 410 }; |
| 402 | 411 |
| 403 enum class EEmptyCells : unsigned { Show, Hide }; | 412 enum class EEmptyCells : unsigned { Show, Hide }; |
| 404 | 413 |
| 405 enum class ECaptionSide : unsigned { Top, Bottom, Left, Right }; | 414 enum class ECaptionSide : unsigned { Top, Bottom, Left, Right }; |
| 406 | 415 |
| 407 enum EListStylePosition { ListStylePositionOutside, ListStylePositionInside }; | 416 enum EListStylePosition { ListStylePositionOutside, ListStylePositionInside }; |
| 408 | 417 |
| 409 enum ECursor { | 418 enum ECursor { |
| 410 // The following must match the order in CSSValueKeywords.in. | 419 // The following must match the order in CSSValueKeywords.in. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 441 CURSOR_HELP, | 450 CURSOR_HELP, |
| 442 CURSOR_ALL_SCROLL, | 451 CURSOR_ALL_SCROLL, |
| 443 CURSOR_WEBKIT_GRAB, | 452 CURSOR_WEBKIT_GRAB, |
| 444 CURSOR_WEBKIT_GRABBING, | 453 CURSOR_WEBKIT_GRABBING, |
| 445 | 454 |
| 446 // The following are handled as exceptions so don't need to match. | 455 // The following are handled as exceptions so don't need to match. |
| 447 CURSOR_COPY, | 456 CURSOR_COPY, |
| 448 CURSOR_NONE | 457 CURSOR_NONE |
| 449 }; | 458 }; |
| 450 | 459 |
| 451 // The order of this enum must match the order of the display values in CSSValue
Keywords.in. | 460 // The order of this enum must match the order of the display values in |
| 461 // CSSValueKeywords.in. |
| 452 enum class EDisplay : unsigned { | 462 enum class EDisplay : unsigned { |
| 453 Inline, | 463 Inline, |
| 454 Block, | 464 Block, |
| 455 ListItem, | 465 ListItem, |
| 456 InlineBlock, | 466 InlineBlock, |
| 457 Table, | 467 Table, |
| 458 InlineTable, | 468 InlineTable, |
| 459 TableRowGroup, | 469 TableRowGroup, |
| 460 TableHeaderGroup, | 470 TableHeaderGroup, |
| 461 TableFooterGroup, | 471 TableFooterGroup, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 ContainsContent = ContainsLayout | ContainsStyle | ContainsPaint, | 628 ContainsContent = ContainsLayout | ContainsStyle | ContainsPaint, |
| 619 }; | 629 }; |
| 620 inline Containment operator|(Containment a, Containment b) { | 630 inline Containment operator|(Containment a, Containment b) { |
| 621 return Containment(int(a) | int(b)); | 631 return Containment(int(a) | int(b)); |
| 622 } | 632 } |
| 623 inline Containment& operator|=(Containment& a, Containment b) { | 633 inline Containment& operator|=(Containment& a, Containment b) { |
| 624 return a = a | b; | 634 return a = a | b; |
| 625 } | 635 } |
| 626 | 636 |
| 627 enum ItemPosition { | 637 enum ItemPosition { |
| 628 ItemPositionAuto, // It will mean 'normal' after running the StyleAdjuster to
avoid resolving the initial values. | 638 ItemPositionAuto, // It will mean 'normal' after running the StyleAdjuster to |
| 639 // avoid resolving the initial values. |
| 629 ItemPositionNormal, | 640 ItemPositionNormal, |
| 630 ItemPositionStretch, | 641 ItemPositionStretch, |
| 631 ItemPositionBaseline, | 642 ItemPositionBaseline, |
| 632 ItemPositionLastBaseline, | 643 ItemPositionLastBaseline, |
| 633 ItemPositionCenter, | 644 ItemPositionCenter, |
| 634 ItemPositionStart, | 645 ItemPositionStart, |
| 635 ItemPositionEnd, | 646 ItemPositionEnd, |
| 636 ItemPositionSelfStart, | 647 ItemPositionSelfStart, |
| 637 ItemPositionSelfEnd, | 648 ItemPositionSelfEnd, |
| 638 ItemPositionFlexStart, | 649 ItemPositionFlexStart, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 663 }; | 674 }; |
| 664 | 675 |
| 665 enum ContentDistributionType { | 676 enum ContentDistributionType { |
| 666 ContentDistributionDefault, | 677 ContentDistributionDefault, |
| 667 ContentDistributionSpaceBetween, | 678 ContentDistributionSpaceBetween, |
| 668 ContentDistributionSpaceAround, | 679 ContentDistributionSpaceAround, |
| 669 ContentDistributionSpaceEvenly, | 680 ContentDistributionSpaceEvenly, |
| 670 ContentDistributionStretch | 681 ContentDistributionStretch |
| 671 }; | 682 }; |
| 672 | 683 |
| 673 // Reasonable maximum to prevent insane font sizes from causing crashes on some
platforms (such as Windows). | 684 // Reasonable maximum to prevent insane font sizes from causing crashes on some |
| 685 // platforms (such as Windows). |
| 674 static const float maximumAllowedFontSize = 10000.0f; | 686 static const float maximumAllowedFontSize = 10000.0f; |
| 675 | 687 |
| 676 enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine }; | 688 enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine }; |
| 677 enum TextIndentType { TextIndentNormal, TextIndentHanging }; | 689 enum TextIndentType { TextIndentNormal, TextIndentHanging }; |
| 678 | 690 |
| 679 enum CSSBoxType { | 691 enum CSSBoxType { |
| 680 BoxMissing = 0, | 692 BoxMissing = 0, |
| 681 MarginBox, | 693 MarginBox, |
| 682 BorderBox, | 694 BorderBox, |
| 683 PaddingBox, | 695 PaddingBox, |
| 684 ContentBox | 696 ContentBox |
| 685 }; | 697 }; |
| 686 | 698 |
| 687 enum ScrollSnapType { | 699 enum ScrollSnapType { |
| 688 ScrollSnapTypeNone, | 700 ScrollSnapTypeNone, |
| 689 ScrollSnapTypeMandatory, | 701 ScrollSnapTypeMandatory, |
| 690 ScrollSnapTypeProximity | 702 ScrollSnapTypeProximity |
| 691 }; | 703 }; |
| 692 | 704 |
| 693 enum AutoRepeatType { NoAutoRepeat, AutoFill, AutoFit }; | 705 enum AutoRepeatType { NoAutoRepeat, AutoFill, AutoFit }; |
| 694 | 706 |
| 695 } // namespace blink | 707 } // namespace blink |
| 696 | 708 |
| 697 #endif // ComputedStyleConstants_h | 709 #endif // ComputedStyleConstants_h |
| OLD | NEW |