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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 int LayoutBox::pixelSnappedClientWidth() const | 451 int LayoutBox::pixelSnappedClientWidth() const |
452 { | 452 { |
453 return snapSizeToPixel(clientWidth(), location().x() + clientLeft()); | 453 return snapSizeToPixel(clientWidth(), location().x() + clientLeft()); |
454 } | 454 } |
455 | 455 |
456 int LayoutBox::pixelSnappedClientHeight() const | 456 int LayoutBox::pixelSnappedClientHeight() const |
457 { | 457 { |
458 return snapSizeToPixel(clientHeight(), location().y() + clientTop()); | 458 return snapSizeToPixel(clientHeight(), location().y() + clientTop()); |
459 } | 459 } |
460 | 460 |
461 int LayoutBox::pixelSnappedOffsetWidth() const | 461 int LayoutBox::pixelSnappedOffsetWidth(const Element*) const |
462 { | 462 { |
463 return snapSizeToPixel(offsetWidth(), location().x() + clientLeft()); | 463 return snapSizeToPixel(offsetWidth(), location().x() + clientLeft()); |
464 } | 464 } |
465 | 465 |
466 int LayoutBox::pixelSnappedOffsetHeight() const | 466 int LayoutBox::pixelSnappedOffsetHeight(const Element*) const |
467 { | 467 { |
468 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); | 468 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); |
469 } | 469 } |
470 | 470 |
471 LayoutUnit LayoutBox::scrollWidth() const | 471 LayoutUnit LayoutBox::scrollWidth() const |
472 { | 472 { |
473 if (hasOverflowClip()) | 473 if (hasOverflowClip()) |
474 return getScrollableArea()->scrollWidth(); | 474 return getScrollableArea()->scrollWidth(); |
475 // For objects with visible overflow, this matches IE. | 475 // For objects with visible overflow, this matches IE. |
476 // FIXME: Need to work right with writing modes. | 476 // FIXME: Need to work right with writing modes. |
(...skipping 3974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4451 | 4451 |
4452 LayoutRect LayoutBox::visualOverflowRect() const | 4452 LayoutRect LayoutBox::visualOverflowRect() const |
4453 { | 4453 { |
4454 if (!m_overflow) | 4454 if (!m_overflow) |
4455 return borderBoxRect(); | 4455 return borderBoxRect(); |
4456 if (hasOverflowClip()) | 4456 if (hasOverflowClip()) |
4457 return m_overflow->selfVisualOverflowRect(); | 4457 return m_overflow->selfVisualOverflowRect(); |
4458 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); | 4458 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); |
4459 } | 4459 } |
4460 | 4460 |
4461 LayoutUnit LayoutBox::offsetLeft() const | 4461 LayoutUnit LayoutBox::offsetLeft(const Element* parent) const |
4462 { | 4462 { |
4463 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x(); | 4463 return adjustedPositionRelativeTo(topLeftLocation(), parent).x(); |
4464 } | 4464 } |
4465 | 4465 |
4466 LayoutUnit LayoutBox::offsetTop() const | 4466 LayoutUnit LayoutBox::offsetTop(const Element* parent) const |
4467 { | 4467 { |
4468 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y(); | 4468 return adjustedPositionRelativeTo(topLeftLocation(), parent).y(); |
4469 } | 4469 } |
4470 | 4470 |
4471 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const | 4471 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const |
4472 { | 4472 { |
4473 if (!style()->isFlippedBlocksWritingMode()) | 4473 if (!style()->isFlippedBlocksWritingMode()) |
4474 return point; | 4474 return point; |
4475 | 4475 |
4476 // The child is going to add in its x(), so we have to make sure it ends up
in | 4476 // The child is going to add in its x(), so we have to make sure it ends up
in |
4477 // the right place. | 4477 // the right place. |
4478 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 *
child->location().x()), point.y()); | 4478 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 *
child->location().x()), point.y()); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4938 m_rareData->m_snapAreas->remove(&snapArea); | 4938 m_rareData->m_snapAreas->remove(&snapArea); |
4939 } | 4939 } |
4940 } | 4940 } |
4941 | 4941 |
4942 SnapAreaSet* LayoutBox::snapAreas() const | 4942 SnapAreaSet* LayoutBox::snapAreas() const |
4943 { | 4943 { |
4944 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4944 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
4945 } | 4945 } |
4946 | 4946 |
4947 } // namespace blink | 4947 } // namespace blink |
OLD | NEW |