| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 * (C) 1997 Torben Weis (weis@kde.org) | 3 * (C) 1997 Torben Weis (weis@kde.org) |
| 4 * (C) 1998 Waldo Bastian (bastian@kde.org) | 4 * (C) 1998 Waldo Bastian (bastian@kde.org) |
| 5 * (C) 1999 Lars Knoll (knoll@kde.org) | 5 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 return result; | 850 return result; |
| 851 } | 851 } |
| 852 | 852 |
| 853 return result; | 853 return result; |
| 854 } | 854 } |
| 855 | 855 |
| 856 inline CollapsedBorderValue RenderTableCell::cachedCollapsedLeftBorder(const Ren
derStyle* styleForCellFlow) const | 856 inline CollapsedBorderValue RenderTableCell::cachedCollapsedLeftBorder(const Ren
derStyle* styleForCellFlow) const |
| 857 { | 857 { |
| 858 if (styleForCellFlow->isHorizontalWritingMode()) | 858 if (styleForCellFlow->isHorizontalWritingMode()) |
| 859 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCol
lapsedBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd); | 859 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCol
lapsedBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd); |
| 860 return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cachedCol
lapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CBSBefore)
; | 860 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? section()->cache
dCollapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CBSBef
ore); |
| 861 } | 861 } |
| 862 | 862 |
| 863 inline CollapsedBorderValue RenderTableCell::cachedCollapsedRightBorder(const Re
nderStyle* styleForCellFlow) const | 863 inline CollapsedBorderValue RenderTableCell::cachedCollapsedRightBorder(const Re
nderStyle* styleForCellFlow) const |
| 864 { | 864 { |
| 865 if (styleForCellFlow->isHorizontalWritingMode()) | 865 if (styleForCellFlow->isHorizontalWritingMode()) |
| 866 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCol
lapsedBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart); | 866 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCol
lapsedBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart); |
| 867 return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cachedCol
lapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, CBSAfter)
; | 867 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? section()->cache
dCollapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, CBSAf
ter); |
| 868 } | 868 } |
| 869 | 869 |
| 870 inline CollapsedBorderValue RenderTableCell::cachedCollapsedTopBorder(const Rend
erStyle* styleForCellFlow) const | 870 inline CollapsedBorderValue RenderTableCell::cachedCollapsedTopBorder(const Rend
erStyle* styleForCellFlow) const |
| 871 { | 871 { |
| 872 if (styleForCellFlow->isHorizontalWritingMode()) | 872 if (styleForCellFlow->isHorizontalWritingMode()) |
| 873 return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cache
dCollapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CBSBef
ore); | 873 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? section()->c
achedCollapsedBorder(this, CBSAfter) : section()->cachedCollapsedBorder(this, CB
SBefore); |
| 874 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollaps
edBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd); | 874 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollaps
edBorder(this, CBSStart) : section()->cachedCollapsedBorder(this, CBSEnd); |
| 875 } | 875 } |
| 876 | 876 |
| 877 inline CollapsedBorderValue RenderTableCell::cachedCollapsedBottomBorder(const R
enderStyle* styleForCellFlow) const | 877 inline CollapsedBorderValue RenderTableCell::cachedCollapsedBottomBorder(const R
enderStyle* styleForCellFlow) const |
| 878 { | 878 { |
| 879 if (styleForCellFlow->isHorizontalWritingMode()) | 879 if (styleForCellFlow->isHorizontalWritingMode()) |
| 880 return styleForCellFlow->isFlippedBlocksWritingMode() ? section()->cache
dCollapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, CBSAf
ter); | 880 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? section()->c
achedCollapsedBorder(this, CBSBefore) : section()->cachedCollapsedBorder(this, C
BSAfter); |
| 881 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollaps
edBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart); | 881 return styleForCellFlow->isLeftToRightDirection() ? section()->cachedCollaps
edBorder(this, CBSEnd) : section()->cachedCollapsedBorder(this, CBSStart); |
| 882 } | 882 } |
| 883 | 883 |
| 884 int RenderTableCell::borderLeft() const | 884 int RenderTableCell::borderLeft() const |
| 885 { | 885 { |
| 886 return table()->collapseBorders() ? borderHalfLeft(false) : RenderBlockFlow:
:borderLeft(); | 886 return table()->collapseBorders() ? borderHalfLeft(false) : RenderBlockFlow:
:borderLeft(); |
| 887 } | 887 } |
| 888 | 888 |
| 889 int RenderTableCell::borderRight() const | 889 int RenderTableCell::borderRight() const |
| 890 { | 890 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 921 int RenderTableCell::borderAfter() const | 921 int RenderTableCell::borderAfter() const |
| 922 { | 922 { |
| 923 return table()->collapseBorders() ? borderHalfAfter(false) : RenderBlockFlow
::borderAfter(); | 923 return table()->collapseBorders() ? borderHalfAfter(false) : RenderBlockFlow
::borderAfter(); |
| 924 } | 924 } |
| 925 | 925 |
| 926 int RenderTableCell::borderHalfLeft(bool outer) const | 926 int RenderTableCell::borderHalfLeft(bool outer) const |
| 927 { | 927 { |
| 928 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); | 928 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); |
| 929 if (styleForCellFlow->isHorizontalWritingMode()) | 929 if (styleForCellFlow->isHorizontalWritingMode()) |
| 930 return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(oute
r) : borderHalfEnd(outer); | 930 return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(oute
r) : borderHalfEnd(outer); |
| 931 return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(oute
r) : borderHalfBefore(outer); | 931 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? borderHalfAfter(
outer) : borderHalfBefore(outer); |
| 932 } | 932 } |
| 933 | 933 |
| 934 int RenderTableCell::borderHalfRight(bool outer) const | 934 int RenderTableCell::borderHalfRight(bool outer) const |
| 935 { | 935 { |
| 936 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); | 936 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); |
| 937 if (styleForCellFlow->isHorizontalWritingMode()) | 937 if (styleForCellFlow->isHorizontalWritingMode()) |
| 938 return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer)
: borderHalfStart(outer); | 938 return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer)
: borderHalfStart(outer); |
| 939 return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore(out
er) : borderHalfAfter(outer); | 939 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? borderHalfBefore
(outer) : borderHalfAfter(outer); |
| 940 } | 940 } |
| 941 | 941 |
| 942 int RenderTableCell::borderHalfTop(bool outer) const | 942 int RenderTableCell::borderHalfTop(bool outer) const |
| 943 { | 943 { |
| 944 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); | 944 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); |
| 945 if (styleForCellFlow->isHorizontalWritingMode()) | 945 if (styleForCellFlow->isHorizontalWritingMode()) |
| 946 return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(
outer) : borderHalfBefore(outer); | 946 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? borderHalfAf
ter(outer) : borderHalfBefore(outer); |
| 947 return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) :
borderHalfEnd(outer); | 947 return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) :
borderHalfEnd(outer); |
| 948 } | 948 } |
| 949 | 949 |
| 950 int RenderTableCell::borderHalfBottom(bool outer) const | 950 int RenderTableCell::borderHalfBottom(bool outer) const |
| 951 { | 951 { |
| 952 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); | 952 const RenderStyle* styleForCellFlow = this->styleForCellFlow(); |
| 953 if (styleForCellFlow->isHorizontalWritingMode()) | 953 if (styleForCellFlow->isHorizontalWritingMode()) |
| 954 return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore
(outer) : borderHalfAfter(outer); | 954 return styleForCellFlow->slowIsFlippedBlocksWritingMode() ? borderHalfBe
fore(outer) : borderHalfAfter(outer); |
| 955 return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : b
orderHalfStart(outer); | 955 return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : b
orderHalfStart(outer); |
| 956 } | 956 } |
| 957 | 957 |
| 958 int RenderTableCell::borderHalfStart(bool outer) const | 958 int RenderTableCell::borderHalfStart(bool outer) const |
| 959 { | 959 { |
| 960 CollapsedBorderValue border = collapsedStartBorder(DoNotIncludeBorderColor); | 960 CollapsedBorderValue border = collapsedStartBorder(DoNotIncludeBorderColor); |
| 961 if (border.exists()) | 961 if (border.exists()) |
| 962 return (border.width() + ((styleForCellFlow()->isLeftToRightDirection()
^ outer) ? 1 : 0)) / 2; // Give the extra pixel to top and left. | 962 return (border.width() + ((styleForCellFlow()->isLeftToRightDirection()
^ outer) ? 1 : 0)) / 2; // Give the extra pixel to top and left. |
| 963 return 0; | 963 return 0; |
| 964 } | 964 } |
| 965 | 965 |
| 966 int RenderTableCell::borderHalfEnd(bool outer) const | 966 int RenderTableCell::borderHalfEnd(bool outer) const |
| 967 { | 967 { |
| 968 CollapsedBorderValue border = collapsedEndBorder(DoNotIncludeBorderColor); | 968 CollapsedBorderValue border = collapsedEndBorder(DoNotIncludeBorderColor); |
| 969 if (border.exists()) | 969 if (border.exists()) |
| 970 return (border.width() + ((styleForCellFlow()->isLeftToRightDirection()
^ outer) ? 0 : 1)) / 2; | 970 return (border.width() + ((styleForCellFlow()->isLeftToRightDirection()
^ outer) ? 0 : 1)) / 2; |
| 971 return 0; | 971 return 0; |
| 972 } | 972 } |
| 973 | 973 |
| 974 int RenderTableCell::borderHalfBefore(bool outer) const | 974 int RenderTableCell::borderHalfBefore(bool outer) const |
| 975 { | 975 { |
| 976 CollapsedBorderValue border = collapsedBeforeBorder(DoNotIncludeBorderColor)
; | 976 CollapsedBorderValue border = collapsedBeforeBorder(DoNotIncludeBorderColor)
; |
| 977 if (border.exists()) | 977 if (border.exists()) |
| 978 return (border.width() + ((styleForCellFlow()->isFlippedBlocksWritingMod
e() ^ outer) ? 0 : 1)) / 2; // Give the extra pixel to top and left. | 978 return (border.width() + ((styleForCellFlow()->slowIsFlippedBlocksWritin
gMode() ^ outer) ? 0 : 1)) / 2; // Give the extra pixel to top and left. |
| 979 return 0; | 979 return 0; |
| 980 } | 980 } |
| 981 | 981 |
| 982 int RenderTableCell::borderHalfAfter(bool outer) const | 982 int RenderTableCell::borderHalfAfter(bool outer) const |
| 983 { | 983 { |
| 984 CollapsedBorderValue border = collapsedAfterBorder(DoNotIncludeBorderColor); | 984 CollapsedBorderValue border = collapsedAfterBorder(DoNotIncludeBorderColor); |
| 985 if (border.exists()) | 985 if (border.exists()) |
| 986 return (border.width() + ((styleForCellFlow()->isFlippedBlocksWritingMod
e() ^ outer) ? 1 : 0)) / 2; | 986 return (border.width() + ((styleForCellFlow()->slowIsFlippedBlocksWritin
gMode() ^ outer) ? 1 : 0)) / 2; |
| 987 return 0; | 987 return 0; |
| 988 } | 988 } |
| 989 | 989 |
| 990 void RenderTableCell::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset
) | 990 void RenderTableCell::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset
) |
| 991 { | 991 { |
| 992 ASSERT(paintInfo.phase != PaintPhaseCollapsedTableBorders); | 992 ASSERT(paintInfo.phase != PaintPhaseCollapsedTableBorders); |
| 993 RenderBlock::paint(paintInfo, paintOffset); | 993 RenderBlock::paint(paintInfo, paintOffset); |
| 994 } | 994 } |
| 995 | 995 |
| 996 static EBorderStyle collapsedBorderStyle(EBorderStyle style) | 996 static EBorderStyle collapsedBorderStyle(EBorderStyle style) |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1259 | 1259 |
| 1260 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1260 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
| 1261 { | 1261 { |
| 1262 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); | 1262 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); |
| 1263 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1263 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
| 1264 newCell->setStyle(newStyle.release()); | 1264 newCell->setStyle(newStyle.release()); |
| 1265 return newCell; | 1265 return newCell; |
| 1266 } | 1266 } |
| 1267 | 1267 |
| 1268 } // namespace blink | 1268 } // namespace blink |
| OLD | NEW |