OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 ASSERT(!m_overflow); | 890 ASSERT(!m_overflow); |
891 return; | 891 return; |
892 } | 892 } |
893 | 893 |
894 if (m_overflow) | 894 if (m_overflow) |
895 m_overflow.clear(); | 895 m_overflow.clear(); |
896 | 896 |
897 // Visual overflow just includes overflow for stuff we need to issues paint
invalidations for ourselves. Self-painting layers are ignored. | 897 // Visual overflow just includes overflow for stuff we need to issues paint
invalidations for ourselves. Self-painting layers are ignored. |
898 // Layout overflow is used to determine scrolling extent, so it still includ
es child layers and also factors in | 898 // Layout overflow is used to determine scrolling extent, so it still includ
es child layers and also factors in |
899 // transforms, relative positioning, etc. | 899 // transforms, relative positioning, etc. |
900 // FIXME: the call to enclosingLayoutRect() below is temporary and should be
removed once | 900 LayoutRect logicalLayoutOverflow(logicalFrameRectIncludingLineHeight(lineTop
, lineBottom)); |
901 // the transition to LayoutUnit-based types is complete (crbug.com/321237) | |
902 LayoutRect logicalLayoutOverflow(enclosingLayoutRect(logicalFrameRectIncludi
ngLineHeight(lineTop, lineBottom))); | |
903 LayoutRect logicalVisualOverflow(logicalLayoutOverflow); | 901 LayoutRect logicalVisualOverflow(logicalLayoutOverflow); |
904 | 902 |
905 addBoxShadowVisualOverflow(logicalVisualOverflow); | 903 addBoxShadowVisualOverflow(logicalVisualOverflow); |
906 addBorderOutsetVisualOverflow(logicalVisualOverflow); | 904 addBorderOutsetVisualOverflow(logicalVisualOverflow); |
907 addOutlineVisualOverflow(logicalVisualOverflow); | 905 addOutlineVisualOverflow(logicalVisualOverflow); |
908 | 906 |
909 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { | 907 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
910 if (curr->layoutObject().isOutOfFlowPositioned()) | 908 if (curr->layoutObject().isOutOfFlowPositioned()) |
911 continue; // Positioned placeholders don't affect calculations. | 909 continue; // Positioned placeholders don't affect calculations. |
912 | 910 |
913 if (curr->layoutObject().isText()) { | 911 if (curr->layoutObject().isText()) { |
914 InlineTextBox* text = toInlineTextBox(curr); | 912 InlineTextBox* text = toInlineTextBox(curr); |
915 LayoutText& rt = text->layoutObject(); | 913 LayoutText& rt = text->layoutObject(); |
916 if (rt.isBR()) | 914 if (rt.isBR()) |
917 continue; | 915 continue; |
918 // FIXME: the call to enclosingLayoutRect() below is temporary and s
hould be removed once | 916 LayoutRect textBoxOverflow(text->logicalFrameRect()); |
919 // the transition to LayoutUnit-based types is complete (crbug.com/3
21237) | |
920 LayoutRect textBoxOverflow(enclosingLayoutRect(text->logicalFrameRec
t())); | |
921 addTextBoxVisualOverflow(text, textBoxDataMap, textBoxOverflow); | 917 addTextBoxVisualOverflow(text, textBoxDataMap, textBoxOverflow); |
922 logicalVisualOverflow.unite(textBoxOverflow); | 918 logicalVisualOverflow.unite(textBoxOverflow); |
923 } else if (curr->layoutObject().isLayoutInline()) { | 919 } else if (curr->layoutObject().isLayoutInline()) { |
924 InlineFlowBox* flow = toInlineFlowBox(curr); | 920 InlineFlowBox* flow = toInlineFlowBox(curr); |
925 flow->computeOverflow(lineTop, lineBottom, textBoxDataMap); | 921 flow->computeOverflow(lineTop, lineBottom, textBoxDataMap); |
926 if (!flow->boxModelObject()->hasSelfPaintingLayer()) | 922 if (!flow->boxModelObject()->hasSelfPaintingLayer()) |
927 logicalVisualOverflow.unite(flow->logicalVisualOverflowRect(line
Top, lineBottom)); | 923 logicalVisualOverflow.unite(flow->logicalVisualOverflowRect(line
Top, lineBottom)); |
928 LayoutRect childLayoutOverflow = flow->logicalLayoutOverflowRect(lin
eTop, lineBottom); | 924 LayoutRect childLayoutOverflow = flow->logicalLayoutOverflowRect(lin
eTop, lineBottom); |
929 childLayoutOverflow.move(flow->boxModelObject()->relativePositionLog
icalOffset()); | 925 childLayoutOverflow.move(flow->boxModelObject()->relativePositionLog
icalOffset()); |
930 logicalLayoutOverflow.unite(childLayoutOverflow); | 926 logicalLayoutOverflow.unite(childLayoutOverflow); |
(...skipping 22 matching lines...) Expand all Loading... |
953 return; | 949 return; |
954 | 950 |
955 if (!m_overflow) | 951 if (!m_overflow) |
956 m_overflow = adoptPtr(new OverflowModel(frameBox, frameBox)); | 952 m_overflow = adoptPtr(new OverflowModel(frameBox, frameBox)); |
957 | 953 |
958 m_overflow->setVisualOverflow(rect); | 954 m_overflow->setVisualOverflow(rect); |
959 } | 955 } |
960 | 956 |
961 void InlineFlowBox::setOverflowFromLogicalRects(const LayoutRect& logicalLayoutO
verflow, const LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit
lineBottom) | 957 void InlineFlowBox::setOverflowFromLogicalRects(const LayoutRect& logicalLayoutO
verflow, const LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit
lineBottom) |
962 { | 958 { |
963 // FIXME: the call to enclosingLayoutRect() below is temporary and should be
removed once | 959 LayoutRect frameBox = frameRectIncludingLineHeight(lineTop, lineBottom); |
964 // the transition to LayoutUnit-based types is complete (crbug.com/321237) | |
965 LayoutRect frameBox = enclosingLayoutRect(frameRectIncludingLineHeight(lineT
op, lineBottom)); | |
966 | 960 |
967 LayoutRect layoutOverflow(isHorizontal() ? logicalLayoutOverflow : logicalLa
youtOverflow.transposedRect()); | 961 LayoutRect layoutOverflow(isHorizontal() ? logicalLayoutOverflow : logicalLa
youtOverflow.transposedRect()); |
968 setLayoutOverflow(layoutOverflow, frameBox); | 962 setLayoutOverflow(layoutOverflow, frameBox); |
969 | 963 |
970 LayoutRect visualOverflow(isHorizontal() ? logicalVisualOverflow : logicalVi
sualOverflow.transposedRect()); | 964 LayoutRect visualOverflow(isHorizontal() ? logicalVisualOverflow : logicalVi
sualOverflow.transposedRect()); |
971 setVisualOverflow(visualOverflow, frameBox); | 965 setVisualOverflow(visualOverflow, frameBox); |
972 } | 966 } |
973 | 967 |
974 bool InlineFlowBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& lo
cationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Lay
outUnit lineBottom) | 968 bool InlineFlowBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& lo
cationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, Lay
outUnit lineBottom) |
975 { | 969 { |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 ASSERT(child->prevOnLine() == prev); | 1305 ASSERT(child->prevOnLine() == prev); |
1312 prev = child; | 1306 prev = child; |
1313 } | 1307 } |
1314 ASSERT(prev == m_lastChild); | 1308 ASSERT(prev == m_lastChild); |
1315 #endif | 1309 #endif |
1316 } | 1310 } |
1317 | 1311 |
1318 #endif | 1312 #endif |
1319 | 1313 |
1320 } // namespace blink | 1314 } // namespace blink |
OLD | NEW |