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

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

Issue 2908933002: Make PageSizeType an enum class. (Closed)
Patch Set: Created 3 years, 6 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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 const FloatSize& PageSize() const { 1435 const FloatSize& PageSize() const {
1436 return rare_non_inherited_data_->page_size_; 1436 return rare_non_inherited_data_->page_size_;
1437 } 1437 }
1438 PageSizeType GetPageSizeType() const { 1438 PageSizeType GetPageSizeType() const {
1439 return static_cast<PageSizeType>(rare_non_inherited_data_->page_size_type_); 1439 return static_cast<PageSizeType>(rare_non_inherited_data_->page_size_type_);
1440 } 1440 }
1441 void SetPageSize(const FloatSize& s) { 1441 void SetPageSize(const FloatSize& s) {
1442 SET_VAR(rare_non_inherited_data_, page_size_, s); 1442 SET_VAR(rare_non_inherited_data_, page_size_, s);
1443 } 1443 }
1444 void SetPageSizeType(PageSizeType t) { 1444 void SetPageSizeType(PageSizeType t) {
1445 SET_VAR(rare_non_inherited_data_, page_size_type_, t); 1445 SET_VAR(rare_non_inherited_data_, page_size_type_,
1446 static_cast<unsigned>(t));
1446 } 1447 }
1447 1448
1448 // Text decoration properties. 1449 // Text decoration properties.
1449 // text-decoration-line 1450 // text-decoration-line
1450 static TextDecoration InitialTextDecoration() { 1451 static TextDecoration InitialTextDecoration() {
1451 return TextDecoration::kNone; 1452 return TextDecoration::kNone;
1452 } 1453 }
1453 TextDecoration GetTextDecoration() const { 1454 TextDecoration GetTextDecoration() const {
1454 return static_cast<TextDecoration>(TextDecorationInternal()); 1455 return static_cast<TextDecoration>(TextDecorationInternal());
1455 } 1456 }
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3045 return Direction() == TextDirection::kLtr; 3046 return Direction() == TextDirection::kLtr;
3046 } 3047 }
3047 3048
3048 // Perspective utility functions. 3049 // Perspective utility functions.
3049 bool HasPerspective() const { 3050 bool HasPerspective() const {
3050 return rare_non_inherited_data_->perspective_ > 0; 3051 return rare_non_inherited_data_->perspective_ > 0;
3051 } 3052 }
3052 3053
3053 // Page size utility functions. 3054 // Page size utility functions.
3054 void ResetPageSizeType() { 3055 void ResetPageSizeType() {
3055 SET_VAR(rare_non_inherited_data_, page_size_type_, PAGE_SIZE_AUTO); 3056 SET_VAR(rare_non_inherited_data_, page_size_type_,
3057 static_cast<unsigned>(PageSizeType::kAuto));
3056 } 3058 }
3057 3059
3058 // Outline utility functions. 3060 // Outline utility functions.
3059 bool HasOutline() const { 3061 bool HasOutline() const {
3060 return OutlineWidth() > 0 && OutlineStyle() > EBorderStyle::kHidden; 3062 return OutlineWidth() > 0 && OutlineStyle() > EBorderStyle::kHidden;
3061 } 3063 }
3062 int OutlineOutsetExtent() const; 3064 int OutlineOutsetExtent() const;
3063 float GetOutlineStrokeWidthForFocusRing() const; 3065 float GetOutlineStrokeWidthForFocusRing() const;
3064 bool HasOutlineWithCurrentColor() const { 3066 bool HasOutlineWithCurrentColor() const {
3065 return HasOutline() && OutlineColor().IsCurrentColor(); 3067 return HasOutline() && OutlineColor().IsCurrentColor();
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3806 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3808 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3807 } 3809 }
3808 3810
3809 inline bool ComputedStyle::HasPseudoElementStyle() const { 3811 inline bool ComputedStyle::HasPseudoElementStyle() const {
3810 return PseudoBitsInternal() & kElementPseudoIdMask; 3812 return PseudoBitsInternal() & kElementPseudoIdMask;
3811 } 3813 }
3812 3814
3813 } // namespace blink 3815 } // namespace blink
3814 3816
3815 #endif // ComputedStyle_h 3817 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698