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

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

Issue 2640143005: Support subpixel layout for borders. (Closed)
Patch Set: 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 } 604 }
605 void setBorderImageWidth(const BorderImageLengthBox&); 605 void setBorderImageWidth(const BorderImageLengthBox&);
606 606
607 // border-image-outset 607 // border-image-outset
608 const BorderImageLengthBox& borderImageOutset() const { 608 const BorderImageLengthBox& borderImageOutset() const {
609 return m_surround->border.image().outset(); 609 return m_surround->border.image().outset();
610 } 610 }
611 void setBorderImageOutset(const BorderImageLengthBox&); 611 void setBorderImageOutset(const BorderImageLengthBox&);
612 612
613 // Border width properties. 613 // Border width properties.
614 static unsigned initialBorderWidth() { return 3; } 614 static float initialBorderWidth() { return 3; }
615 615
616 // border-top-width 616 // border-top-width
617 int borderTopWidth() const { return m_surround->border.borderTopWidth(); } 617 float borderTopWidth() const { return m_surround->border.borderTopWidth(); }
618 void setBorderTopWidth(unsigned v) { 618 void setBorderTopWidth(float v) {
619 SET_VAR(m_surround, border.m_top.m_width, v); 619 SET_VAR(m_surround, border.m_top.m_width, v);
620 } 620 }
621 621
622 // border-bottom-width 622 // border-bottom-width
623 int borderBottomWidth() const { 623 float borderBottomWidth() const {
624 return m_surround->border.borderBottomWidth(); 624 return m_surround->border.borderBottomWidth();
625 } 625 }
626 void setBorderBottomWidth(unsigned v) { 626 void setBorderBottomWidth(float v) {
627 SET_VAR(m_surround, border.m_bottom.m_width, v); 627 SET_VAR(m_surround, border.m_bottom.m_width, v);
628 } 628 }
629 629
630 // border-left-width 630 // border-left-width
631 int borderLeftWidth() const { return m_surround->border.borderLeftWidth(); } 631 float borderLeftWidth() const { return m_surround->border.borderLeftWidth(); }
632 void setBorderLeftWidth(unsigned v) { 632 void setBorderLeftWidth(float v) {
633 SET_VAR(m_surround, border.m_left.m_width, v); 633 SET_VAR(m_surround, border.m_left.m_width, v);
634 } 634 }
635 635
636 // border-right-width 636 // border-right-width
637 int borderRightWidth() const { return m_surround->border.borderRightWidth(); } 637 float borderRightWidth() const {
638 void setBorderRightWidth(unsigned v) { 638 return m_surround->border.borderRightWidth();
639 }
640 void setBorderRightWidth(float v) {
639 SET_VAR(m_surround, border.m_right.m_width, v); 641 SET_VAR(m_surround, border.m_right.m_width, v);
640 } 642 }
641 643
642 // Border style properties. 644 // Border style properties.
643 static EBorderStyle initialBorderStyle() { return BorderStyleNone; } 645 static EBorderStyle initialBorderStyle() { return BorderStyleNone; }
644 646
645 // border-top-style 647 // border-top-style
646 EBorderStyle borderTopStyle() const { 648 EBorderStyle borderTopStyle() const {
647 return m_surround->border.top().style(); 649 return m_surround->border.top().style();
648 } 650 }
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 OutlineIsAuto outlineStyleIsAuto() const { 1451 OutlineIsAuto outlineStyleIsAuto() const {
1450 return static_cast<OutlineIsAuto>( 1452 return static_cast<OutlineIsAuto>(
1451 m_rareNonInheritedData->m_outline.isAuto()); 1453 m_rareNonInheritedData->m_outline.isAuto());
1452 } 1454 }
1453 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { 1455 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) {
1454 SET_VAR(m_rareNonInheritedData, m_outline.m_isAuto, isAuto); 1456 SET_VAR(m_rareNonInheritedData, m_outline.m_isAuto, isAuto);
1455 } 1457 }
1456 1458
1457 // outline-width 1459 // outline-width
1458 static unsigned short initialOutlineWidth() { return 3; } 1460 static unsigned short initialOutlineWidth() { return 3; }
1459 int outlineWidth() const { 1461 unsigned short outlineWidth() const {
1460 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone) 1462 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone)
1461 return 0; 1463 return 0;
1462 return m_rareNonInheritedData->m_outline.width(); 1464 return m_rareNonInheritedData->m_outline.width();
1463 } 1465 }
1464 void setOutlineWidth(unsigned short v) { 1466 void setOutlineWidth(unsigned short v) {
1465 SET_VAR(m_rareNonInheritedData, m_outline.m_width, v); 1467 SET_VAR(m_rareNonInheritedData, m_outline.m_width, v);
1466 } 1468 }
1467 1469
1468 // outline-offset 1470 // outline-offset
1469 static int initialOutlineOffset() { return 0; } 1471 static int initialOutlineOffset() { return 0; }
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after
3174 const BorderValue& borderLeft() const { return m_surround->border.left(); } 3176 const BorderValue& borderLeft() const { return m_surround->border.left(); }
3175 const BorderValue& borderRight() const { return m_surround->border.right(); } 3177 const BorderValue& borderRight() const { return m_surround->border.right(); }
3176 const BorderValue& borderTop() const { return m_surround->border.top(); } 3178 const BorderValue& borderTop() const { return m_surround->border.top(); }
3177 const BorderValue& borderBottom() const { 3179 const BorderValue& borderBottom() const {
3178 return m_surround->border.bottom(); 3180 return m_surround->border.bottom();
3179 } 3181 }
3180 const BorderValue& borderBefore() const; 3182 const BorderValue& borderBefore() const;
3181 const BorderValue& borderAfter() const; 3183 const BorderValue& borderAfter() const;
3182 const BorderValue& borderStart() const; 3184 const BorderValue& borderStart() const;
3183 const BorderValue& borderEnd() const; 3185 const BorderValue& borderEnd() const;
3184 int borderAfterWidth() const; 3186 float borderAfterWidth() const;
3185 int borderBeforeWidth() const; 3187 float borderBeforeWidth() const;
3186 int borderEndWidth() const; 3188 float borderEndWidth() const;
3187 int borderStartWidth() const; 3189 float borderStartWidth() const;
3188 int borderOverWidth() const; 3190 float borderOverWidth() const;
3189 int borderUnderWidth() const; 3191 float borderUnderWidth() const;
3190 3192
3191 bool hasBorderFill() const { return m_surround->border.hasBorderFill(); } 3193 bool hasBorderFill() const { return m_surround->border.hasBorderFill(); }
3192 bool hasBorder() const { return m_surround->border.hasBorder(); } 3194 bool hasBorder() const { return m_surround->border.hasBorder(); }
3193 bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); } 3195 bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); }
3194 bool hasBorderRadius() const { return m_surround->border.hasBorderRadius(); } 3196 bool hasBorderRadius() const { return m_surround->border.hasBorderRadius(); }
3195 3197
3196 void resetBorder() { 3198 void resetBorder() {
3197 resetBorderImage(); 3199 resetBorderImage();
3198 resetBorderTop(); 3200 resetBorderTop();
3199 resetBorderRight(); 3201 resetBorderRight();
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
3935 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3937 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3936 } 3938 }
3937 3939
3938 inline bool ComputedStyle::hasPseudoElementStyle() const { 3940 inline bool ComputedStyle::hasPseudoElementStyle() const {
3939 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3941 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3940 } 3942 }
3941 3943
3942 } // namespace blink 3944 } // namespace blink
3943 3945
3944 #endif // ComputedStyle_h 3946 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698