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

Side by Side Diff: Source/core/rendering/style/BorderValue.h

Issue 222473005: Don't repaint when setting border or outline 0 with style none (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make cross platform Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/style/BorderData.h ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 bool isVisible(bool checkStyle = true) const 56 bool isVisible(bool checkStyle = true) const
57 { 57 {
58 return nonZero(checkStyle) && !isTransparent() && (!checkStyle || m_styl e != BHIDDEN); 58 return nonZero(checkStyle) && !isTransparent() && (!checkStyle || m_styl e != BHIDDEN);
59 } 59 }
60 60
61 bool operator==(const BorderValue& o) const 61 bool operator==(const BorderValue& o) const
62 { 62 {
63 return m_width == o.m_width && m_style == o.m_style && m_color == o.m_co lor && m_colorIsCurrentColor == o.m_colorIsCurrentColor; 63 return m_width == o.m_width && m_style == o.m_style && m_color == o.m_co lor && m_colorIsCurrentColor == o.m_colorIsCurrentColor;
64 } 64 }
65 65
66 // The default width is 3px, but if the style is none we compute a value of 0 (in RenderStyle itself)
67 bool visuallyEqual(const BorderValue& o) const
68 {
69 if (m_style == BNONE && o.m_style == BNONE)
70 return true;
71 if (m_style == BHIDDEN && o.m_style == BHIDDEN)
72 return true;
73 return *this == o;
74 }
75
66 bool operator!=(const BorderValue& o) const 76 bool operator!=(const BorderValue& o) const
67 { 77 {
68 return !(*this == o); 78 return !(*this == o);
69 } 79 }
70 80
71 void setColor(const StyleColor& color) 81 void setColor(const StyleColor& color)
72 { 82 {
73 m_color = color.resolve(Color()); 83 m_color = color.resolve(Color());
74 m_colorIsCurrentColor = color.isCurrentColor(); 84 m_colorIsCurrentColor = color.isCurrentColor();
75 } 85 }
(...skipping 10 matching lines...) Expand all
86 unsigned m_width : 26; 96 unsigned m_width : 26;
87 unsigned m_style : 4; // EBorderStyle 97 unsigned m_style : 4; // EBorderStyle
88 98
89 // This is only used by OutlineValue but moved here to keep the bits packed. 99 // This is only used by OutlineValue but moved here to keep the bits packed.
90 unsigned m_isAuto : 1; // OutlineIsAuto 100 unsigned m_isAuto : 1; // OutlineIsAuto
91 }; 101 };
92 102
93 } // namespace WebCore 103 } // namespace WebCore
94 104
95 #endif // BorderValue_h 105 #endif // BorderValue_h
OLDNEW
« no previous file with comments | « Source/core/rendering/style/BorderData.h ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698