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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 // We're a block-level replaced element. Just return our own dimensions
. | 493 // We're a block-level replaced element. Just return our own dimensions
. |
494 return IntRect(0, 0, width(), height()); | 494 return IntRect(0, 0, width(), height()); |
495 | 495 |
496 RootInlineBox* root = m_inlineBoxWrapper->root(); | 496 RootInlineBox* root = m_inlineBoxWrapper->root(); |
497 int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m
_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTo
p() - m_inlineBoxWrapper->logicalTop(); | 497 int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m
_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTo
p() - m_inlineBoxWrapper->logicalTop(); |
498 if (root->block()->style()->isHorizontalWritingMode()) | 498 if (root->block()->style()->isHorizontalWritingMode()) |
499 return IntRect(0, newLogicalTop, width(), root->selectionHeight()); | 499 return IntRect(0, newLogicalTop, width(), root->selectionHeight()); |
500 return IntRect(newLogicalTop, 0, root->selectionHeight(), height()); | 500 return IntRect(newLogicalTop, 0, root->selectionHeight(), height()); |
501 } | 501 } |
502 | 502 |
503 void RenderReplaced::setSelectionState(SelectionState s) | 503 void RenderReplaced::setSelectionState(SelectionState state) |
504 { | 504 { |
505 RenderBox::setSelectionState(s); // The selection state for our containing b
lock hierarchy is updated by the base class call. | 505 // The selection state for our containing block hierarchy is updated by the
base class call. |
506 if (m_inlineBoxWrapper) { | 506 RenderBox::setSelectionState(state); |
507 RootInlineBox* line = m_inlineBoxWrapper->root(); | 507 |
508 if (line) | 508 if (m_inlineBoxWrapper && canUpdateSelectionOnRootLineBoxes()) |
509 line->setHasSelectedChildren(isSelected()); | 509 if (RootInlineBox* root = m_inlineBoxWrapper->root()) |
510 } | 510 root->setHasSelectedChildren(isSelected()); |
511 } | 511 } |
512 | 512 |
513 bool RenderReplaced::isSelected() const | 513 bool RenderReplaced::isSelected() const |
514 { | 514 { |
515 SelectionState s = selectionState(); | 515 SelectionState s = selectionState(); |
516 if (s == SelectionNone) | 516 if (s == SelectionNone) |
517 return false; | 517 return false; |
518 if (s == SelectionInside) | 518 if (s == SelectionInside) |
519 return true; | 519 return true; |
520 | 520 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 | 562 |
563 if (style()) { | 563 if (style()) { |
564 if (v) | 564 if (v) |
565 r.inflate(style()->outlineSize()); | 565 r.inflate(style()->outlineSize()); |
566 } | 566 } |
567 computeRectForRepaint(repaintContainer, r); | 567 computeRectForRepaint(repaintContainer, r); |
568 return r; | 568 return r; |
569 } | 569 } |
570 | 570 |
571 } | 571 } |
OLD | NEW |