OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // We're a block-level replaced element. Just return our own dimensions
. | 459 // We're a block-level replaced element. Just return our own dimensions
. |
460 return IntRect(0, 0, width(), height()); | 460 return IntRect(0, 0, width(), height()); |
461 | 461 |
462 RootInlineBox* root = m_inlineBoxWrapper->root(); | 462 RootInlineBox* root = m_inlineBoxWrapper->root(); |
463 int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m
_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTo
p() - m_inlineBoxWrapper->logicalTop(); | 463 int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m
_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTo
p() - m_inlineBoxWrapper->logicalTop(); |
464 if (root->block()->style()->isHorizontalWritingMode()) | 464 if (root->block()->style()->isHorizontalWritingMode()) |
465 return IntRect(0, newLogicalTop, width(), root->selectionHeight()); | 465 return IntRect(0, newLogicalTop, width(), root->selectionHeight()); |
466 return IntRect(newLogicalTop, 0, root->selectionHeight(), height()); | 466 return IntRect(newLogicalTop, 0, root->selectionHeight(), height()); |
467 } | 467 } |
468 | 468 |
469 void RenderReplaced::setSelectionState(SelectionState s) | 469 void RenderReplaced::setSelectionState(SelectionState state) |
470 { | 470 { |
471 RenderBox::setSelectionState(s); // The selection state for our containing b
lock hierarchy is updated by the base class call. | 471 // The selection state for our containing block hierarchy is updated by the
base class call. |
472 if (m_inlineBoxWrapper) { | 472 RenderBox::setSelectionState(state); |
473 RootInlineBox* line = m_inlineBoxWrapper->root(); | 473 |
474 if (line) | 474 if (m_inlineBoxWrapper && canUpdateSelectionOnRootLineBoxes()) |
475 line->setHasSelectedChildren(isSelected()); | 475 if (RootInlineBox* root = m_inlineBoxWrapper->root()) |
476 } | 476 root->setHasSelectedChildren(isSelected()); |
477 } | 477 } |
478 | 478 |
479 bool RenderReplaced::isSelected() const | 479 bool RenderReplaced::isSelected() const |
480 { | 480 { |
481 SelectionState s = selectionState(); | 481 SelectionState s = selectionState(); |
482 if (s == SelectionNone) | 482 if (s == SelectionNone) |
483 return false; | 483 return false; |
484 if (s == SelectionInside) | 484 if (s == SelectionInside) |
485 return true; | 485 return true; |
486 | 486 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 // The theme may wish to inflate the rect used when repainting. | 531 // The theme may wish to inflate the rect used when repainting. |
532 theme()->adjustRepaintRect(this, r); | 532 theme()->adjustRepaintRect(this, r); |
533 if (v) | 533 if (v) |
534 r.inflate(style()->outlineSize()); | 534 r.inflate(style()->outlineSize()); |
535 } | 535 } |
536 computeRectForRepaint(repaintContainer, r); | 536 computeRectForRepaint(repaintContainer, r); |
537 return r; | 537 return r; |
538 } | 538 } |
539 | 539 |
540 } | 540 } |
OLD | NEW |