| 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 Element*) const | 461 int LayoutBox::pixelSnappedOffsetWidth() 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 Element*) const | 466 int LayoutBox::pixelSnappedOffsetHeight() 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 4001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4478 | 4478 |
| 4479 LayoutRect LayoutBox::visualOverflowRect() const | 4479 LayoutRect LayoutBox::visualOverflowRect() const |
| 4480 { | 4480 { |
| 4481 if (!m_overflow) | 4481 if (!m_overflow) |
| 4482 return borderBoxRect(); | 4482 return borderBoxRect(); |
| 4483 if (hasOverflowClip()) | 4483 if (hasOverflowClip()) |
| 4484 return m_overflow->selfVisualOverflowRect(); | 4484 return m_overflow->selfVisualOverflowRect(); |
| 4485 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); | 4485 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); |
| 4486 } | 4486 } |
| 4487 | 4487 |
| 4488 LayoutUnit LayoutBox::offsetLeft(const Element* parent) const | 4488 LayoutUnit LayoutBox::offsetLeft() const |
| 4489 { | 4489 { |
| 4490 return adjustedPositionRelativeTo(topLeftLocation(), parent).x(); | 4490 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x(); |
| 4491 } | 4491 } |
| 4492 | 4492 |
| 4493 LayoutUnit LayoutBox::offsetTop(const Element* parent) const | 4493 LayoutUnit LayoutBox::offsetTop() const |
| 4494 { | 4494 { |
| 4495 return adjustedPositionRelativeTo(topLeftLocation(), parent).y(); | 4495 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y(); |
| 4496 } | 4496 } |
| 4497 | 4497 |
| 4498 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const | 4498 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const |
| 4499 { | 4499 { |
| 4500 if (!style()->isFlippedBlocksWritingMode()) | 4500 if (!style()->isFlippedBlocksWritingMode()) |
| 4501 return point; | 4501 return point; |
| 4502 | 4502 |
| 4503 // The child is going to add in its x(), so we have to make sure it ends up
in | 4503 // The child is going to add in its x(), so we have to make sure it ends up
in |
| 4504 // the right place. | 4504 // the right place. |
| 4505 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 *
child->location().x()), point.y()); | 4505 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... |
| 4965 m_rareData->m_snapAreas->remove(&snapArea); | 4965 m_rareData->m_snapAreas->remove(&snapArea); |
| 4966 } | 4966 } |
| 4967 } | 4967 } |
| 4968 | 4968 |
| 4969 SnapAreaSet* LayoutBox::snapAreas() const | 4969 SnapAreaSet* LayoutBox::snapAreas() const |
| 4970 { | 4970 { |
| 4971 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4971 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
| 4972 } | 4972 } |
| 4973 | 4973 |
| 4974 } // namespace blink | 4974 } // namespace blink |
| OLD | NEW |