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 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 LayoutUnit /* lineTop */, | 225 LayoutUnit /* lineTop */, |
226 LayoutUnit /* lineBottom */) const { | 226 LayoutUnit /* lineBottom */) const { |
227 BlockPainter::paintInlineBox(*this, paintInfo, paintOffset); | 227 BlockPainter::paintInlineBox(*this, paintInfo, paintOffset); |
228 } | 228 } |
229 | 229 |
230 bool InlineBox::nodeAtPoint(HitTestResult& result, | 230 bool InlineBox::nodeAtPoint(HitTestResult& result, |
231 const HitTestLocation& locationInContainer, | 231 const HitTestLocation& locationInContainer, |
232 const LayoutPoint& accumulatedOffset, | 232 const LayoutPoint& accumulatedOffset, |
233 LayoutUnit /* lineTop */, | 233 LayoutUnit /* lineTop */, |
234 LayoutUnit /* lineBottom */) { | 234 LayoutUnit /* lineBottom */) { |
235 // Hit test all phases of replaced elements atomically, as though the replaced
element established its | 235 // Hit test all phases of replaced elements atomically, as though the replaced |
236 // own stacking context. (See Appendix E.2, section 6.4 on inline block/table
elements in the CSS2.1 | 236 // element established its own stacking context. (See Appendix E.2, section |
237 // specification.) | 237 // 6.4 on inline block/table elements in the CSS2.1 specification.) |
238 LayoutPoint childPoint = accumulatedOffset; | 238 LayoutPoint childPoint = accumulatedOffset; |
239 if (parent() | 239 // Faster than calling containingBlock(). |
240 ->getLineLayoutItem() | 240 if (parent()->getLineLayoutItem().hasFlippedBlocksWritingMode()) |
241 .hasFlippedBlocksWritingMode()) // Faster than calling containingBloc
k(). | |
242 childPoint = | 241 childPoint = |
243 getLineLayoutItem().containingBlock().flipForWritingModeForChild( | 242 getLineLayoutItem().containingBlock().flipForWritingModeForChild( |
244 LineLayoutBox(getLineLayoutItem()), childPoint); | 243 LineLayoutBox(getLineLayoutItem()), childPoint); |
245 | 244 |
246 return getLineLayoutItem().hitTest(result, locationInContainer, childPoint); | 245 return getLineLayoutItem().hitTest(result, locationInContainer, childPoint); |
247 } | 246 } |
248 | 247 |
249 const RootInlineBox& InlineBox::root() const { | 248 const RootInlineBox& InlineBox::root() const { |
250 if (m_parent) | 249 if (m_parent) |
251 return m_parent->root(); | 250 return m_parent->root(); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 void InlineBox::setShouldDoFullPaintInvalidationRecursively() { | 393 void InlineBox::setShouldDoFullPaintInvalidationRecursively() { |
395 getLineLayoutItem().setShouldDoFullPaintInvalidation(); | 394 getLineLayoutItem().setShouldDoFullPaintInvalidation(); |
396 if (!isInlineFlowBox()) | 395 if (!isInlineFlowBox()) |
397 return; | 396 return; |
398 for (InlineBox* child = toInlineFlowBox(this)->firstChild(); child; | 397 for (InlineBox* child = toInlineFlowBox(this)->firstChild(); child; |
399 child = child->nextOnLine()) | 398 child = child->nextOnLine()) |
400 child->setShouldDoFullPaintInvalidationRecursively(); | 399 child->setShouldDoFullPaintInvalidationRecursively(); |
401 } | 400 } |
402 | 401 |
403 void InlineBox::setLineLayoutItemShouldDoFullPaintInvalidationIfNeeded() { | 402 void InlineBox::setLineLayoutItemShouldDoFullPaintInvalidationIfNeeded() { |
404 // For RootInlineBox, we only need to invalidate if it's using the first line
style. | 403 // For RootInlineBox, we only need to invalidate if it's using the first line |
405 // otherwise it paints nothing so we don't need to invalidate it. | 404 // style. Otherwise it paints nothing so we don't need to invalidate it. |
406 if (!isRootInlineBox() || isFirstLineStyle()) | 405 if (!isRootInlineBox() || isFirstLineStyle()) |
407 m_lineLayoutItem.setShouldDoFullPaintInvalidation(); | 406 m_lineLayoutItem.setShouldDoFullPaintInvalidation(); |
408 } | 407 } |
409 | 408 |
410 } // namespace blink | 409 } // namespace blink |
411 | 410 |
412 #ifndef NDEBUG | 411 #ifndef NDEBUG |
413 | 412 |
414 void showTree(const blink::InlineBox* b) { | 413 void showTree(const blink::InlineBox* b) { |
415 if (b) | 414 if (b) |
416 b->showTreeForThis(); | 415 b->showTreeForThis(); |
417 else | 416 else |
418 fprintf(stderr, "Cannot showTree for (nil) InlineBox.\n"); | 417 fprintf(stderr, "Cannot showTree for (nil) InlineBox.\n"); |
419 } | 418 } |
420 | 419 |
421 void showLineTree(const blink::InlineBox* b) { | 420 void showLineTree(const blink::InlineBox* b) { |
422 if (b) | 421 if (b) |
423 b->showLineTreeForThis(); | 422 b->showLineTreeForThis(); |
424 else | 423 else |
425 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); | 424 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); |
426 } | 425 } |
427 | 426 |
428 #endif | 427 #endif |
OLD | NEW |