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

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

Issue 2841453002: Generate StyleVisualData in ComputedStyleBase. (Closed)
Patch Set: Rebase 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, 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "core/style/StyleGridData.h" 46 #include "core/style/StyleGridData.h"
47 #include "core/style/StyleGridItemData.h" 47 #include "core/style/StyleGridItemData.h"
48 #include "core/style/StyleInheritedData.h" 48 #include "core/style/StyleInheritedData.h"
49 #include "core/style/StyleMultiColData.h" 49 #include "core/style/StyleMultiColData.h"
50 #include "core/style/StyleOffsetRotation.h" 50 #include "core/style/StyleOffsetRotation.h"
51 #include "core/style/StyleRareInheritedData.h" 51 #include "core/style/StyleRareInheritedData.h"
52 #include "core/style/StyleRareNonInheritedData.h" 52 #include "core/style/StyleRareNonInheritedData.h"
53 #include "core/style/StyleReflection.h" 53 #include "core/style/StyleReflection.h"
54 #include "core/style/StyleSelfAlignmentData.h" 54 #include "core/style/StyleSelfAlignmentData.h"
55 #include "core/style/StyleTransformData.h" 55 #include "core/style/StyleTransformData.h"
56 #include "core/style/StyleVisualData.h"
57 #include "core/style/StyleWillChangeData.h" 56 #include "core/style/StyleWillChangeData.h"
58 #include "core/style/TransformOrigin.h" 57 #include "core/style/TransformOrigin.h"
59 #include "platform/Length.h" 58 #include "platform/Length.h"
60 #include "platform/LengthBox.h" 59 #include "platform/LengthBox.h"
61 #include "platform/LengthPoint.h" 60 #include "platform/LengthPoint.h"
62 #include "platform/LengthSize.h" 61 #include "platform/LengthSize.h"
63 #include "platform/RuntimeEnabledFeatures.h" 62 #include "platform/RuntimeEnabledFeatures.h"
64 #include "platform/ThemeTypes.h" 63 #include "platform/ThemeTypes.h"
65 #include "platform/fonts/FontDescription.h" 64 #include "platform/fonts/FontDescription.h"
66 #include "platform/geometry/FloatRoundedRect.h" 65 #include "platform/geometry/FloatRoundedRect.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // removed. 176 // removed.
178 friend class CSSToStyleMap; 177 friend class CSSToStyleMap;
179 friend class FilterOperationResolver; 178 friend class FilterOperationResolver;
180 friend class StyleBuilderConverter; 179 friend class StyleBuilderConverter;
181 friend class StyleResolverState; 180 friend class StyleResolverState;
182 friend class StyleResolver; 181 friend class StyleResolver;
183 182
184 protected: 183 protected:
185 // non-inherited attributes 184 // non-inherited attributes
186 DataRef<StyleBoxData> box_data_; 185 DataRef<StyleBoxData> box_data_;
187 DataRef<StyleVisualData> visual_data_;
188 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; 186 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_;
189 187
190 // inherited attributes 188 // inherited attributes
191 DataRef<StyleRareInheritedData> rare_inherited_data_; 189 DataRef<StyleRareInheritedData> rare_inherited_data_;
192 DataRef<StyleInheritedData> style_inherited_data_; 190 DataRef<StyleInheritedData> style_inherited_data_;
193 191
194 // list of associated pseudo styles 192 // list of associated pseudo styles
195 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; 193 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_;
196 194
197 DataRef<SVGComputedStyle> svg_style_; 195 DataRef<SVGComputedStyle> svg_style_;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 602
605 // box-sizing (aka -webkit-box-sizing) 603 // box-sizing (aka -webkit-box-sizing)
606 static EBoxSizing InitialBoxSizing() { return EBoxSizing::kContentBox; } 604 static EBoxSizing InitialBoxSizing() { return EBoxSizing::kContentBox; }
607 EBoxSizing BoxSizing() const { return box_data_->BoxSizing(); } 605 EBoxSizing BoxSizing() const { return box_data_->BoxSizing(); }
608 void SetBoxSizing(EBoxSizing s) { 606 void SetBoxSizing(EBoxSizing s) {
609 SET_VAR(box_data_, box_sizing_, static_cast<unsigned>(s)); 607 SET_VAR(box_data_, box_sizing_, static_cast<unsigned>(s));
610 } 608 }
611 609
612 // clip 610 // clip
613 static LengthBox InitialClip() { return LengthBox(); } 611 static LengthBox InitialClip() { return LengthBox(); }
614 const LengthBox& Clip() const { return visual_data_->clip; } 612 const LengthBox& Clip() const { return visual_data_->clip_; }
615 void SetClip(const LengthBox& box) { 613 void SetClip(const LengthBox& box) {
616 SET_VAR(visual_data_, has_auto_clip, false); 614 SET_VAR(visual_data_, has_auto_clip_, false);
617 SET_VAR(visual_data_, clip, box); 615 SET_VAR(visual_data_, clip_, box);
618 } 616 }
619 bool HasAutoClip() const { return visual_data_->has_auto_clip; } 617 bool HasAutoClip() const { return visual_data_->has_auto_clip_; }
620 void SetHasAutoClip() { 618 void SetHasAutoClip() {
621 SET_VAR(visual_data_, has_auto_clip, true); 619 SET_VAR(visual_data_, has_auto_clip_, true);
622 SET_VAR(visual_data_, clip, ComputedStyle::InitialClip()); 620 SET_VAR(visual_data_, clip_, ComputedStyle::InitialClip());
623 } 621 }
624 622
625 // Column properties. 623 // Column properties.
626 // column-count (aka -webkit-column-count) 624 // column-count (aka -webkit-column-count)
627 static unsigned short InitialColumnCount() { return 1; } 625 static unsigned short InitialColumnCount() { return 1; }
628 unsigned short ColumnCount() const { 626 unsigned short ColumnCount() const {
629 return rare_non_inherited_data_->multi_col_->count_; 627 return rare_non_inherited_data_->multi_col_->count_;
630 } 628 }
631 void SetColumnCount(unsigned short c) { 629 void SetColumnCount(unsigned short c) {
632 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, auto_count_, false); 630 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, auto_count_, false);
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 SET_VAR(rare_non_inherited_data_, page_size_, s); 1486 SET_VAR(rare_non_inherited_data_, page_size_, s);
1489 } 1487 }
1490 void SetPageSizeType(PageSizeType t) { 1488 void SetPageSizeType(PageSizeType t) {
1491 SET_VAR(rare_non_inherited_data_, page_size_type_, t); 1489 SET_VAR(rare_non_inherited_data_, page_size_type_, t);
1492 } 1490 }
1493 1491
1494 // Text decoration properties. 1492 // Text decoration properties.
1495 // text-decoration-line 1493 // text-decoration-line
1496 static TextDecoration InitialTextDecoration() { return kTextDecorationNone; } 1494 static TextDecoration InitialTextDecoration() { return kTextDecorationNone; }
1497 TextDecoration GetTextDecoration() const { 1495 TextDecoration GetTextDecoration() const {
1498 return static_cast<TextDecoration>(visual_data_->text_decoration); 1496 return static_cast<TextDecoration>(visual_data_->text_decoration_);
1499 } 1497 }
1500 void SetTextDecoration(TextDecoration v) { 1498 void SetTextDecoration(TextDecoration v) {
1501 SET_VAR(visual_data_, text_decoration, v); 1499 SET_VAR(visual_data_, text_decoration_, v);
1502 } 1500 }
1503 1501
1504 // text-decoration-color 1502 // text-decoration-color
1505 void SetTextDecorationColor(const StyleColor& c) { 1503 void SetTextDecorationColor(const StyleColor& c) {
1506 SET_VAR(rare_non_inherited_data_, text_decoration_color_, c); 1504 SET_VAR(rare_non_inherited_data_, text_decoration_color_, c);
1507 } 1505 }
1508 1506
1509 // text-decoration-style 1507 // text-decoration-style
1510 static TextDecorationStyle InitialTextDecorationStyle() { 1508 static TextDecorationStyle InitialTextDecorationStyle() {
1511 return kTextDecorationStyleSolid; 1509 return kTextDecorationStyleSolid;
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 bool HasInFlowPosition() const { 2998 bool HasInFlowPosition() const {
3001 return GetPosition() == EPosition::kRelative || 2999 return GetPosition() == EPosition::kRelative ||
3002 GetPosition() == EPosition::kSticky; 3000 GetPosition() == EPosition::kSticky;
3003 } 3001 }
3004 bool HasViewportConstrainedPosition() const { 3002 bool HasViewportConstrainedPosition() const {
3005 return GetPosition() == EPosition::kFixed || 3003 return GetPosition() == EPosition::kFixed ||
3006 GetPosition() == EPosition::kSticky; 3004 GetPosition() == EPosition::kSticky;
3007 } 3005 }
3008 3006
3009 // Clip utility functions. 3007 // Clip utility functions.
3010 const Length& ClipLeft() const { return visual_data_->clip.Left(); } 3008 const Length& ClipLeft() const { return visual_data_->clip_.Left(); }
3011 const Length& ClipRight() const { return visual_data_->clip.Right(); } 3009 const Length& ClipRight() const { return visual_data_->clip_.Right(); }
3012 const Length& ClipTop() const { return visual_data_->clip.Top(); } 3010 const Length& ClipTop() const { return visual_data_->clip_.Top(); }
3013 const Length& ClipBottom() const { return visual_data_->clip.Bottom(); } 3011 const Length& ClipBottom() const { return visual_data_->clip_.Bottom(); }
3014 3012
3015 // Offset utility functions. 3013 // Offset utility functions.
3016 // Accessors for positioned object edges that take into account writing mode. 3014 // Accessors for positioned object edges that take into account writing mode.
3017 const Length& LogicalLeft() const { 3015 const Length& LogicalLeft() const {
3018 return LengthBox::LogicalLeft(GetWritingMode(), Left(), Top()); 3016 return LengthBox::LogicalLeft(GetWritingMode(), Left(), Top());
3019 } 3017 }
3020 const Length& LogicalRight() const { 3018 const Length& LogicalRight() const {
3021 return LengthBox::LogicalRight(GetWritingMode(), Right(), Bottom()); 3019 return LengthBox::LogicalRight(GetWritingMode(), Right(), Bottom());
3022 } 3020 }
3023 const Length& LogicalTop() const { 3021 const Length& LogicalTop() const {
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
3690 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3688 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3691 } 3689 }
3692 3690
3693 inline bool ComputedStyle::HasPseudoElementStyle() const { 3691 inline bool ComputedStyle::HasPseudoElementStyle() const {
3694 return PseudoBitsInternal() & kElementPseudoIdMask; 3692 return PseudoBitsInternal() & kElementPseudoIdMask;
3695 } 3693 }
3696 3694
3697 } // namespace blink 3695 } // namespace blink
3698 3696
3699 #endif // ComputedStyle_h 3697 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/BUILD.gn ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698