OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 | 1526 |
1527 // Take the alpha from the unvisited color, but get the RGB values from the
visited color. | 1527 // Take the alpha from the unvisited color, but get the RGB values from the
visited color. |
1528 return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(),
unvisitedColor.alpha()); | 1528 return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(),
unvisitedColor.alpha()); |
1529 } | 1529 } |
1530 | 1530 |
1531 const BorderValue& ComputedStyle::borderBefore() const | 1531 const BorderValue& ComputedStyle::borderBefore() const |
1532 { | 1532 { |
1533 switch (writingMode()) { | 1533 switch (writingMode()) { |
1534 case TopToBottomWritingMode: | 1534 case TopToBottomWritingMode: |
1535 return borderTop(); | 1535 return borderTop(); |
1536 case BottomToTopWritingMode: | |
1537 return borderBottom(); | |
1538 case LeftToRightWritingMode: | 1536 case LeftToRightWritingMode: |
1539 return borderLeft(); | 1537 return borderLeft(); |
1540 case RightToLeftWritingMode: | 1538 case RightToLeftWritingMode: |
1541 return borderRight(); | 1539 return borderRight(); |
1542 } | 1540 } |
1543 ASSERT_NOT_REACHED(); | 1541 ASSERT_NOT_REACHED(); |
1544 return borderTop(); | 1542 return borderTop(); |
1545 } | 1543 } |
1546 | 1544 |
1547 const BorderValue& ComputedStyle::borderAfter() const | 1545 const BorderValue& ComputedStyle::borderAfter() const |
1548 { | 1546 { |
1549 switch (writingMode()) { | 1547 switch (writingMode()) { |
1550 case TopToBottomWritingMode: | 1548 case TopToBottomWritingMode: |
1551 return borderBottom(); | 1549 return borderBottom(); |
1552 case BottomToTopWritingMode: | |
1553 return borderTop(); | |
1554 case LeftToRightWritingMode: | 1550 case LeftToRightWritingMode: |
1555 return borderRight(); | 1551 return borderRight(); |
1556 case RightToLeftWritingMode: | 1552 case RightToLeftWritingMode: |
1557 return borderLeft(); | 1553 return borderLeft(); |
1558 } | 1554 } |
1559 ASSERT_NOT_REACHED(); | 1555 ASSERT_NOT_REACHED(); |
1560 return borderBottom(); | 1556 return borderBottom(); |
1561 } | 1557 } |
1562 | 1558 |
1563 const BorderValue& ComputedStyle::borderStart() const | 1559 const BorderValue& ComputedStyle::borderStart() const |
1564 { | 1560 { |
1565 if (isHorizontalWritingMode()) | 1561 if (isHorizontalWritingMode()) |
1566 return isLeftToRightDirection() ? borderLeft() : borderRight(); | 1562 return isLeftToRightDirection() ? borderLeft() : borderRight(); |
1567 return isLeftToRightDirection() ? borderTop() : borderBottom(); | 1563 return isLeftToRightDirection() ? borderTop() : borderBottom(); |
1568 } | 1564 } |
1569 | 1565 |
1570 const BorderValue& ComputedStyle::borderEnd() const | 1566 const BorderValue& ComputedStyle::borderEnd() const |
1571 { | 1567 { |
1572 if (isHorizontalWritingMode()) | 1568 if (isHorizontalWritingMode()) |
1573 return isLeftToRightDirection() ? borderRight() : borderLeft(); | 1569 return isLeftToRightDirection() ? borderRight() : borderLeft(); |
1574 return isLeftToRightDirection() ? borderBottom() : borderTop(); | 1570 return isLeftToRightDirection() ? borderBottom() : borderTop(); |
1575 } | 1571 } |
1576 | 1572 |
1577 int ComputedStyle::borderBeforeWidth() const | 1573 int ComputedStyle::borderBeforeWidth() const |
1578 { | 1574 { |
1579 switch (writingMode()) { | 1575 switch (writingMode()) { |
1580 case TopToBottomWritingMode: | 1576 case TopToBottomWritingMode: |
1581 return borderTopWidth(); | 1577 return borderTopWidth(); |
1582 case BottomToTopWritingMode: | |
1583 return borderBottomWidth(); | |
1584 case LeftToRightWritingMode: | 1578 case LeftToRightWritingMode: |
1585 return borderLeftWidth(); | 1579 return borderLeftWidth(); |
1586 case RightToLeftWritingMode: | 1580 case RightToLeftWritingMode: |
1587 return borderRightWidth(); | 1581 return borderRightWidth(); |
1588 } | 1582 } |
1589 ASSERT_NOT_REACHED(); | 1583 ASSERT_NOT_REACHED(); |
1590 return borderTopWidth(); | 1584 return borderTopWidth(); |
1591 } | 1585 } |
1592 | 1586 |
1593 int ComputedStyle::borderAfterWidth() const | 1587 int ComputedStyle::borderAfterWidth() const |
1594 { | 1588 { |
1595 switch (writingMode()) { | 1589 switch (writingMode()) { |
1596 case TopToBottomWritingMode: | 1590 case TopToBottomWritingMode: |
1597 return borderBottomWidth(); | 1591 return borderBottomWidth(); |
1598 case BottomToTopWritingMode: | |
1599 return borderTopWidth(); | |
1600 case LeftToRightWritingMode: | 1592 case LeftToRightWritingMode: |
1601 return borderRightWidth(); | 1593 return borderRightWidth(); |
1602 case RightToLeftWritingMode: | 1594 case RightToLeftWritingMode: |
1603 return borderLeftWidth(); | 1595 return borderLeftWidth(); |
1604 } | 1596 } |
1605 ASSERT_NOT_REACHED(); | 1597 ASSERT_NOT_REACHED(); |
1606 return borderBottomWidth(); | 1598 return borderBottomWidth(); |
1607 } | 1599 } |
1608 | 1600 |
1609 int ComputedStyle::borderStartWidth() const | 1601 int ComputedStyle::borderStartWidth() const |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 } | 1791 } |
1800 | 1792 |
1801 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) | 1793 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) |
1802 { | 1794 { |
1803 setEmptyState(other.emptyState()); | 1795 setEmptyState(other.emptyState()); |
1804 if (other.hasExplicitlyInheritedProperties()) | 1796 if (other.hasExplicitlyInheritedProperties()) |
1805 setHasExplicitlyInheritedProperties(); | 1797 setHasExplicitlyInheritedProperties(); |
1806 } | 1798 } |
1807 | 1799 |
1808 } // namespace blink | 1800 } // namespace blink |
OLD | NEW |