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 // TODO(nainar): Move all fixed point logic to a separate class. | 476 // TODO(nainar): Move all fixed point logic to a separate class. |
477 // border-top-width | 477 // border-top-width |
478 float BorderTopWidth() const { | 478 float BorderTopWidth() const { |
479 if (surround_data_->border_.top_.Style() == kBorderStyleNone || | 479 if (surround_data_->border_.top_.Style() == kBorderStyleNone || |
480 surround_data_->border_.top_.Style() == kBorderStyleHidden) | 480 surround_data_->border_.top_.Style() == kBorderStyleHidden) |
481 return 0; | 481 return 0; |
482 return static_cast<float>(BorderTopWidthInternal()) / | 482 return static_cast<float>(BorderTopWidthInternal()) / |
483 kBorderWidthDenominator; | 483 kBorderWidthDenominator; |
484 } | 484 } |
485 void SetBorderTopWidth(float v) { | 485 void SetBorderTopWidth(float v) { |
486 surround_data_.Access()->border_top_width_ = WidthToFixedPoint(v); | 486 SetBorderTopWidthInternal(WidthToFixedPoint(v)); |
487 } | 487 } |
488 | 488 |
489 // border-bottom-width | 489 // border-bottom-width |
490 float BorderBottomWidth() const { | 490 float BorderBottomWidth() const { |
491 if (surround_data_->border_.bottom_.Style() == kBorderStyleNone || | 491 if (surround_data_->border_.bottom_.Style() == kBorderStyleNone || |
492 surround_data_->border_.bottom_.Style() == kBorderStyleHidden) | 492 surround_data_->border_.bottom_.Style() == kBorderStyleHidden) |
493 return 0; | 493 return 0; |
494 return static_cast<float>(BorderBottomWidthInternal()) / | 494 return static_cast<float>(BorderBottomWidthInternal()) / |
495 kBorderWidthDenominator; | 495 kBorderWidthDenominator; |
496 } | 496 } |
497 void SetBorderBottomWidth(float v) { | 497 void SetBorderBottomWidth(float v) { |
498 surround_data_.Access()->border_bottom_width_ = WidthToFixedPoint(v); | 498 SetBorderBottomWidthInternal(WidthToFixedPoint(v)); |
499 } | 499 } |
500 | 500 |
501 // border-left-width | 501 // border-left-width |
502 float BorderLeftWidth() const { | 502 float BorderLeftWidth() const { |
503 if (surround_data_->border_.left_.Style() == kBorderStyleNone || | 503 if (surround_data_->border_.left_.Style() == kBorderStyleNone || |
504 surround_data_->border_.left_.Style() == kBorderStyleHidden) | 504 surround_data_->border_.left_.Style() == kBorderStyleHidden) |
505 return 0; | 505 return 0; |
506 return static_cast<float>(BorderLeftWidthInternal()) / | 506 return static_cast<float>(BorderLeftWidthInternal()) / |
507 kBorderWidthDenominator; | 507 kBorderWidthDenominator; |
508 } | 508 } |
509 void SetBorderLeftWidth(float v) { | 509 void SetBorderLeftWidth(float v) { |
510 surround_data_.Access()->border_left_width_ = WidthToFixedPoint(v); | 510 SetBorderLeftWidthInternal(WidthToFixedPoint(v)); |
511 } | 511 } |
512 | 512 |
513 // border-right-width | 513 // border-right-width |
514 float BorderRightWidth() const { | 514 float BorderRightWidth() const { |
515 if (surround_data_->border_.right_.Style() == kBorderStyleNone || | 515 if (surround_data_->border_.right_.Style() == kBorderStyleNone || |
516 surround_data_->border_.right_.Style() == kBorderStyleHidden) | 516 surround_data_->border_.right_.Style() == kBorderStyleHidden) |
517 return 0; | 517 return 0; |
518 return static_cast<float>(BorderRightWidthInternal()) / | 518 return static_cast<float>(BorderRightWidthInternal()) / |
519 kBorderWidthDenominator; | 519 kBorderWidthDenominator; |
520 } | 520 } |
521 void SetBorderRightWidth(float v) { | 521 void SetBorderRightWidth(float v) { |
522 surround_data_.Access()->border_right_width_ = WidthToFixedPoint(v); | 522 SetBorderRightWidthInternal(WidthToFixedPoint(v)); |
523 } | 523 } |
524 | 524 |
525 // Border style properties. | 525 // Border style properties. |
526 static EBorderStyle InitialBorderStyle() { return kBorderStyleNone; } | 526 static EBorderStyle InitialBorderStyle() { return kBorderStyleNone; } |
527 | 527 |
528 // border-top-style | 528 // border-top-style |
529 EBorderStyle BorderTopStyle() const { | 529 EBorderStyle BorderTopStyle() const { |
530 return surround_data_->border_.Top().Style(); | 530 return surround_data_->border_.Top().Style(); |
531 } | 531 } |
532 void SetBorderTopStyle(EBorderStyle v) { | 532 void SetBorderTopStyle(EBorderStyle v) { |
(...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2783 return LengthBox::Over(GetWritingMode(), PaddingTop(), PaddingRight()); | 2783 return LengthBox::Over(GetWritingMode(), PaddingTop(), PaddingRight()); |
2784 } | 2784 } |
2785 const Length& PaddingUnder() const { | 2785 const Length& PaddingUnder() const { |
2786 return LengthBox::Under(GetWritingMode(), PaddingBottom(), PaddingLeft()); | 2786 return LengthBox::Under(GetWritingMode(), PaddingBottom(), PaddingLeft()); |
2787 } | 2787 } |
2788 bool HasPadding() const { | 2788 bool HasPadding() const { |
2789 return !PaddingLeft().IsZero() || !PaddingRight().IsZero() || | 2789 return !PaddingLeft().IsZero() || !PaddingRight().IsZero() || |
2790 !PaddingTop().IsZero() || !PaddingBottom().IsZero(); | 2790 !PaddingTop().IsZero() || !PaddingBottom().IsZero(); |
2791 } | 2791 } |
2792 void ResetPadding() { | 2792 void ResetPadding() { |
2793 SET_VAR(surround_data_, padding_top_, kFixed); | 2793 SetPaddingTop(kFixed); |
2794 SET_VAR(surround_data_, padding_bottom_, kFixed); | 2794 SetPaddingBottom(kFixed); |
2795 SET_VAR(surround_data_, padding_left_, kFixed); | 2795 SetPaddingLeft(kFixed); |
2796 SET_VAR(surround_data_, padding_right_, kFixed); | 2796 SetPaddingRight(kFixed); |
2797 } | 2797 } |
2798 void SetPadding(const LengthBox& b) { | 2798 void SetPadding(const LengthBox& b) { |
2799 SET_VAR(surround_data_, padding_top_, b.top_); | 2799 SetPaddingTop(b.top_); |
2800 SET_VAR(surround_data_, padding_bottom_, b.bottom_); | 2800 SetPaddingBottom(b.bottom_); |
2801 SET_VAR(surround_data_, padding_left_, b.left_); | 2801 SetPaddingLeft(b.left_); |
2802 SET_VAR(surround_data_, padding_right_, b.right_); | 2802 SetPaddingRight(b.right_); |
2803 } | 2803 } |
2804 bool PaddingEqual(const ComputedStyle& other) const { | 2804 bool PaddingEqual(const ComputedStyle& other) const { |
2805 return PaddingTop() == other.PaddingTop() && | 2805 return PaddingTop() == other.PaddingTop() && |
2806 PaddingLeft() == other.PaddingLeft() && | 2806 PaddingLeft() == other.PaddingLeft() && |
2807 PaddingRight() == other.PaddingRight() && | 2807 PaddingRight() == other.PaddingRight() && |
2808 PaddingBottom() == other.PaddingBottom(); | 2808 PaddingBottom() == other.PaddingBottom(); |
2809 } | 2809 } |
2810 bool PaddingEqual(const LengthBox& other) const { | 2810 bool PaddingEqual(const LengthBox& other) const { |
2811 return PaddingTop() == other.Top() && PaddingLeft() == other.Left() && | 2811 return PaddingTop() == other.Top() && PaddingLeft() == other.Left() && |
2812 PaddingRight() == other.Right() && PaddingBottom() == other.Bottom(); | 2812 PaddingRight() == other.Right() && PaddingBottom() == other.Bottom(); |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3771 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3771 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3772 } | 3772 } |
3773 | 3773 |
3774 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3774 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3775 return PseudoBitsInternal() & kElementPseudoIdMask; | 3775 return PseudoBitsInternal() & kElementPseudoIdMask; |
3776 } | 3776 } |
3777 | 3777 |
3778 } // namespace blink | 3778 } // namespace blink |
3779 | 3779 |
3780 #endif // ComputedStyle_h | 3780 #endif // ComputedStyle_h |
OLD | NEW |