Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2850173003: Move LengthSizes border-*-radius out of BorderData (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 // border-top-color 551 // border-top-color
552 void SetBorderTopColor(const StyleColor& v) { 552 void SetBorderTopColor(const StyleColor& v) {
553 SET_BORDERVALUE_COLOR(surround_data_, border_.top_, v); 553 SET_BORDERVALUE_COLOR(surround_data_, border_.top_, v);
554 } 554 }
555 555
556 // border-bottom-color 556 // border-bottom-color
557 void SetBorderBottomColor(const StyleColor& v) { 557 void SetBorderBottomColor(const StyleColor& v) {
558 SET_BORDERVALUE_COLOR(surround_data_, border_.bottom_, v); 558 SET_BORDERVALUE_COLOR(surround_data_, border_.bottom_, v);
559 } 559 }
560 560
561 // Border radius properties.
562 static LengthSize InitialBorderRadius() {
563 return LengthSize(Length(0, kFixed), Length(0, kFixed));
564 }
565
566 // border-top-left-radius (aka -webkit-border-top-left-radius)
567 const LengthSize& BorderTopLeftRadius() const {
568 return surround_data_->border_.TopLeft();
569 }
570 void SetBorderTopLeftRadius(const LengthSize& s) {
571 SET_VAR(surround_data_, border_.top_left_, s);
572 }
573
574 // border-top-right-radius (aka -webkit-border-top-right-radius)
575 const LengthSize& BorderTopRightRadius() const {
576 return surround_data_->border_.TopRight();
577 }
578 void SetBorderTopRightRadius(const LengthSize& s) {
579 SET_VAR(surround_data_, border_.top_right_, s);
580 }
581
582 // border-bottom-left-radius (aka -webkit-border-bottom-left-radius)
583 const LengthSize& BorderBottomLeftRadius() const {
584 return surround_data_->border_.BottomLeft();
585 }
586 void SetBorderBottomLeftRadius(const LengthSize& s) {
587 SET_VAR(surround_data_, border_.bottom_left_, s);
588 }
589
590 // border-bottom-right-radius (aka -webkit-border-bottom-right-radius)
591 const LengthSize& BorderBottomRightRadius() const {
592 return surround_data_->border_.BottomRight();
593 }
594 void SetBorderBottomRightRadius(const LengthSize& s) {
595 SET_VAR(surround_data_, border_.bottom_right_, s);
596 }
597
598 // box-shadow (aka -webkit-box-shadow) 561 // box-shadow (aka -webkit-box-shadow)
599 static ShadowList* InitialBoxShadow() { return 0; } 562 static ShadowList* InitialBoxShadow() { return 0; }
600 ShadowList* BoxShadow() const { 563 ShadowList* BoxShadow() const {
601 return rare_non_inherited_data_->box_shadow_.Get(); 564 return rare_non_inherited_data_->box_shadow_.Get();
602 } 565 }
603 void SetBoxShadow(PassRefPtr<ShadowList>); 566 void SetBoxShadow(PassRefPtr<ShadowList>);
604 567
605 // box-sizing (aka -webkit-box-sizing) 568 // box-sizing (aka -webkit-box-sizing)
606 static EBoxSizing InitialBoxSizing() { return EBoxSizing::kContentBox; } 569 static EBoxSizing InitialBoxSizing() { return EBoxSizing::kContentBox; }
607 EBoxSizing BoxSizing() const { 570 EBoxSizing BoxSizing() const {
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 float BorderAfterWidth() const; 2839 float BorderAfterWidth() const;
2877 float BorderBeforeWidth() const; 2840 float BorderBeforeWidth() const;
2878 float BorderEndWidth() const; 2841 float BorderEndWidth() const;
2879 float BorderStartWidth() const; 2842 float BorderStartWidth() const;
2880 float BorderOverWidth() const; 2843 float BorderOverWidth() const;
2881 float BorderUnderWidth() const; 2844 float BorderUnderWidth() const;
2882 2845
2883 bool HasBorderFill() const { return Border().HasBorderFill(); } 2846 bool HasBorderFill() const { return Border().HasBorderFill(); }
2884 bool HasBorder() const { return Border().HasBorder(); } 2847 bool HasBorder() const { return Border().HasBorder(); }
2885 bool HasBorderDecoration() const { return HasBorder() || HasBorderFill(); } 2848 bool HasBorderDecoration() const { return HasBorder() || HasBorderFill(); }
2886 bool HasBorderRadius() const { return Border().HasBorderRadius(); } 2849 bool HasBorderRadius() const {
2850 if (!BorderTopLeftRadius().Width().IsZero())
2851 return true;
2852 if (!BorderTopRightRadius().Width().IsZero())
2853 return true;
2854 if (!BorderBottomLeftRadius().Width().IsZero())
2855 return true;
2856 if (!BorderBottomRightRadius().Width().IsZero())
2857 return true;
2858 return false;
2859 }
2887 bool HasBorderColorReferencingCurrentColor() const { 2860 bool HasBorderColorReferencingCurrentColor() const {
2888 return Border().HasBorderColorReferencingCurrentColor(); 2861 return Border().HasBorderColorReferencingCurrentColor();
2889 } 2862 }
2890 2863
2864 bool RadiiEqual(const ComputedStyle& o) const {
2865 return BorderTopLeftRadius() == o.BorderTopLeftRadius() &&
2866 BorderTopRightRadius() == o.BorderTopRightRadius() &&
2867 BorderBottomLeftRadius() == o.BorderBottomLeftRadius() &&
2868 BorderBottomRightRadius() == o.BorderBottomRightRadius();
2869 }
2870
2891 void ResetBorder() { 2871 void ResetBorder() {
2892 ResetBorderImage(); 2872 ResetBorderImage();
2893 ResetBorderTop(); 2873 ResetBorderTop();
2894 ResetBorderRight(); 2874 ResetBorderRight();
2895 ResetBorderBottom(); 2875 ResetBorderBottom();
2896 ResetBorderLeft(); 2876 ResetBorderLeft();
2897 ResetBorderTopLeftRadius(); 2877 ResetBorderTopLeftRadius();
2898 ResetBorderTopRightRadius(); 2878 ResetBorderTopRightRadius();
2899 ResetBorderBottomLeftRadius(); 2879 ResetBorderBottomLeftRadius();
2900 ResetBorderBottomRightRadius(); 2880 ResetBorderBottomRightRadius();
2901 } 2881 }
2902 void ResetBorderTop() { 2882 void ResetBorderTop() {
2903 SET_VAR(surround_data_, border_.top_, BorderValue()); 2883 SET_VAR(surround_data_, border_.top_, BorderValue());
2904 } 2884 }
2905 void ResetBorderRight() { 2885 void ResetBorderRight() {
2906 SET_VAR(surround_data_, border_.right_, BorderValue()); 2886 SET_VAR(surround_data_, border_.right_, BorderValue());
2907 } 2887 }
2908 void ResetBorderBottom() { 2888 void ResetBorderBottom() {
2909 SET_VAR(surround_data_, border_.bottom_, BorderValue()); 2889 SET_VAR(surround_data_, border_.bottom_, BorderValue());
2910 } 2890 }
2911 void ResetBorderLeft() { 2891 void ResetBorderLeft() {
2912 SET_VAR(surround_data_, border_.left_, BorderValue()); 2892 SET_VAR(surround_data_, border_.left_, BorderValue());
2913 } 2893 }
2914 void ResetBorderImage() { 2894 void ResetBorderImage() {
2915 SET_VAR(surround_data_, border_.image_, NinePieceImage()); 2895 SET_VAR(surround_data_, border_.image_, NinePieceImage());
2916 } 2896 }
2917 void ResetBorderTopLeftRadius() {
2918 SET_VAR(surround_data_, border_.top_left_, InitialBorderRadius());
2919 }
2920 void ResetBorderTopRightRadius() {
2921 SET_VAR(surround_data_, border_.top_right_, InitialBorderRadius());
2922 }
2923 void ResetBorderBottomLeftRadius() {
2924 SET_VAR(surround_data_, border_.bottom_left_, InitialBorderRadius());
2925 }
2926 void ResetBorderBottomRightRadius() {
2927 SET_VAR(surround_data_, border_.bottom_right_, InitialBorderRadius());
2928 }
2929 2897
2930 void SetBorderRadius(const LengthSize& s) { 2898 void SetBorderRadius(const LengthSize& s) {
2931 SetBorderTopLeftRadius(s); 2899 SetBorderTopLeftRadius(s);
2932 SetBorderTopRightRadius(s); 2900 SetBorderTopRightRadius(s);
2933 SetBorderBottomLeftRadius(s); 2901 SetBorderBottomLeftRadius(s);
2934 SetBorderBottomRightRadius(s); 2902 SetBorderBottomRightRadius(s);
2935 } 2903 }
2936 void SetBorderRadius(const IntSize& s) { 2904 void SetBorderRadius(const IntSize& s) {
2937 SetBorderRadius( 2905 SetBorderRadius(
2938 LengthSize(Length(s.Width(), kFixed), Length(s.Height(), kFixed))); 2906 LengthSize(Length(s.Width(), kFixed), Length(s.Height(), kFixed)));
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3654 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3687 } 3655 }
3688 3656
3689 inline bool ComputedStyle::HasPseudoElementStyle() const { 3657 inline bool ComputedStyle::HasPseudoElementStyle() const {
3690 return PseudoBitsInternal() & kElementPseudoIdMask; 3658 return PseudoBitsInternal() & kElementPseudoIdMask;
3691 } 3659 }
3692 3660
3693 } // namespace blink 3661 } // namespace blink
3694 3662
3695 #endif // ComputedStyle_h 3663 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698