OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #include "config.h" | 20 #include "config.h" |
21 #include "core/rendering/InlineBox.h" | 21 #include "core/rendering/InlineBox.h" |
22 | 22 |
| 23 #include "core/paint/BlockPainter.h" |
23 #include "core/rendering/InlineFlowBox.h" | 24 #include "core/rendering/InlineFlowBox.h" |
24 #include "core/rendering/PaintInfo.h" | 25 #include "core/rendering/PaintInfo.h" |
25 #include "core/rendering/RenderBlockFlow.h" | 26 #include "core/rendering/RenderBlockFlow.h" |
26 #include "core/rendering/RenderObjectInlines.h" | 27 #include "core/rendering/RenderObjectInlines.h" |
27 #include "core/rendering/RootInlineBox.h" | 28 #include "core/rendering/RootInlineBox.h" |
28 #include "platform/Partitions.h" | 29 #include "platform/Partitions.h" |
29 #include "platform/fonts/FontMetrics.h" | 30 #include "platform/fonts/FontMetrics.h" |
30 | 31 |
31 #ifndef NDEBUG | 32 #ifndef NDEBUG |
32 #include <stdio.h> | 33 #include <stdio.h> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 194 |
194 void InlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Layo
utUnit /* lineTop */, LayoutUnit /*lineBottom*/) | 195 void InlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Layo
utUnit /* lineTop */, LayoutUnit /*lineBottom*/) |
195 { | 196 { |
196 if (!paintInfo.shouldPaintWithinRoot(&renderer()) || (paintInfo.phase != Pai
ntPhaseForeground && paintInfo.phase != PaintPhaseSelection)) | 197 if (!paintInfo.shouldPaintWithinRoot(&renderer()) || (paintInfo.phase != Pai
ntPhaseForeground && paintInfo.phase != PaintPhaseSelection)) |
197 return; | 198 return; |
198 | 199 |
199 LayoutPoint childPoint = paintOffset; | 200 LayoutPoint childPoint = paintOffset; |
200 if (parent()->renderer().style()->isFlippedBlocksWritingMode()) // Faster th
an calling containingBlock(). | 201 if (parent()->renderer().style()->isFlippedBlocksWritingMode()) // Faster th
an calling containingBlock(). |
201 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t
oRenderBox(renderer()), childPoint); | 202 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t
oRenderBox(renderer()), childPoint); |
202 | 203 |
203 RenderBlock::paintAsInlineBlock(&renderer(), paintInfo, childPoint); | 204 BlockPainter::paintAsInlineBlock(&renderer(), paintInfo, childPoint); |
204 } | 205 } |
205 | 206 |
206 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) | 207 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) |
207 { | 208 { |
208 // Hit test all phases of replaced elements atomically, as though the replac
ed element established its | 209 // Hit test all phases of replaced elements atomically, as though the replac
ed element established its |
209 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab
le elements in the CSS2.1 | 210 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab
le elements in the CSS2.1 |
210 // specification.) | 211 // specification.) |
211 LayoutPoint childPoint = accumulatedOffset; | 212 LayoutPoint childPoint = accumulatedOffset; |
212 if (parent()->renderer().style()->isFlippedBlocksWritingMode()) // Faster th
an calling containingBlock(). | 213 if (parent()->renderer().style()->isFlippedBlocksWritingMode()) // Faster th
an calling containingBlock(). |
213 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t
oRenderBox(renderer()), childPoint); | 214 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t
oRenderBox(renderer()), childPoint); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 b->showTreeForThis(); | 362 b->showTreeForThis(); |
362 } | 363 } |
363 | 364 |
364 void showLineTree(const blink::InlineBox* b) | 365 void showLineTree(const blink::InlineBox* b) |
365 { | 366 { |
366 if (b) | 367 if (b) |
367 b->showLineTreeForThis(); | 368 b->showLineTreeForThis(); |
368 } | 369 } |
369 | 370 |
370 #endif | 371 #endif |
OLD | NEW |