| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2008 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 { | 160 { |
| 161 if (hasEllipsisBox() && visibleToHitTestRequest(result.hitTestRequest())) { | 161 if (hasEllipsisBox() && visibleToHitTestRequest(result.hitTestRequest())) { |
| 162 if (ellipsisBox()->nodeAtPoint(result, locationInContainer, accumulatedO
ffset, lineTop, lineBottom)) { | 162 if (ellipsisBox()->nodeAtPoint(result, locationInContainer, accumulatedO
ffset, lineTop, lineBottom)) { |
| 163 layoutObject().updateHitTestResult(result, locationInContainer.point
() - toLayoutSize(accumulatedOffset)); | 163 layoutObject().updateHitTestResult(result, locationInContainer.point
() - toLayoutSize(accumulatedOffset)); |
| 164 return true; | 164 return true; |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 return InlineFlowBox::nodeAtPoint(result, locationInContainer, accumulatedOf
fset, lineTop, lineBottom); | 167 return InlineFlowBox::nodeAtPoint(result, locationInContainer, accumulatedOf
fset, lineTop, lineBottom); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void RootInlineBox::adjustPosition(LayoutUnit dx, LayoutUnit dy) | 170 void RootInlineBox::move(const LayoutSize& delta) |
| 171 { | 171 { |
| 172 InlineFlowBox::adjustPosition(dx, dy); | 172 InlineFlowBox::move(delta); |
| 173 LayoutUnit blockDirectionDelta = isHorizontal() ? dy : dx; // The block dire
ction delta is a LayoutUnit. | 173 LayoutUnit blockDirectionDelta = isHorizontal() ? delta.height() : delta.wid
th(); |
| 174 m_lineTop += blockDirectionDelta; | 174 m_lineTop += blockDirectionDelta; |
| 175 m_lineBottom += blockDirectionDelta; | 175 m_lineBottom += blockDirectionDelta; |
| 176 m_lineTopWithLeading += blockDirectionDelta; | 176 m_lineTopWithLeading += blockDirectionDelta; |
| 177 m_lineBottomWithLeading += blockDirectionDelta; | 177 m_lineBottomWithLeading += blockDirectionDelta; |
| 178 m_selectionBottom += blockDirectionDelta; | 178 m_selectionBottom += blockDirectionDelta; |
| 179 if (hasEllipsisBox()) | 179 if (hasEllipsisBox()) |
| 180 ellipsisBox()->adjustPosition(dx, dy); | 180 ellipsisBox()->move(delta); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void RootInlineBox::childRemoved(InlineBox* box) | 183 void RootInlineBox::childRemoved(InlineBox* box) |
| 184 { | 184 { |
| 185 if (&box->layoutObject() == m_lineBreakObj) | 185 if (&box->layoutObject() == m_lineBreakObj) |
| 186 setLineBreakInfo(0, 0, BidiStatus()); | 186 setLineBreakInfo(0, 0, BidiStatus()); |
| 187 | 187 |
| 188 for (RootInlineBox* prev = prevRootBox(); prev && prev->lineBreakObj() == &b
ox->layoutObject(); prev = prev->prevRootBox()) { | 188 for (RootInlineBox* prev = prevRootBox(); prev && prev->lineBreakObj() == &b
ox->layoutObject(); prev = prev->prevRootBox()) { |
| 189 prev->setLineBreakInfo(0, 0, BidiStatus()); | 189 prev->setLineBreakInfo(0, 0, BidiStatus()); |
| 190 prev->markDirty(); | 190 prev->markDirty(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 m_hasAnnotationsAfter = hasAnnotationsAfter; | 228 m_hasAnnotationsAfter = hasAnnotationsAfter; |
| 229 | 229 |
| 230 maxHeight = std::max<LayoutUnit>(0, maxHeight); // FIXME: Is this really nec
essary? | 230 maxHeight = std::max<LayoutUnit>(0, maxHeight); // FIXME: Is this really nec
essary? |
| 231 | 231 |
| 232 setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock
+ maxHeight, selectionBottom); | 232 setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock
+ maxHeight, selectionBottom); |
| 233 | 233 |
| 234 LayoutUnit annotationsAdjustment = beforeAnnotationsAdjustment(); | 234 LayoutUnit annotationsAdjustment = beforeAnnotationsAdjustment(); |
| 235 if (annotationsAdjustment) { | 235 if (annotationsAdjustment) { |
| 236 // FIXME: Need to handle pagination here. We might have to move to the n
ext page/column as a result of the | 236 // FIXME: Need to handle pagination here. We might have to move to the n
ext page/column as a result of the |
| 237 // ruby expansion. | 237 // ruby expansion. |
| 238 adjustBlockDirectionPosition(annotationsAdjustment.toFloat()); | 238 moveInBlockDirection(annotationsAdjustment.toFloat()); |
| 239 heightOfBlock += annotationsAdjustment; | 239 heightOfBlock += annotationsAdjustment; |
| 240 } | 240 } |
| 241 | 241 |
| 242 return heightOfBlock + maxHeight; | 242 return heightOfBlock + maxHeight; |
| 243 } | 243 } |
| 244 | 244 |
| 245 LayoutUnit RootInlineBox::maxLogicalTop() const | 245 LayoutUnit RootInlineBox::maxLogicalTop() const |
| 246 { | 246 { |
| 247 LayoutUnit maxLogicalTop; | 247 LayoutUnit maxLogicalTop; |
| 248 computeMaxLogicalTop(maxLogicalTop); | 248 computeMaxLogicalTop(maxLogicalTop); |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 endBox = nullptr; | 848 endBox = nullptr; |
| 849 return nullptr; | 849 return nullptr; |
| 850 } | 850 } |
| 851 | 851 |
| 852 const char* RootInlineBox::boxName() const | 852 const char* RootInlineBox::boxName() const |
| 853 { | 853 { |
| 854 return "RootInlineBox"; | 854 return "RootInlineBox"; |
| 855 } | 855 } |
| 856 | 856 |
| 857 } // namespace blink | 857 } // namespace blink |
| OLD | NEW |