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

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

Issue 2880573002: Store border-*-style on SurroundData in ComputedStyle (Closed)
Patch Set: Store border-*-style on SurroundData 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 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
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details. 16 * Library General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Library General Public License 18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to 19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 * 22 *
23 */ 23 */
24 24
25 #ifndef BorderValue_h 25 #ifndef BorderValue_h
26 #define BorderValue_h 26 #define BorderValue_h
27 27
28 #include "core/css/StyleColor.h" 28 #include "core/css/StyleColor.h"
29 #include "core/style/BorderStyle.h"
30 #include "core/style/ComputedStyleConstants.h" 29 #include "core/style/ComputedStyleConstants.h"
31 #include "platform/graphics/Color.h" 30 #include "platform/graphics/Color.h"
32 #include "platform/wtf/Allocator.h" 31 #include "platform/wtf/Allocator.h"
33 32
34 namespace blink { 33 namespace blink {
35 34
36 class BorderValue { 35 class BorderValue {
37 DISALLOW_NEW(); 36 DISALLOW_NEW();
38 friend class ComputedStyle; 37 friend class ComputedStyle;
39 38
40 public: 39 public:
41 BorderValue() 40 BorderValue()
42 : color_(0), 41 : color_(0),
43 color_is_current_color_(true), 42 color_is_current_color_(true),
44 style_(static_cast<unsigned>(EBorderStyle::kNone)), 43 style_(static_cast<unsigned>(EBorderStyle::kNone)),
45 is_auto_(kOutlineIsAutoOff) { 44 is_auto_(kOutlineIsAutoOff) {
46 SetWidth(3); 45 SetWidth(3);
47 } 46 }
48 47
49 BorderValue(const BorderStyle& data, const StyleColor& color, float width) { 48 BorderValue(EBorderStyle style, const StyleColor& color, float width) {
50 SetColor(color.Resolve(Color())); 49 SetColor(color.Resolve(Color()));
51 SetStyle(data.Style()); 50 SetStyle(style);
52 SetIsAuto(data.IsAuto());
shend 2017/05/17 22:18:34 Was this deletion intentional?
nainar 2017/05/18 01:58:35 Nope it wasn't. Added it back in.
53 SetWidth(width); 51 SetWidth(width);
54 } 52 }
55 53
56 bool NonZero() const { 54 bool NonZero() const {
57 return Width() && (style_ != static_cast<unsigned>(EBorderStyle::kNone)); 55 return Width() && (style_ != static_cast<unsigned>(EBorderStyle::kNone));
58 } 56 }
59 57
60 bool IsTransparent() const { 58 bool IsTransparent() const {
61 return !color_is_current_color_ && !color_.Alpha(); 59 return !color_is_current_color_ && !color_.Alpha();
62 } 60 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 unsigned width_ : 26; // Fixed point width 123 unsigned width_ : 26; // Fixed point width
126 unsigned style_ : 4; // EBorderStyle 124 unsigned style_ : 4; // EBorderStyle
127 125
128 // This is only used by OutlineValue but moved here to keep the bits packed. 126 // This is only used by OutlineValue but moved here to keep the bits packed.
129 unsigned is_auto_ : 1; // OutlineIsAuto 127 unsigned is_auto_ : 1; // OutlineIsAuto
130 }; 128 };
131 129
132 } // namespace blink 130 } // namespace blink
133 131
134 #endif // BorderValue_h 132 #endif // BorderValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698