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

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

Issue 1457323004: Don't render border images when border-style is none (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, removed unnecessary border colors, etc. Created 5 years 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 28 matching lines...) Expand all
39 public: 39 public:
40 BorderData() : m_topLeft(Length(0, Fixed), Length(0, Fixed)) 40 BorderData() : m_topLeft(Length(0, Fixed), Length(0, Fixed))
41 , m_topRight(Length(0, Fixed), Length(0, Fixed)) 41 , m_topRight(Length(0, Fixed), Length(0, Fixed))
42 , m_bottomLeft(Length(0, Fixed), Length(0, Fixed)) 42 , m_bottomLeft(Length(0, Fixed), Length(0, Fixed))
43 , m_bottomRight(Length(0, Fixed), Length(0, Fixed)) 43 , m_bottomRight(Length(0, Fixed), Length(0, Fixed))
44 { 44 {
45 } 45 }
46 46
47 bool hasBorder() const 47 bool hasBorder() const
48 { 48 {
49 bool haveImage = m_image.hasImage(); 49 return m_left.nonZero() || m_right.nonZero() || m_top.nonZero() || m_bot tom.nonZero();
50 return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_to p.nonZero(!haveImage) || m_bottom.nonZero(!haveImage);
51 } 50 }
52 51
53 bool hasBorderFill() const 52 bool hasBorderFill() const
54 { 53 {
55 return m_image.hasImage() && m_image.fill(); 54 return m_image.hasImage() && m_image.fill();
56 } 55 }
57 56
58 bool hasBorderRadius() const 57 bool hasBorderRadius() const
59 { 58 {
60 if (!m_topLeft.width().isZero()) 59 if (!m_topLeft.width().isZero())
61 return true; 60 return true;
62 if (!m_topRight.width().isZero()) 61 if (!m_topRight.width().isZero())
63 return true; 62 return true;
64 if (!m_bottomLeft.width().isZero()) 63 if (!m_bottomLeft.width().isZero())
65 return true; 64 return true;
66 if (!m_bottomRight.width().isZero()) 65 if (!m_bottomRight.width().isZero())
67 return true; 66 return true;
68 return false; 67 return false;
69 } 68 }
70 69
71 int borderLeftWidth() const 70 int borderLeftWidth() const
72 { 71 {
73 if (!m_image.hasImage() && (m_left.style() == BNONE || m_left.style() == BHIDDEN)) 72 if (m_left.style() == BNONE || m_left.style() == BHIDDEN)
74 return 0; 73 return 0;
75 return m_left.width(); 74 return m_left.width();
76 } 75 }
77 76
78 int borderRightWidth() const 77 int borderRightWidth() const
79 { 78 {
80 if (!m_image.hasImage() && (m_right.style() == BNONE || m_right.style() == BHIDDEN)) 79 if (m_right.style() == BNONE || m_right.style() == BHIDDEN)
81 return 0; 80 return 0;
82 return m_right.width(); 81 return m_right.width();
83 } 82 }
84 83
85 int borderTopWidth() const 84 int borderTopWidth() const
86 { 85 {
87 if (!m_image.hasImage() && (m_top.style() == BNONE || m_top.style() == B HIDDEN)) 86 if (m_top.style() == BNONE || m_top.style() == BHIDDEN)
88 return 0; 87 return 0;
89 return m_top.width(); 88 return m_top.width();
90 } 89 }
91 90
92 int borderBottomWidth() const 91 int borderBottomWidth() const
93 { 92 {
94 if (!m_image.hasImage() && (m_bottom.style() == BNONE || m_bottom.style( ) == BHIDDEN)) 93 if (m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN)
95 return 0; 94 return 0;
96 return m_bottom.width(); 95 return m_bottom.width();
97 } 96 }
98 97
99 bool operator==(const BorderData& o) const 98 bool operator==(const BorderData& o) const
100 { 99 {
101 return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && m_bottom == o.m_bottom && m_image == o.m_image 100 return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && m_bottom == o.m_bottom && m_image == o.m_image
102 && m_topLeft == o.m_topLeft && m_topRight == o.m_topRight && m_bo ttomLeft == o.m_bottomLeft && m_bottomRight == o.m_bottomRight; 101 && m_topLeft == o.m_topLeft && m_topRight == o.m_topRight && m_bo ttomLeft == o.m_bottomLeft && m_bottomRight == o.m_bottomRight;
103 } 102 }
104 103
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 141
143 LengthSize m_topLeft; 142 LengthSize m_topLeft;
144 LengthSize m_topRight; 143 LengthSize m_topRight;
145 LengthSize m_bottomLeft; 144 LengthSize m_bottomLeft;
146 LengthSize m_bottomRight; 145 LengthSize m_bottomRight;
147 }; 146 };
148 147
149 } // namespace blink 148 } // namespace blink
150 149
151 #endif // BorderData_h 150 #endif // BorderData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698