| 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, 2011 Apple Inc. All | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 * rights reserved. | 6 * rights reserved. |
| 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 476 |
| 477 // background-clip | 477 // background-clip |
| 478 EFillBox backgroundClip() const { | 478 EFillBox backgroundClip() const { |
| 479 return static_cast<EFillBox>(m_background->background().clip()); | 479 return static_cast<EFillBox>(m_background->background().clip()); |
| 480 } | 480 } |
| 481 | 481 |
| 482 // Border properties. | 482 // Border properties. |
| 483 // -webkit-border-image | 483 // -webkit-border-image |
| 484 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } | 484 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } |
| 485 const NinePieceImage& borderImage() const { | 485 const NinePieceImage& borderImage() const { |
| 486 return m_surround->border.image(); | 486 return m_surround->m_border.image(); |
| 487 } | 487 } |
| 488 void setBorderImage(const NinePieceImage& b) { | 488 void setBorderImage(const NinePieceImage& b) { |
| 489 SET_VAR(m_surround, border.m_image, b); | 489 SET_VAR(m_surround, m_border.m_image, b); |
| 490 } | 490 } |
| 491 | 491 |
| 492 // border-image-slice | 492 // border-image-slice |
| 493 const LengthBox& borderImageSlices() const { | 493 const LengthBox& borderImageSlices() const { |
| 494 return m_surround->border.image().imageSlices(); | 494 return m_surround->m_border.image().imageSlices(); |
| 495 } | 495 } |
| 496 void setBorderImageSlices(const LengthBox&); | 496 void setBorderImageSlices(const LengthBox&); |
| 497 | 497 |
| 498 // border-image-source | 498 // border-image-source |
| 499 static StyleImage* initialBorderImageSource() { return 0; } | 499 static StyleImage* initialBorderImageSource() { return 0; } |
| 500 StyleImage* borderImageSource() const { | 500 StyleImage* borderImageSource() const { |
| 501 return m_surround->border.image().image(); | 501 return m_surround->m_border.image().image(); |
| 502 } | 502 } |
| 503 void setBorderImageSource(StyleImage*); | 503 void setBorderImageSource(StyleImage*); |
| 504 | 504 |
| 505 // border-image-width | 505 // border-image-width |
| 506 const BorderImageLengthBox& borderImageWidth() const { | 506 const BorderImageLengthBox& borderImageWidth() const { |
| 507 return m_surround->border.image().borderSlices(); | 507 return m_surround->m_border.image().borderSlices(); |
| 508 } | 508 } |
| 509 void setBorderImageWidth(const BorderImageLengthBox&); | 509 void setBorderImageWidth(const BorderImageLengthBox&); |
| 510 | 510 |
| 511 // border-image-outset | 511 // border-image-outset |
| 512 const BorderImageLengthBox& borderImageOutset() const { | 512 const BorderImageLengthBox& borderImageOutset() const { |
| 513 return m_surround->border.image().outset(); | 513 return m_surround->m_border.image().outset(); |
| 514 } | 514 } |
| 515 void setBorderImageOutset(const BorderImageLengthBox&); | 515 void setBorderImageOutset(const BorderImageLengthBox&); |
| 516 | 516 |
| 517 // Border width properties. | 517 // Border width properties. |
| 518 static float initialBorderWidth() { return 3; } | 518 static float initialBorderWidth() { return 3; } |
| 519 | 519 |
| 520 // border-top-width | 520 // border-top-width |
| 521 float borderTopWidth() const { return m_surround->border.borderTopWidth(); } | 521 float borderTopWidth() const { return m_surround->m_border.borderTopWidth(); } |
| 522 void setBorderTopWidth(float v) { | 522 void setBorderTopWidth(float v) { |
| 523 SET_BORDER_WIDTH(m_surround, border.m_top, v); | 523 SET_BORDER_WIDTH(m_surround, m_border.m_top, v); |
| 524 } | 524 } |
| 525 | 525 |
| 526 // border-bottom-width | 526 // border-bottom-width |
| 527 float borderBottomWidth() const { | 527 float borderBottomWidth() const { |
| 528 return m_surround->border.borderBottomWidth(); | 528 return m_surround->m_border.borderBottomWidth(); |
| 529 } | 529 } |
| 530 void setBorderBottomWidth(float v) { | 530 void setBorderBottomWidth(float v) { |
| 531 SET_BORDER_WIDTH(m_surround, border.m_bottom, v); | 531 SET_BORDER_WIDTH(m_surround, m_border.m_bottom, v); |
| 532 } | 532 } |
| 533 | 533 |
| 534 // border-left-width | 534 // border-left-width |
| 535 float borderLeftWidth() const { return m_surround->border.borderLeftWidth(); } | 535 float borderLeftWidth() const { |
| 536 return m_surround->m_border.borderLeftWidth(); |
| 537 } |
| 536 void setBorderLeftWidth(float v) { | 538 void setBorderLeftWidth(float v) { |
| 537 SET_BORDER_WIDTH(m_surround, border.m_left, v); | 539 SET_BORDER_WIDTH(m_surround, m_border.m_left, v); |
| 538 } | 540 } |
| 539 | 541 |
| 540 // border-right-width | 542 // border-right-width |
| 541 float borderRightWidth() const { | 543 float borderRightWidth() const { |
| 542 return m_surround->border.borderRightWidth(); | 544 return m_surround->m_border.borderRightWidth(); |
| 543 } | 545 } |
| 544 void setBorderRightWidth(float v) { | 546 void setBorderRightWidth(float v) { |
| 545 SET_BORDER_WIDTH(m_surround, border.m_right, v); | 547 SET_BORDER_WIDTH(m_surround, m_border.m_right, v); |
| 546 } | 548 } |
| 547 | 549 |
| 548 // Border style properties. | 550 // Border style properties. |
| 549 static EBorderStyle initialBorderStyle() { return BorderStyleNone; } | 551 static EBorderStyle initialBorderStyle() { return BorderStyleNone; } |
| 550 | 552 |
| 551 // border-top-style | 553 // border-top-style |
| 552 EBorderStyle borderTopStyle() const { | 554 EBorderStyle borderTopStyle() const { |
| 553 return m_surround->border.top().style(); | 555 return m_surround->m_border.top().style(); |
| 554 } | 556 } |
| 555 void setBorderTopStyle(EBorderStyle v) { | 557 void setBorderTopStyle(EBorderStyle v) { |
| 556 SET_VAR(m_surround, border.m_top.m_style, v); | 558 SET_VAR(m_surround, m_border.m_top.m_style, v); |
| 557 } | 559 } |
| 558 | 560 |
| 559 // border-right-style | 561 // border-right-style |
| 560 EBorderStyle borderRightStyle() const { | 562 EBorderStyle borderRightStyle() const { |
| 561 return m_surround->border.right().style(); | 563 return m_surround->m_border.right().style(); |
| 562 } | 564 } |
| 563 void setBorderRightStyle(EBorderStyle v) { | 565 void setBorderRightStyle(EBorderStyle v) { |
| 564 SET_VAR(m_surround, border.m_right.m_style, v); | 566 SET_VAR(m_surround, m_border.m_right.m_style, v); |
| 565 } | 567 } |
| 566 | 568 |
| 567 // border-left-style | 569 // border-left-style |
| 568 EBorderStyle borderLeftStyle() const { | 570 EBorderStyle borderLeftStyle() const { |
| 569 return m_surround->border.left().style(); | 571 return m_surround->m_border.left().style(); |
| 570 } | 572 } |
| 571 void setBorderLeftStyle(EBorderStyle v) { | 573 void setBorderLeftStyle(EBorderStyle v) { |
| 572 SET_VAR(m_surround, border.m_left.m_style, v); | 574 SET_VAR(m_surround, m_border.m_left.m_style, v); |
| 573 } | 575 } |
| 574 | 576 |
| 575 // border-bottom-style | 577 // border-bottom-style |
| 576 EBorderStyle borderBottomStyle() const { | 578 EBorderStyle borderBottomStyle() const { |
| 577 return m_surround->border.bottom().style(); | 579 return m_surround->m_border.bottom().style(); |
| 578 } | 580 } |
| 579 void setBorderBottomStyle(EBorderStyle v) { | 581 void setBorderBottomStyle(EBorderStyle v) { |
| 580 SET_VAR(m_surround, border.m_bottom.m_style, v); | 582 SET_VAR(m_surround, m_border.m_bottom.m_style, v); |
| 581 } | 583 } |
| 582 | 584 |
| 583 // Border color properties. | 585 // Border color properties. |
| 584 // border-left-color | 586 // border-left-color |
| 585 void setBorderLeftColor(const StyleColor& v) { | 587 void setBorderLeftColor(const StyleColor& v) { |
| 586 SET_BORDERVALUE_COLOR(m_surround, border.m_left, v); | 588 SET_BORDERVALUE_COLOR(m_surround, m_border.m_left, v); |
| 587 } | 589 } |
| 588 | 590 |
| 589 // border-right-color | 591 // border-right-color |
| 590 void setBorderRightColor(const StyleColor& v) { | 592 void setBorderRightColor(const StyleColor& v) { |
| 591 SET_BORDERVALUE_COLOR(m_surround, border.m_right, v); | 593 SET_BORDERVALUE_COLOR(m_surround, m_border.m_right, v); |
| 592 } | 594 } |
| 593 | 595 |
| 594 // border-top-color | 596 // border-top-color |
| 595 void setBorderTopColor(const StyleColor& v) { | 597 void setBorderTopColor(const StyleColor& v) { |
| 596 SET_BORDERVALUE_COLOR(m_surround, border.m_top, v); | 598 SET_BORDERVALUE_COLOR(m_surround, m_border.m_top, v); |
| 597 } | 599 } |
| 598 | 600 |
| 599 // border-bottom-color | 601 // border-bottom-color |
| 600 void setBorderBottomColor(const StyleColor& v) { | 602 void setBorderBottomColor(const StyleColor& v) { |
| 601 SET_BORDERVALUE_COLOR(m_surround, border.m_bottom, v); | 603 SET_BORDERVALUE_COLOR(m_surround, m_border.m_bottom, v); |
| 602 } | 604 } |
| 603 | 605 |
| 604 // Border radius properties. | 606 // Border radius properties. |
| 605 static LengthSize initialBorderRadius() { | 607 static LengthSize initialBorderRadius() { |
| 606 return LengthSize(Length(0, Fixed), Length(0, Fixed)); | 608 return LengthSize(Length(0, Fixed), Length(0, Fixed)); |
| 607 } | 609 } |
| 608 | 610 |
| 609 // border-top-left-radius (aka -webkit-border-top-left-radius) | 611 // border-top-left-radius (aka -webkit-border-top-left-radius) |
| 610 const LengthSize& borderTopLeftRadius() const { | 612 const LengthSize& borderTopLeftRadius() const { |
| 611 return m_surround->border.topLeft(); | 613 return m_surround->m_border.topLeft(); |
| 612 } | 614 } |
| 613 void setBorderTopLeftRadius(const LengthSize& s) { | 615 void setBorderTopLeftRadius(const LengthSize& s) { |
| 614 SET_VAR(m_surround, border.m_topLeft, s); | 616 SET_VAR(m_surround, m_border.m_topLeft, s); |
| 615 } | 617 } |
| 616 | 618 |
| 617 // border-top-right-radius (aka -webkit-border-top-right-radius) | 619 // border-top-right-radius (aka -webkit-border-top-right-radius) |
| 618 const LengthSize& borderTopRightRadius() const { | 620 const LengthSize& borderTopRightRadius() const { |
| 619 return m_surround->border.topRight(); | 621 return m_surround->m_border.topRight(); |
| 620 } | 622 } |
| 621 void setBorderTopRightRadius(const LengthSize& s) { | 623 void setBorderTopRightRadius(const LengthSize& s) { |
| 622 SET_VAR(m_surround, border.m_topRight, s); | 624 SET_VAR(m_surround, m_border.m_topRight, s); |
| 623 } | 625 } |
| 624 | 626 |
| 625 // border-bottom-left-radius (aka -webkit-border-bottom-left-radius) | 627 // border-bottom-left-radius (aka -webkit-border-bottom-left-radius) |
| 626 const LengthSize& borderBottomLeftRadius() const { | 628 const LengthSize& borderBottomLeftRadius() const { |
| 627 return m_surround->border.bottomLeft(); | 629 return m_surround->m_border.bottomLeft(); |
| 628 } | 630 } |
| 629 void setBorderBottomLeftRadius(const LengthSize& s) { | 631 void setBorderBottomLeftRadius(const LengthSize& s) { |
| 630 SET_VAR(m_surround, border.m_bottomLeft, s); | 632 SET_VAR(m_surround, m_border.m_bottomLeft, s); |
| 631 } | 633 } |
| 632 | 634 |
| 633 // border-bottom-right-radius (aka -webkit-border-bottom-right-radius) | 635 // border-bottom-right-radius (aka -webkit-border-bottom-right-radius) |
| 634 const LengthSize& borderBottomRightRadius() const { | 636 const LengthSize& borderBottomRightRadius() const { |
| 635 return m_surround->border.bottomRight(); | 637 return m_surround->m_border.bottomRight(); |
| 636 } | 638 } |
| 637 void setBorderBottomRightRadius(const LengthSize& s) { | 639 void setBorderBottomRightRadius(const LengthSize& s) { |
| 638 SET_VAR(m_surround, border.m_bottomRight, s); | 640 SET_VAR(m_surround, m_border.m_bottomRight, s); |
| 639 } | 641 } |
| 640 | 642 |
| 641 // Offset properties. | 643 // Offset properties. |
| 642 static Length initialOffset() { return Length(); } | 644 static Length initialOffset() { return Length(); } |
| 643 | 645 |
| 644 // left | 646 // left |
| 645 const Length& left() const { return m_surround->m_left; } | 647 const Length& left() const { return m_surround->m_left; } |
| 646 void setLeft(const Length& v) { SET_VAR(m_surround, m_left, v); } | 648 void setLeft(const Length& v) { SET_VAR(m_surround, m_left, v); } |
| 647 | 649 |
| 648 // right | 650 // right |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 return static_cast<EIsolation>(m_rareNonInheritedData->m_isolation); | 1126 return static_cast<EIsolation>(m_rareNonInheritedData->m_isolation); |
| 1125 } | 1127 } |
| 1126 void setIsolation(EIsolation v) { | 1128 void setIsolation(EIsolation v) { |
| 1127 m_rareNonInheritedData.access()->m_isolation = v; | 1129 m_rareNonInheritedData.access()->m_isolation = v; |
| 1128 } | 1130 } |
| 1129 | 1131 |
| 1130 // Margin properties. | 1132 // Margin properties. |
| 1131 static Length initialMargin() { return Length(Fixed); } | 1133 static Length initialMargin() { return Length(Fixed); } |
| 1132 | 1134 |
| 1133 // margin-top | 1135 // margin-top |
| 1134 const Length& marginTop() const { return m_surround->margin.top(); } | 1136 const Length& marginTop() const { return m_surround->m_margin.top(); } |
| 1135 void setMarginTop(const Length& v) { SET_VAR(m_surround, margin.m_top, v); } | 1137 void setMarginTop(const Length& v) { SET_VAR(m_surround, m_margin.m_top, v); } |
| 1136 | 1138 |
| 1137 // margin-bottom | 1139 // margin-bottom |
| 1138 const Length& marginBottom() const { return m_surround->margin.bottom(); } | 1140 const Length& marginBottom() const { return m_surround->m_margin.bottom(); } |
| 1139 void setMarginBottom(const Length& v) { | 1141 void setMarginBottom(const Length& v) { |
| 1140 SET_VAR(m_surround, margin.m_bottom, v); | 1142 SET_VAR(m_surround, m_margin.m_bottom, v); |
| 1141 } | 1143 } |
| 1142 | 1144 |
| 1143 // margin-left | 1145 // margin-left |
| 1144 const Length& marginLeft() const { return m_surround->margin.left(); } | 1146 const Length& marginLeft() const { return m_surround->m_margin.left(); } |
| 1145 void setMarginLeft(const Length& v) { SET_VAR(m_surround, margin.m_left, v); } | 1147 void setMarginLeft(const Length& v) { |
| 1148 SET_VAR(m_surround, m_margin.m_left, v); |
| 1149 } |
| 1146 | 1150 |
| 1147 // margin-right | 1151 // margin-right |
| 1148 const Length& marginRight() const { return m_surround->margin.right(); } | 1152 const Length& marginRight() const { return m_surround->m_margin.right(); } |
| 1149 void setMarginRight(const Length& v) { | 1153 void setMarginRight(const Length& v) { |
| 1150 SET_VAR(m_surround, margin.m_right, v); | 1154 SET_VAR(m_surround, m_margin.m_right, v); |
| 1151 } | 1155 } |
| 1152 | 1156 |
| 1153 // -webkit-margin-before-collapse (aka -webkit-margin-top-collapse) | 1157 // -webkit-margin-before-collapse (aka -webkit-margin-top-collapse) |
| 1154 static EMarginCollapse initialMarginBeforeCollapse() { | 1158 static EMarginCollapse initialMarginBeforeCollapse() { |
| 1155 return MarginCollapseCollapse; | 1159 return MarginCollapseCollapse; |
| 1156 } | 1160 } |
| 1157 EMarginCollapse marginAfterCollapse() const { | 1161 EMarginCollapse marginAfterCollapse() const { |
| 1158 return static_cast<EMarginCollapse>( | 1162 return static_cast<EMarginCollapse>( |
| 1159 m_rareNonInheritedData->marginAfterCollapse); | 1163 m_rareNonInheritedData->marginAfterCollapse); |
| 1160 } | 1164 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 return m_rareNonInheritedData->m_outline.offset(); | 1329 return m_rareNonInheritedData->m_outline.offset(); |
| 1326 } | 1330 } |
| 1327 void setOutlineOffset(int v) { | 1331 void setOutlineOffset(int v) { |
| 1328 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); | 1332 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); |
| 1329 } | 1333 } |
| 1330 | 1334 |
| 1331 // Padding properties. | 1335 // Padding properties. |
| 1332 static Length initialPadding() { return Length(Fixed); } | 1336 static Length initialPadding() { return Length(Fixed); } |
| 1333 | 1337 |
| 1334 // padding-bottom | 1338 // padding-bottom |
| 1335 const Length& paddingBottom() const { return m_surround->padding.bottom(); } | 1339 const Length& paddingBottom() const { return m_surround->m_padding.bottom(); } |
| 1336 void setPaddingBottom(const Length& v) { | 1340 void setPaddingBottom(const Length& v) { |
| 1337 SET_VAR(m_surround, padding.m_bottom, v); | 1341 SET_VAR(m_surround, m_padding.m_bottom, v); |
| 1338 } | 1342 } |
| 1339 | 1343 |
| 1340 // padding-left | 1344 // padding-left |
| 1341 const Length& paddingLeft() const { return m_surround->padding.left(); } | 1345 const Length& paddingLeft() const { return m_surround->m_padding.left(); } |
| 1342 void setPaddingLeft(const Length& v) { | 1346 void setPaddingLeft(const Length& v) { |
| 1343 SET_VAR(m_surround, padding.m_left, v); | 1347 SET_VAR(m_surround, m_padding.m_left, v); |
| 1344 } | 1348 } |
| 1345 | 1349 |
| 1346 // padding-right | 1350 // padding-right |
| 1347 const Length& paddingRight() const { return m_surround->padding.right(); } | 1351 const Length& paddingRight() const { return m_surround->m_padding.right(); } |
| 1348 void setPaddingRight(const Length& v) { | 1352 void setPaddingRight(const Length& v) { |
| 1349 SET_VAR(m_surround, padding.m_right, v); | 1353 SET_VAR(m_surround, m_padding.m_right, v); |
| 1350 } | 1354 } |
| 1351 | 1355 |
| 1352 // padding-top | 1356 // padding-top |
| 1353 const Length& paddingTop() const { return m_surround->padding.top(); } | 1357 const Length& paddingTop() const { return m_surround->m_padding.top(); } |
| 1354 void setPaddingTop(const Length& v) { SET_VAR(m_surround, padding.m_top, v); } | 1358 void setPaddingTop(const Length& v) { |
| 1359 SET_VAR(m_surround, m_padding.m_top, v); |
| 1360 } |
| 1355 | 1361 |
| 1356 // perspective (aka -webkit-perspective) | 1362 // perspective (aka -webkit-perspective) |
| 1357 static float initialPerspective() { return 0; } | 1363 static float initialPerspective() { return 0; } |
| 1358 float perspective() const { return m_rareNonInheritedData->m_perspective; } | 1364 float perspective() const { return m_rareNonInheritedData->m_perspective; } |
| 1359 void setPerspective(float p) { | 1365 void setPerspective(float p) { |
| 1360 SET_VAR(m_rareNonInheritedData, m_perspective, p); | 1366 SET_VAR(m_rareNonInheritedData, m_perspective, p); |
| 1361 } | 1367 } |
| 1362 | 1368 |
| 1363 // perspective-origin (aka -webkit-perspective-origin) | 1369 // perspective-origin (aka -webkit-perspective-origin) |
| 1364 static LengthPoint initialPerspectiveOrigin() { | 1370 static LengthPoint initialPerspectiveOrigin() { |
| (...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2848 return isHorizontalWritingMode() ? maxHeight() : maxWidth(); | 2854 return isHorizontalWritingMode() ? maxHeight() : maxWidth(); |
| 2849 } | 2855 } |
| 2850 const Length& logicalMinWidth() const { | 2856 const Length& logicalMinWidth() const { |
| 2851 return isHorizontalWritingMode() ? minWidth() : minHeight(); | 2857 return isHorizontalWritingMode() ? minWidth() : minHeight(); |
| 2852 } | 2858 } |
| 2853 const Length& logicalMinHeight() const { | 2859 const Length& logicalMinHeight() const { |
| 2854 return isHorizontalWritingMode() ? minHeight() : minWidth(); | 2860 return isHorizontalWritingMode() ? minHeight() : minWidth(); |
| 2855 } | 2861 } |
| 2856 | 2862 |
| 2857 // Margin utility functions. | 2863 // Margin utility functions. |
| 2858 bool hasMargin() const { return m_surround->margin.nonZero(); } | 2864 bool hasMargin() const { return m_surround->m_margin.nonZero(); } |
| 2859 bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); } | 2865 bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); } |
| 2860 bool hasMarginAfterQuirk() const { return marginAfter().quirk(); } | 2866 bool hasMarginAfterQuirk() const { return marginAfter().quirk(); } |
| 2867 const LengthBox& margin() const { return m_surround->m_margin; } |
| 2861 const Length& marginBefore() const { | 2868 const Length& marginBefore() const { |
| 2862 return m_surround->margin.before(getWritingMode()); | 2869 return m_surround->m_margin.before(getWritingMode()); |
| 2863 } | 2870 } |
| 2864 const Length& marginAfter() const { | 2871 const Length& marginAfter() const { |
| 2865 return m_surround->margin.after(getWritingMode()); | 2872 return m_surround->m_margin.after(getWritingMode()); |
| 2866 } | 2873 } |
| 2867 const Length& marginStart() const { | 2874 const Length& marginStart() const { |
| 2868 return m_surround->margin.start(getWritingMode(), direction()); | 2875 return m_surround->m_margin.start(getWritingMode(), direction()); |
| 2869 } | 2876 } |
| 2870 const Length& marginEnd() const { | 2877 const Length& marginEnd() const { |
| 2871 return m_surround->margin.end(getWritingMode(), direction()); | 2878 return m_surround->m_margin.end(getWritingMode(), direction()); |
| 2872 } | 2879 } |
| 2873 const Length& marginOver() const { | 2880 const Length& marginOver() const { |
| 2874 return m_surround->margin.over(getWritingMode()); | 2881 return m_surround->m_margin.over(getWritingMode()); |
| 2875 } | 2882 } |
| 2876 const Length& marginUnder() const { | 2883 const Length& marginUnder() const { |
| 2877 return m_surround->margin.under(getWritingMode()); | 2884 return m_surround->m_margin.under(getWritingMode()); |
| 2878 } | 2885 } |
| 2879 const Length& marginStartUsing(const ComputedStyle* otherStyle) const { | 2886 const Length& marginStartUsing(const ComputedStyle* otherStyle) const { |
| 2880 return m_surround->margin.start(otherStyle->getWritingMode(), | 2887 return m_surround->m_margin.start(otherStyle->getWritingMode(), |
| 2888 otherStyle->direction()); |
| 2889 } |
| 2890 const Length& marginEndUsing(const ComputedStyle* otherStyle) const { |
| 2891 return m_surround->m_margin.end(otherStyle->getWritingMode(), |
| 2881 otherStyle->direction()); | 2892 otherStyle->direction()); |
| 2882 } | 2893 } |
| 2883 const Length& marginEndUsing(const ComputedStyle* otherStyle) const { | |
| 2884 return m_surround->margin.end(otherStyle->getWritingMode(), | |
| 2885 otherStyle->direction()); | |
| 2886 } | |
| 2887 const Length& marginBeforeUsing(const ComputedStyle* otherStyle) const { | 2894 const Length& marginBeforeUsing(const ComputedStyle* otherStyle) const { |
| 2888 return m_surround->margin.before(otherStyle->getWritingMode()); | 2895 return m_surround->m_margin.before(otherStyle->getWritingMode()); |
| 2889 } | 2896 } |
| 2890 const Length& marginAfterUsing(const ComputedStyle* otherStyle) const { | 2897 const Length& marginAfterUsing(const ComputedStyle* otherStyle) const { |
| 2891 return m_surround->margin.after(otherStyle->getWritingMode()); | 2898 return m_surround->m_margin.after(otherStyle->getWritingMode()); |
| 2892 } | 2899 } |
| 2893 void setMarginStart(const Length&); | 2900 void setMarginStart(const Length&); |
| 2894 void setMarginEnd(const Length&); | 2901 void setMarginEnd(const Length&); |
| 2895 | 2902 |
| 2896 // Padding utility functions. | 2903 // Padding utility functions. |
| 2897 const LengthBox& paddingBox() const { return m_surround->padding; } | 2904 const LengthBox& padding() const { return m_surround->m_padding; } |
| 2898 const Length& paddingBefore() const { | 2905 const Length& paddingBefore() const { |
| 2899 return m_surround->padding.before(getWritingMode()); | 2906 return m_surround->m_padding.before(getWritingMode()); |
| 2900 } | 2907 } |
| 2901 const Length& paddingAfter() const { | 2908 const Length& paddingAfter() const { |
| 2902 return m_surround->padding.after(getWritingMode()); | 2909 return m_surround->m_padding.after(getWritingMode()); |
| 2903 } | 2910 } |
| 2904 const Length& paddingStart() const { | 2911 const Length& paddingStart() const { |
| 2905 return m_surround->padding.start(getWritingMode(), direction()); | 2912 return m_surround->m_padding.start(getWritingMode(), direction()); |
| 2906 } | 2913 } |
| 2907 const Length& paddingEnd() const { | 2914 const Length& paddingEnd() const { |
| 2908 return m_surround->padding.end(getWritingMode(), direction()); | 2915 return m_surround->m_padding.end(getWritingMode(), direction()); |
| 2909 } | 2916 } |
| 2910 const Length& paddingOver() const { | 2917 const Length& paddingOver() const { |
| 2911 return m_surround->padding.over(getWritingMode()); | 2918 return m_surround->m_padding.over(getWritingMode()); |
| 2912 } | 2919 } |
| 2913 const Length& paddingUnder() const { | 2920 const Length& paddingUnder() const { |
| 2914 return m_surround->padding.under(getWritingMode()); | 2921 return m_surround->m_padding.under(getWritingMode()); |
| 2915 } | 2922 } |
| 2916 bool hasPadding() const { return m_surround->padding.nonZero(); } | 2923 bool hasPadding() const { return m_surround->m_padding.nonZero(); } |
| 2917 void resetPadding() { SET_VAR(m_surround, padding, LengthBox(Fixed)); } | 2924 void resetPadding() { SET_VAR(m_surround, m_padding, LengthBox(Fixed)); } |
| 2918 void setPaddingBox(const LengthBox& b) { SET_VAR(m_surround, padding, b); } | 2925 void setPadding(const LengthBox& b) { SET_VAR(m_surround, m_padding, b); } |
| 2919 | 2926 |
| 2920 // Border utility functions | 2927 // Border utility functions |
| 2921 LayoutRectOutsets imageOutsets(const NinePieceImage&) const; | 2928 LayoutRectOutsets imageOutsets(const NinePieceImage&) const; |
| 2922 bool hasBorderImageOutsets() const { | 2929 bool hasBorderImageOutsets() const { |
| 2923 return borderImage().hasImage() && borderImage().outset().nonZero(); | 2930 return borderImage().hasImage() && borderImage().outset().nonZero(); |
| 2924 } | 2931 } |
| 2925 LayoutRectOutsets borderImageOutsets() const { | 2932 LayoutRectOutsets borderImageOutsets() const { |
| 2926 return imageOutsets(borderImage()); | 2933 return imageOutsets(borderImage()); |
| 2927 } | 2934 } |
| 2928 bool borderImageSlicesFill() const { | 2935 bool borderImageSlicesFill() const { |
| 2929 return m_surround->border.image().fill(); | 2936 return m_surround->m_border.image().fill(); |
| 2930 } | 2937 } |
| 2931 | 2938 |
| 2932 void setBorderImageSlicesFill(bool); | 2939 void setBorderImageSlicesFill(bool); |
| 2933 const BorderData& border() const { return m_surround->border; } | 2940 const BorderData& border() const { return m_surround->m_border; } |
| 2934 const BorderValue& borderLeft() const { return m_surround->border.left(); } | 2941 const BorderValue& borderLeft() const { return m_surround->m_border.left(); } |
| 2935 const BorderValue& borderRight() const { return m_surround->border.right(); } | 2942 const BorderValue& borderRight() const { |
| 2936 const BorderValue& borderTop() const { return m_surround->border.top(); } | 2943 return m_surround->m_border.right(); |
| 2944 } |
| 2945 const BorderValue& borderTop() const { return m_surround->m_border.top(); } |
| 2937 const BorderValue& borderBottom() const { | 2946 const BorderValue& borderBottom() const { |
| 2938 return m_surround->border.bottom(); | 2947 return m_surround->m_border.bottom(); |
| 2939 } | 2948 } |
| 2940 const BorderValue& borderBefore() const; | 2949 const BorderValue& borderBefore() const; |
| 2941 const BorderValue& borderAfter() const; | 2950 const BorderValue& borderAfter() const; |
| 2942 const BorderValue& borderStart() const; | 2951 const BorderValue& borderStart() const; |
| 2943 const BorderValue& borderEnd() const; | 2952 const BorderValue& borderEnd() const; |
| 2944 float borderAfterWidth() const; | 2953 float borderAfterWidth() const; |
| 2945 float borderBeforeWidth() const; | 2954 float borderBeforeWidth() const; |
| 2946 float borderEndWidth() const; | 2955 float borderEndWidth() const; |
| 2947 float borderStartWidth() const; | 2956 float borderStartWidth() const; |
| 2948 float borderOverWidth() const; | 2957 float borderOverWidth() const; |
| 2949 float borderUnderWidth() const; | 2958 float borderUnderWidth() const; |
| 2950 | 2959 |
| 2951 bool hasBorderFill() const { return m_surround->border.hasBorderFill(); } | 2960 bool hasBorderFill() const { return m_surround->m_border.hasBorderFill(); } |
| 2952 bool hasBorder() const { return m_surround->border.hasBorder(); } | 2961 bool hasBorder() const { return m_surround->m_border.hasBorder(); } |
| 2953 bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); } | 2962 bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); } |
| 2954 bool hasBorderRadius() const { return m_surround->border.hasBorderRadius(); } | 2963 bool hasBorderRadius() const { |
| 2964 return m_surround->m_border.hasBorderRadius(); |
| 2965 } |
| 2955 | 2966 |
| 2956 void resetBorder() { | 2967 void resetBorder() { |
| 2957 resetBorderImage(); | 2968 resetBorderImage(); |
| 2958 resetBorderTop(); | 2969 resetBorderTop(); |
| 2959 resetBorderRight(); | 2970 resetBorderRight(); |
| 2960 resetBorderBottom(); | 2971 resetBorderBottom(); |
| 2961 resetBorderLeft(); | 2972 resetBorderLeft(); |
| 2962 resetBorderTopLeftRadius(); | 2973 resetBorderTopLeftRadius(); |
| 2963 resetBorderTopRightRadius(); | 2974 resetBorderTopRightRadius(); |
| 2964 resetBorderBottomLeftRadius(); | 2975 resetBorderBottomLeftRadius(); |
| 2965 resetBorderBottomRightRadius(); | 2976 resetBorderBottomRightRadius(); |
| 2966 } | 2977 } |
| 2967 void resetBorderTop() { SET_VAR(m_surround, border.m_top, BorderValue()); } | 2978 void resetBorderTop() { SET_VAR(m_surround, m_border.m_top, BorderValue()); } |
| 2968 void resetBorderRight() { | 2979 void resetBorderRight() { |
| 2969 SET_VAR(m_surround, border.m_right, BorderValue()); | 2980 SET_VAR(m_surround, m_border.m_right, BorderValue()); |
| 2970 } | 2981 } |
| 2971 void resetBorderBottom() { | 2982 void resetBorderBottom() { |
| 2972 SET_VAR(m_surround, border.m_bottom, BorderValue()); | 2983 SET_VAR(m_surround, m_border.m_bottom, BorderValue()); |
| 2973 } | 2984 } |
| 2974 void resetBorderLeft() { SET_VAR(m_surround, border.m_left, BorderValue()); } | 2985 void resetBorderLeft() { |
| 2986 SET_VAR(m_surround, m_border.m_left, BorderValue()); |
| 2987 } |
| 2975 void resetBorderImage() { | 2988 void resetBorderImage() { |
| 2976 SET_VAR(m_surround, border.m_image, NinePieceImage()); | 2989 SET_VAR(m_surround, m_border.m_image, NinePieceImage()); |
| 2977 } | 2990 } |
| 2978 void resetBorderTopLeftRadius() { | 2991 void resetBorderTopLeftRadius() { |
| 2979 SET_VAR(m_surround, border.m_topLeft, initialBorderRadius()); | 2992 SET_VAR(m_surround, m_border.m_topLeft, initialBorderRadius()); |
| 2980 } | 2993 } |
| 2981 void resetBorderTopRightRadius() { | 2994 void resetBorderTopRightRadius() { |
| 2982 SET_VAR(m_surround, border.m_topRight, initialBorderRadius()); | 2995 SET_VAR(m_surround, m_border.m_topRight, initialBorderRadius()); |
| 2983 } | 2996 } |
| 2984 void resetBorderBottomLeftRadius() { | 2997 void resetBorderBottomLeftRadius() { |
| 2985 SET_VAR(m_surround, border.m_bottomLeft, initialBorderRadius()); | 2998 SET_VAR(m_surround, m_border.m_bottomLeft, initialBorderRadius()); |
| 2986 } | 2999 } |
| 2987 void resetBorderBottomRightRadius() { | 3000 void resetBorderBottomRightRadius() { |
| 2988 SET_VAR(m_surround, border.m_bottomRight, initialBorderRadius()); | 3001 SET_VAR(m_surround, m_border.m_bottomRight, initialBorderRadius()); |
| 2989 } | 3002 } |
| 2990 | 3003 |
| 2991 void setBorderRadius(const LengthSize& s) { | 3004 void setBorderRadius(const LengthSize& s) { |
| 2992 setBorderTopLeftRadius(s); | 3005 setBorderTopLeftRadius(s); |
| 2993 setBorderTopRightRadius(s); | 3006 setBorderTopRightRadius(s); |
| 2994 setBorderBottomLeftRadius(s); | 3007 setBorderBottomLeftRadius(s); |
| 2995 setBorderBottomRightRadius(s); | 3008 setBorderBottomRightRadius(s); |
| 2996 } | 3009 } |
| 2997 void setBorderRadius(const IntSize& s) { | 3010 void setBorderRadius(const IntSize& s) { |
| 2998 setBorderRadius( | 3011 setBorderRadius( |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3527 display == EDisplay::kTableRow || | 3540 display == EDisplay::kTableRow || |
| 3528 display == EDisplay::kTableColumnGroup || | 3541 display == EDisplay::kTableColumnGroup || |
| 3529 display == EDisplay::kTableColumn || | 3542 display == EDisplay::kTableColumn || |
| 3530 display == EDisplay::kTableCell || | 3543 display == EDisplay::kTableCell || |
| 3531 display == EDisplay::kTableCaption; | 3544 display == EDisplay::kTableCaption; |
| 3532 } | 3545 } |
| 3533 | 3546 |
| 3534 // Color accessors are all private to make sure callers use | 3547 // Color accessors are all private to make sure callers use |
| 3535 // visitedDependentColor instead to access them. | 3548 // visitedDependentColor instead to access them. |
| 3536 StyleColor borderLeftColor() const { | 3549 StyleColor borderLeftColor() const { |
| 3537 return m_surround->border.left().color(); | 3550 return m_surround->m_border.left().color(); |
| 3538 } | 3551 } |
| 3539 StyleColor borderRightColor() const { | 3552 StyleColor borderRightColor() const { |
| 3540 return m_surround->border.right().color(); | 3553 return m_surround->m_border.right().color(); |
| 3541 } | 3554 } |
| 3542 StyleColor borderTopColor() const { return m_surround->border.top().color(); } | 3555 StyleColor borderTopColor() const { |
| 3556 return m_surround->m_border.top().color(); |
| 3557 } |
| 3543 StyleColor borderBottomColor() const { | 3558 StyleColor borderBottomColor() const { |
| 3544 return m_surround->border.bottom().color(); | 3559 return m_surround->m_border.bottom().color(); |
| 3545 } | 3560 } |
| 3546 StyleColor backgroundColor() const { return m_background->color(); } | 3561 StyleColor backgroundColor() const { return m_background->color(); } |
| 3547 StyleAutoColor caretColor() const { | 3562 StyleAutoColor caretColor() const { |
| 3548 return m_rareInheritedData->caretColor(); | 3563 return m_rareInheritedData->caretColor(); |
| 3549 } | 3564 } |
| 3550 Color color() const; | 3565 Color color() const; |
| 3551 StyleColor columnRuleColor() const { | 3566 StyleColor columnRuleColor() const { |
| 3552 return m_rareNonInheritedData->m_multiCol->m_rule.color(); | 3567 return m_rareNonInheritedData->m_multiCol->m_rule.color(); |
| 3553 } | 3568 } |
| 3554 StyleColor outlineColor() const { | 3569 StyleColor outlineColor() const { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3727 m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); | 3742 m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); |
| 3728 } | 3743 } |
| 3729 | 3744 |
| 3730 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3745 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 3731 return m_pseudoBits & ElementPseudoIdMask; | 3746 return m_pseudoBits & ElementPseudoIdMask; |
| 3732 } | 3747 } |
| 3733 | 3748 |
| 3734 } // namespace blink | 3749 } // namespace blink |
| 3735 | 3750 |
| 3736 #endif // ComputedStyle_h | 3751 #endif // ComputedStyle_h |
| OLD | NEW |