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

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

Issue 2563913002: Added functionality in ComputedStyleBase to use platform/ types (Closed)
Patch Set: Rebase Created 3 years, 11 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 DataRef<SVGComputedStyle> m_svgStyle; 193 DataRef<SVGComputedStyle> m_svgStyle;
194 194
195 // !START SYNC!: Keep this in sync with the copy constructor in 195 // !START SYNC!: Keep this in sync with the copy constructor in
196 // ComputedStyle.cpp and implicitlyInherited() in StyleResolver.cpp 196 // ComputedStyle.cpp and implicitlyInherited() in StyleResolver.cpp
197 197
198 // inherit 198 // inherit
199 struct InheritedData { 199 struct InheritedData {
200 bool operator==(const InheritedData& other) const { 200 bool operator==(const InheritedData& other) const {
201 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && 201 return (m_hasSimpleUnderline == other.m_hasSimpleUnderline) &&
202 (m_cursorStyle == other.m_cursorStyle) && 202 (m_cursorStyle == other.m_cursorStyle) &&
203 (m_direction == other.m_direction) &&
204 (m_rtlOrdering == other.m_rtlOrdering) && 203 (m_rtlOrdering == other.m_rtlOrdering) &&
205 (m_insideLink == other.m_insideLink) && 204 (m_insideLink == other.m_insideLink) &&
206 (m_writingMode == other.m_writingMode); 205 (m_writingMode == other.m_writingMode);
207 } 206 }
208 207
209 bool operator!=(const InheritedData& other) const { 208 bool operator!=(const InheritedData& other) const {
210 return !(*this == other); 209 return !(*this == other);
211 } 210 }
212 211
213 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only 212 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only
214 // text decoration on this element. 213 // text decoration on this element.
215 unsigned m_cursorStyle : 6; // ECursor 214 unsigned m_cursorStyle : 6; // ECursor
216 unsigned m_direction : 1; // TextDirection
217 // 32 bits 215 // 32 bits
218 216
219 // non CSS2 inherited 217 // non CSS2 inherited
220 unsigned m_rtlOrdering : 1; // EOrder 218 unsigned m_rtlOrdering : 1; // EOrder
221 unsigned m_insideLink : 2; // EInsideLink 219 unsigned m_insideLink : 2; // EInsideLink
222 220
223 // CSS Text Layout Module Level 3: Vertical writing support 221 // CSS Text Layout Module Level 3: Vertical writing support
224 unsigned m_writingMode : 2; // WritingMode 222 unsigned m_writingMode : 2; // WritingMode
225 // 42 bits 223 // 42 bits
226 } m_inheritedData; 224 } m_inheritedData;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // If you add more style bits here, you will also need to update 304 // If you add more style bits here, you will also need to update
307 // ComputedStyle::copyNonInheritedFromCached() 68 bits 305 // ComputedStyle::copyNonInheritedFromCached() 68 bits
308 } m_nonInheritedData; 306 } m_nonInheritedData;
309 307
310 // !END SYNC! 308 // !END SYNC!
311 309
312 void setBitDefaults() { 310 void setBitDefaults() {
313 ComputedStyleBase::setBitDefaults(); 311 ComputedStyleBase::setBitDefaults();
314 m_inheritedData.m_hasSimpleUnderline = false; 312 m_inheritedData.m_hasSimpleUnderline = false;
315 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); 313 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
316 m_inheritedData.m_direction = static_cast<unsigned>(initialDirection());
317 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); 314 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering());
318 m_inheritedData.m_insideLink = NotInsideLink; 315 m_inheritedData.m_insideLink = NotInsideLink;
319 m_inheritedData.m_writingMode = static_cast<unsigned>(initialWritingMode()); 316 m_inheritedData.m_writingMode = static_cast<unsigned>(initialWritingMode());
320 317
321 m_nonInheritedData.m_effectiveDisplay = 318 m_nonInheritedData.m_effectiveDisplay =
322 m_nonInheritedData.m_originalDisplay = 319 m_nonInheritedData.m_originalDisplay =
323 static_cast<unsigned>(initialDisplay()); 320 static_cast<unsigned>(initialDisplay());
324 m_nonInheritedData.m_overflowAnchor = 321 m_nonInheritedData.m_overflowAnchor =
325 static_cast<unsigned>(initialOverflowAnchor()); 322 static_cast<unsigned>(initialOverflowAnchor());
326 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); 323 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX());
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2014 2011
2015 // cursor 2012 // cursor
2016 static ECursor initialCursor() { return ECursor::Auto; } 2013 static ECursor initialCursor() { return ECursor::Auto; }
2017 ECursor cursor() const { 2014 ECursor cursor() const {
2018 return static_cast<ECursor>(m_inheritedData.m_cursorStyle); 2015 return static_cast<ECursor>(m_inheritedData.m_cursorStyle);
2019 } 2016 }
2020 void setCursor(ECursor c) { 2017 void setCursor(ECursor c) {
2021 m_inheritedData.m_cursorStyle = static_cast<unsigned>(c); 2018 m_inheritedData.m_cursorStyle = static_cast<unsigned>(c);
2022 } 2019 }
2023 2020
2024 // direction
2025 static TextDirection initialDirection() { return TextDirection::Ltr; }
2026 TextDirection direction() const {
2027 return static_cast<TextDirection>(m_inheritedData.m_direction);
2028 }
2029 void setDirection(TextDirection v) {
2030 m_inheritedData.m_direction = static_cast<unsigned>(v);
2031 }
2032
2033 // color 2021 // color
2034 static Color initialColor() { return Color::black; } 2022 static Color initialColor() { return Color::black; }
2035 void setColor(const Color&); 2023 void setColor(const Color&);
2036 2024
2037 // hyphens 2025 // hyphens
2038 static Hyphens initialHyphens() { return HyphensManual; } 2026 static Hyphens initialHyphens() { return HyphensManual; }
2039 Hyphens getHyphens() const { 2027 Hyphens getHyphens() const {
2040 return static_cast<Hyphens>(m_rareInheritedData->hyphens); 2028 return static_cast<Hyphens>(m_rareInheritedData->hyphens);
2041 } 2029 }
2042 void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, h); } 2030 void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, h); }
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
3981 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3969 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3982 } 3970 }
3983 3971
3984 inline bool ComputedStyle::hasPseudoElementStyle() const { 3972 inline bool ComputedStyle::hasPseudoElementStyle() const {
3985 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3973 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3986 } 3974 }
3987 3975
3988 } // namespace blink 3976 } // namespace blink
3989 3977
3990 #endif // ComputedStyle_h 3978 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.in ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698