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

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

Issue 2742253002: Move cursor property to be generated in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 years, 9 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 DataRef<SVGComputedStyle> m_svgStyle; 201 DataRef<SVGComputedStyle> m_svgStyle;
202 202
203 // !START SYNC!: Keep this in sync with the copy constructor in 203 // !START SYNC!: Keep this in sync with the copy constructor in
204 // ComputedStyle.cpp. 204 // ComputedStyle.cpp.
205 205
206 // inherit 206 // inherit
207 struct InheritedData { 207 struct InheritedData {
208 InheritedData() 208 InheritedData()
209 : m_hasSimpleUnderline(false), 209 : m_hasSimpleUnderline(false),
210 m_cursorStyle(static_cast<unsigned>(initialCursor())),
211 m_insideLink(static_cast<unsigned>(EInsideLink::kNotInsideLink)) {} 210 m_insideLink(static_cast<unsigned>(EInsideLink::kNotInsideLink)) {}
212 211
213 bool operator==(const InheritedData& other) const { 212 bool operator==(const InheritedData& other) const {
214 // Generated properties are compared in ComputedStyleBase 213 // Generated properties are compared in ComputedStyleBase
215 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && 214 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) &&
216 (m_cursorStyle == other.m_cursorStyle) &&
217 (m_insideLink == other.m_insideLink); 215 (m_insideLink == other.m_insideLink);
218 } 216 }
219 217
220 bool operator!=(const InheritedData& other) const { 218 bool operator!=(const InheritedData& other) const {
221 return !(*this == other); 219 return !(*this == other);
222 } 220 }
223 221
224 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only 222 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only
225 // text decoration on this element. 223 // text decoration on this element.
226 unsigned m_cursorStyle : 6; // ECursor
227 224
228 // non CSS2 inherited 225 // non CSS2 inherited
229 unsigned m_insideLink : 2; // EInsideLink 226 unsigned m_insideLink : 2; // EInsideLink
230 } m_inheritedData; 227 } m_inheritedData;
231 228
232 // don't inherit 229 // don't inherit
233 struct NonInheritedData { 230 struct NonInheritedData {
234 NonInheritedData() 231 NonInheritedData()
235 : m_effectiveDisplay(static_cast<unsigned>(initialDisplay())), 232 : m_effectiveDisplay(static_cast<unsigned>(initialDisplay())),
236 m_originalDisplay(static_cast<unsigned>(initialDisplay())), 233 m_originalDisplay(static_cast<unsigned>(initialDisplay())),
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 // -webkit-border-horizontal-spacing 1859 // -webkit-border-horizontal-spacing
1863 static short initialHorizontalBorderSpacing() { return 0; } 1860 static short initialHorizontalBorderSpacing() { return 0; }
1864 short horizontalBorderSpacing() const; 1861 short horizontalBorderSpacing() const;
1865 void setHorizontalBorderSpacing(short); 1862 void setHorizontalBorderSpacing(short);
1866 1863
1867 // -webkit-border-vertical-spacing 1864 // -webkit-border-vertical-spacing
1868 static short initialVerticalBorderSpacing() { return 0; } 1865 static short initialVerticalBorderSpacing() { return 0; }
1869 short verticalBorderSpacing() const; 1866 short verticalBorderSpacing() const;
1870 void setVerticalBorderSpacing(short); 1867 void setVerticalBorderSpacing(short);
1871 1868
1872 // cursor
1873 static ECursor initialCursor() { return ECursor::kAuto; }
1874 ECursor cursor() const {
1875 return static_cast<ECursor>(m_inheritedData.m_cursorStyle);
1876 }
1877 void setCursor(ECursor c) {
1878 m_inheritedData.m_cursorStyle = static_cast<unsigned>(c);
1879 }
1880
1881 // color 1869 // color
1882 static Color initialColor() { return Color::black; } 1870 static Color initialColor() { return Color::black; }
1883 void setColor(const Color&); 1871 void setColor(const Color&);
1884 1872
1885 // hyphens 1873 // hyphens
1886 static Hyphens initialHyphens() { return HyphensManual; } 1874 static Hyphens initialHyphens() { return HyphensManual; }
1887 Hyphens getHyphens() const { 1875 Hyphens getHyphens() const {
1888 return static_cast<Hyphens>(m_rareInheritedData->hyphens); 1876 return static_cast<Hyphens>(m_rareInheritedData->hyphens);
1889 } 1877 }
1890 void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, h); } 1878 void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, h); }
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after
3795 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); 3783 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId);
3796 } 3784 }
3797 3785
3798 inline bool ComputedStyle::hasPseudoElementStyle() const { 3786 inline bool ComputedStyle::hasPseudoElementStyle() const {
3799 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3787 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3800 } 3788 }
3801 3789
3802 } // namespace blink 3790 } // namespace blink
3803 3791
3804 #endif // ComputedStyle_h 3792 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValueIDMappings.h ('k') | third_party/WebKit/Source/core/style/ComputedStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698