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

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

Issue 2705143002: Split StyleSurroundData::offset into separate members. (Closed)
Patch Set: Created 3 years, 10 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 return m_surround->border.bottomRight(); 715 return m_surround->border.bottomRight();
716 } 716 }
717 void setBorderBottomRightRadius(const LengthSize& s) { 717 void setBorderBottomRightRadius(const LengthSize& s) {
718 SET_VAR(m_surround, border.m_bottomRight, s); 718 SET_VAR(m_surround, border.m_bottomRight, s);
719 } 719 }
720 720
721 // Offset properties. 721 // Offset properties.
722 static Length initialOffset() { return Length(); } 722 static Length initialOffset() { return Length(); }
723 723
724 // left 724 // left
725 const Length& left() const { return m_surround->offset.left(); } 725 const Length& left() const { return m_surround->m_left; }
726 void setLeft(const Length& v) { SET_VAR(m_surround, offset.m_left, v); } 726 void setLeft(const Length& v) { SET_VAR(m_surround, m_left, v); }
727 727
728 // right 728 // right
729 const Length& right() const { return m_surround->offset.right(); } 729 const Length& right() const { return m_surround->m_right; }
730 void setRight(const Length& v) { SET_VAR(m_surround, offset.m_right, v); } 730 void setRight(const Length& v) { SET_VAR(m_surround, m_right, v); }
731 731
732 // top 732 // top
733 const Length& top() const { return m_surround->offset.top(); } 733 const Length& top() const { return m_surround->m_top; }
734 void setTop(const Length& v) { SET_VAR(m_surround, offset.m_top, v); } 734 void setTop(const Length& v) { SET_VAR(m_surround, m_top, v); }
735 735
736 // bottom 736 // bottom
737 const Length& bottom() const { return m_surround->offset.bottom(); } 737 const Length& bottom() const { return m_surround->m_bottom; }
738 void setBottom(const Length& v) { SET_VAR(m_surround, offset.m_bottom, v); } 738 void setBottom(const Length& v) { SET_VAR(m_surround, m_bottom, v); }
739 739
740 // box-shadow (aka -webkit-box-shadow) 740 // box-shadow (aka -webkit-box-shadow)
741 static ShadowList* initialBoxShadow() { return 0; } 741 static ShadowList* initialBoxShadow() { return 0; }
742 ShadowList* boxShadow() const { 742 ShadowList* boxShadow() const {
743 return m_rareNonInheritedData->m_boxShadow.get(); 743 return m_rareNonInheritedData->m_boxShadow.get();
744 } 744 }
745 void setBoxShadow(PassRefPtr<ShadowList>); 745 void setBoxShadow(PassRefPtr<ShadowList>);
746 746
747 // box-sizing (aka -webkit-box-sizing) 747 // box-sizing (aka -webkit-box-sizing)
748 static EBoxSizing initialBoxSizing() { return EBoxSizing::kContentBox; } 748 static EBoxSizing initialBoxSizing() { return EBoxSizing::kContentBox; }
(...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after
3198 3198
3199 // Clip utility functions. 3199 // Clip utility functions.
3200 const Length& clipLeft() const { return m_visual->clip.left(); } 3200 const Length& clipLeft() const { return m_visual->clip.left(); }
3201 const Length& clipRight() const { return m_visual->clip.right(); } 3201 const Length& clipRight() const { return m_visual->clip.right(); }
3202 const Length& clipTop() const { return m_visual->clip.top(); } 3202 const Length& clipTop() const { return m_visual->clip.top(); }
3203 const Length& clipBottom() const { return m_visual->clip.bottom(); } 3203 const Length& clipBottom() const { return m_visual->clip.bottom(); }
3204 3204
3205 // Offset utility functions. 3205 // Offset utility functions.
3206 // Accessors for positioned object edges that take into account writing mode. 3206 // Accessors for positioned object edges that take into account writing mode.
3207 const Length& logicalLeft() const { 3207 const Length& logicalLeft() const {
3208 return m_surround->offset.logicalLeft(getWritingMode()); 3208 return LengthBox::logicalLeft(getWritingMode(), left(), top());
3209 } 3209 }
3210 const Length& logicalRight() const { 3210 const Length& logicalRight() const {
3211 return m_surround->offset.logicalRight(getWritingMode()); 3211 return LengthBox::logicalRight(getWritingMode(), right(), bottom());
3212 } 3212 }
3213 const Length& logicalTop() const { 3213 const Length& logicalTop() const {
3214 return m_surround->offset.before(getWritingMode()); 3214 return LengthBox::before(getWritingMode(), top(), left(), right());
3215 } 3215 }
3216 const Length& logicalBottom() const { 3216 const Length& logicalBottom() const {
3217 return m_surround->offset.after(getWritingMode()); 3217 return LengthBox::after(getWritingMode(), bottom(), left(), right());
3218 }
3219 bool offsetEqual(const ComputedStyle& other) const {
3220 return left() == other.left() && right() == other.right() &&
3221 top() == other.top() && bottom() == other.bottom();
3218 } 3222 }
3219 3223
3220 // Whether or not a positioned element requires normal flow x/y to be computed 3224 // Whether or not a positioned element requires normal flow x/y to be computed
3221 // to determine its position. 3225 // to determine its position.
3222 bool hasAutoLeftAndRight() const { 3226 bool hasAutoLeftAndRight() const {
3223 return left().isAuto() && right().isAuto(); 3227 return left().isAuto() && right().isAuto();
3224 } 3228 }
3225 bool hasAutoTopAndBottom() const { 3229 bool hasAutoTopAndBottom() const {
3226 return top().isAuto() && bottom().isAuto(); 3230 return top().isAuto() && bottom().isAuto();
3227 } 3231 }
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
3847 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3851 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3848 } 3852 }
3849 3853
3850 inline bool ComputedStyle::hasPseudoElementStyle() const { 3854 inline bool ComputedStyle::hasPseudoElementStyle() const {
3851 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3855 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3852 } 3856 }
3853 3857
3854 } // namespace blink 3858 } // namespace blink
3855 3859
3856 #endif // ComputedStyle_h 3860 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | third_party/WebKit/Source/platform/LengthBox.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698