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

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

Issue 1574933002: Changed type of border-width longhands from unsigned to float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added trivial tests safe to rebaseline to TestExpectations Created 4 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 r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 bool borderImageSlicesFill() const { return surround->border.image().fill(); } 527 bool borderImageSlicesFill() const { return surround->border.image().fill(); }
528 const BorderImageLengthBox& borderImageWidth() const { return surround->bord er.image().borderSlices(); } 528 const BorderImageLengthBox& borderImageWidth() const { return surround->bord er.image().borderSlices(); }
529 const BorderImageLengthBox& borderImageOutset() const { return surround->bor der.image().outset(); } 529 const BorderImageLengthBox& borderImageOutset() const { return surround->bor der.image().outset(); }
530 530
531 const LengthSize& borderTopLeftRadius() const { return surround->border.topL eft(); } 531 const LengthSize& borderTopLeftRadius() const { return surround->border.topL eft(); }
532 const LengthSize& borderTopRightRadius() const { return surround->border.top Right(); } 532 const LengthSize& borderTopRightRadius() const { return surround->border.top Right(); }
533 const LengthSize& borderBottomLeftRadius() const { return surround->border.b ottomLeft(); } 533 const LengthSize& borderBottomLeftRadius() const { return surround->border.b ottomLeft(); }
534 const LengthSize& borderBottomRightRadius() const { return surround->border. bottomRight(); } 534 const LengthSize& borderBottomRightRadius() const { return surround->border. bottomRight(); }
535 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); } 535 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
536 536
537 int borderLeftWidth() const { return surround->border.borderLeftWidth(); } 537 float borderLeftWidth() const { return surround->border.borderLeftWidth(); }
538 EBorderStyle borderLeftStyle() const { return surround->border.left().style( ); } 538 EBorderStyle borderLeftStyle() const { return surround->border.left().style( ); }
539 int borderRightWidth() const { return surround->border.borderRightWidth(); } 539 float borderRightWidth() const { return surround->border.borderRightWidth(); }
540 EBorderStyle borderRightStyle() const { return surround->border.right().styl e(); } 540 EBorderStyle borderRightStyle() const { return surround->border.right().styl e(); }
541 int borderTopWidth() const { return surround->border.borderTopWidth(); } 541 float borderTopWidth() const { return surround->border.borderTopWidth(); }
542 EBorderStyle borderTopStyle() const { return surround->border.top().style(); } 542 EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
543 int borderBottomWidth() const { return surround->border.borderBottomWidth(); } 543 float borderBottomWidth() const { return surround->border.borderBottomWidth( ); }
544 EBorderStyle borderBottomStyle() const { return surround->border.bottom().st yle(); } 544 EBorderStyle borderBottomStyle() const { return surround->border.bottom().st yle(); }
545 545
546 int borderBeforeWidth() const; 546 float borderBeforeWidth() const;
547 int borderAfterWidth() const; 547 float borderAfterWidth() const;
548 int borderStartWidth() const; 548 float borderStartWidth() const;
549 int borderEndWidth() const; 549 float borderEndWidth() const;
550 int borderOverWidth() const; 550 float borderOverWidth() const;
551 int borderUnderWidth() const; 551 float borderUnderWidth() const;
552 552
553 // TODO(bugsnash): change return type to float when outline offset is change d to float
553 int outlineWidth() const 554 int outlineWidth() const
554 { 555 {
555 if (m_background->outline().style() == BNONE) 556 if (m_background->outline().style() == BNONE)
556 return 0; 557 return 0;
557 return m_background->outline().width(); 558 return m_background->outline().width();
558 } 559 }
559 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHID DEN; } 560 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHID DEN; }
560 EBorderStyle outlineStyle() const { return m_background->outline().style(); } 561 EBorderStyle outlineStyle() const { return m_background->outline().style(); }
561 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto> (m_background->outline().isAuto()); } 562 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto> (m_background->outline().isAuto()); }
562 int outlineOutsetExtent() const; 563 int outlineOutsetExtent() const;
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed))); 1106 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
1106 } 1107 }
1107 1108
1108 FloatRoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool incl udeLogicalLeftEdge = true, 1109 FloatRoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool incl udeLogicalLeftEdge = true,
1109 bool includeLogicalRightEdge = true) const; 1110 bool includeLogicalRightEdge = true) const;
1110 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; 1111 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1111 1112
1112 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, 1113 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,
1113 const LayoutRectOutsets insets, bool includeLogicalLeftEdge, bool includ eLogicalRightEdge) const; 1114 const LayoutRectOutsets insets, bool includeLogicalLeftEdge, bool includ eLogicalRightEdge) const;
1114 1115
1115 void setBorderLeftWidth(unsigned v) { SET_VAR(surround, border.m_left.m_widt h, v); } 1116 void setBorderLeftWidth(float v)
1117 {
1118 ASSERT(v >= 0);
1119 SET_VAR(surround, border.m_left.m_width, v);
1120 }
1116 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_ style, v); } 1121 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_ style, v); }
1117 void setBorderLeftColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surroun d, border.m_left, v); } 1122 void setBorderLeftColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surroun d, border.m_left, v); }
1118 void setBorderRightWidth(unsigned v) { SET_VAR(surround, border.m_right.m_wi dth, v); } 1123 void setBorderRightWidth(float v)
1124 {
1125 ASSERT(v >= 0);
1126 SET_VAR(surround, border.m_right.m_width, v);
1127 }
1119 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right. m_style, v); } 1128 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right. m_style, v); }
1120 void setBorderRightColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surrou nd, border.m_right, v); } 1129 void setBorderRightColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surrou nd, border.m_right, v); }
1121 void setBorderTopWidth(unsigned v) { SET_VAR(surround, border.m_top.m_width, v); } 1130 void setBorderTopWidth(float v)
1131 {
1132 ASSERT(v >= 0);
1133 SET_VAR(surround, border.m_top.m_width, v);
1134 }
1122 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_st yle, v); } 1135 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_st yle, v); }
1123 void setBorderTopColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround , border.m_top, v); } 1136 void setBorderTopColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround , border.m_top, v); }
1124 void setBorderBottomWidth(unsigned v) { SET_VAR(surround, border.m_bottom.m_ width, v); } 1137 void setBorderBottomWidth(float v)
1138 {
1139 ASSERT(v >= 0);
1140 SET_VAR(surround, border.m_bottom.m_width, v);
1141 }
1125 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_botto m.m_style, v); } 1142 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_botto m.m_style, v); }
1126 void setBorderBottomColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surro und, border.m_bottom, v); } 1143 void setBorderBottomColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surro und, border.m_bottom, v); }
1127 1144
1128 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_w idth, v); } 1145 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_w idth, v); }
1129 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_o utline.m_isAuto, isAuto); } 1146 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_o utline.m_isAuto, isAuto); }
1130 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_sty le, v); } 1147 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_sty le, v); }
1131 void setOutlineColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_backgrou nd, m_outline, v); } 1148 void setOutlineColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_backgrou nd, m_outline, v); }
1132 bool isOutlineEquivalent(const ComputedStyle* otherStyle) const 1149 bool isOutlineEquivalent(const ComputedStyle* otherStyle) const
1133 { 1150 {
1134 // No other style, so we don't have an outline then we consider them to be the same. 1151 // No other style, so we don't have an outline then we consider them to be the same.
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 static ETableLayout initialTableLayout() { return TAUTO; } 1682 static ETableLayout initialTableLayout() { return TAUTO; }
1666 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } 1683 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
1667 static ETextTransform initialTextTransform() { return TTNONE; } 1684 static ETextTransform initialTextTransform() { return TTNONE; }
1668 static EVisibility initialVisibility() { return VISIBLE; } 1685 static EVisibility initialVisibility() { return VISIBLE; }
1669 static EWhiteSpace initialWhiteSpace() { return NORMAL; } 1686 static EWhiteSpace initialWhiteSpace() { return NORMAL; }
1670 static short initialHorizontalBorderSpacing() { return 0; } 1687 static short initialHorizontalBorderSpacing() { return 0; }
1671 static short initialVerticalBorderSpacing() { return 0; } 1688 static short initialVerticalBorderSpacing() { return 0; }
1672 static ECursor initialCursor() { return CURSOR_AUTO; } 1689 static ECursor initialCursor() { return CURSOR_AUTO; }
1673 static Color initialColor() { return Color::black; } 1690 static Color initialColor() { return Color::black; }
1674 static StyleImage* initialListStyleImage() { return 0; } 1691 static StyleImage* initialListStyleImage() { return 0; }
1675 static unsigned initialBorderWidth() { return 3; } 1692 static float initialBorderWidth() { return 3.0f; }
1676 static unsigned short initialColumnRuleWidth() { return 3; } 1693 static unsigned short initialColumnRuleWidth() { return 3; }
1677 static unsigned short initialOutlineWidth() { return 3; } 1694 static unsigned short initialOutlineWidth() { return 3; }
1678 static float initialLetterWordSpacing() { return 0.0f; } 1695 static float initialLetterWordSpacing() { return 0.0f; }
1679 static Length initialSize() { return Length(); } 1696 static Length initialSize() { return Length(); }
1680 static Length initialMinSize() { return Length(); } 1697 static Length initialMinSize() { return Length(); }
1681 static Length initialMaxSize() { return Length(MaxSizeNone); } 1698 static Length initialMaxSize() { return Length(MaxSizeNone); }
1682 static Length initialOffset() { return Length(); } 1699 static Length initialOffset() { return Length(); }
1683 static Length initialMargin() { return Length(Fixed); } 1700 static Length initialMargin() { return Length(Fixed); }
1684 static Length initialPadding() { return Length(Fixed); } 1701 static Length initialPadding() { return Length(Fixed); }
1685 static Length initialTextIndent() { return Length(Fixed); } 1702 static Length initialTextIndent() { return Length(Fixed); }
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 } 2035 }
2019 2036
2020 inline bool ComputedStyle::hasPseudoElementStyle() const 2037 inline bool ComputedStyle::hasPseudoElementStyle() const
2021 { 2038 {
2022 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; 2039 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK;
2023 } 2040 }
2024 2041
2025 } // namespace blink 2042 } // namespace blink
2026 2043
2027 #endif // ComputedStyle_h 2044 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/CollapsedBorderValue.h ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698