OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 int LayoutBox::pixelSnappedClientWidth() const | 450 int LayoutBox::pixelSnappedClientWidth() const |
451 { | 451 { |
452 return snapSizeToPixel(clientWidth(), location().x() + clientLeft()); | 452 return snapSizeToPixel(clientWidth(), location().x() + clientLeft()); |
453 } | 453 } |
454 | 454 |
455 int LayoutBox::pixelSnappedClientHeight() const | 455 int LayoutBox::pixelSnappedClientHeight() const |
456 { | 456 { |
457 return snapSizeToPixel(clientHeight(), location().y() + clientTop()); | 457 return snapSizeToPixel(clientHeight(), location().y() + clientTop()); |
458 } | 458 } |
459 | 459 |
460 int LayoutBox::pixelSnappedOffsetWidth() const | 460 int LayoutBox::pixelSnappedOffsetWidth(const Element*) const |
461 { | 461 { |
462 return snapSizeToPixel(offsetWidth(), location().x() + clientLeft()); | 462 return snapSizeToPixel(offsetWidth(), location().x() + clientLeft()); |
463 } | 463 } |
464 | 464 |
465 int LayoutBox::pixelSnappedOffsetHeight() const | 465 int LayoutBox::pixelSnappedOffsetHeight(const Element*) const |
466 { | 466 { |
467 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); | 467 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); |
468 } | 468 } |
469 | 469 |
470 LayoutUnit LayoutBox::scrollWidth() const | 470 LayoutUnit LayoutBox::scrollWidth() const |
471 { | 471 { |
472 if (hasOverflowClip()) | 472 if (hasOverflowClip()) |
473 return getScrollableArea()->scrollWidth(); | 473 return getScrollableArea()->scrollWidth(); |
474 // For objects with visible overflow, this matches IE. | 474 // For objects with visible overflow, this matches IE. |
475 // FIXME: Need to work right with writing modes. | 475 // FIXME: Need to work right with writing modes. |
(...skipping 3953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4429 | 4429 |
4430 LayoutRect LayoutBox::visualOverflowRect() const | 4430 LayoutRect LayoutBox::visualOverflowRect() const |
4431 { | 4431 { |
4432 if (!m_overflow) | 4432 if (!m_overflow) |
4433 return borderBoxRect(); | 4433 return borderBoxRect(); |
4434 if (hasOverflowClip()) | 4434 if (hasOverflowClip()) |
4435 return m_overflow->selfVisualOverflowRect(); | 4435 return m_overflow->selfVisualOverflowRect(); |
4436 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); | 4436 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); |
4437 } | 4437 } |
4438 | 4438 |
4439 LayoutUnit LayoutBox::offsetLeft() const | 4439 LayoutUnit LayoutBox::offsetLeft(const Element* parent) const |
4440 { | 4440 { |
4441 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x(); | 4441 return adjustedPositionRelativeTo(topLeftLocation(), parent).x(); |
4442 } | 4442 } |
4443 | 4443 |
4444 LayoutUnit LayoutBox::offsetTop() const | 4444 LayoutUnit LayoutBox::offsetTop(const Element* parent) const |
4445 { | 4445 { |
4446 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y(); | 4446 return adjustedPositionRelativeTo(topLeftLocation(), parent).y(); |
4447 } | 4447 } |
4448 | 4448 |
4449 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const | 4449 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const |
4450 { | 4450 { |
4451 if (!style()->isFlippedBlocksWritingMode()) | 4451 if (!style()->isFlippedBlocksWritingMode()) |
4452 return point; | 4452 return point; |
4453 | 4453 |
4454 // The child is going to add in its x(), so we have to make sure it ends up
in | 4454 // The child is going to add in its x(), so we have to make sure it ends up
in |
4455 // the right place. | 4455 // the right place. |
4456 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 *
child->location().x()), point.y()); | 4456 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 *
child->location().x()), point.y()); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4877 m_rareData->m_snapAreas->remove(&snapArea); | 4877 m_rareData->m_snapAreas->remove(&snapArea); |
4878 } | 4878 } |
4879 } | 4879 } |
4880 | 4880 |
4881 SnapAreaSet* LayoutBox::snapAreas() const | 4881 SnapAreaSet* LayoutBox::snapAreas() const |
4882 { | 4882 { |
4883 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4883 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
4884 } | 4884 } |
4885 | 4885 |
4886 } // namespace blink | 4886 } // namespace blink |
OLD | NEW |