| 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 3953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4430 | 4430 |
| 4431 LayoutRect LayoutBox::visualOverflowRect() const | 4431 LayoutRect LayoutBox::visualOverflowRect() const |
| 4432 { | 4432 { |
| 4433 if (!m_overflow) | 4433 if (!m_overflow) |
| 4434 return borderBoxRect(); | 4434 return borderBoxRect(); |
| 4435 if (hasOverflowClip()) | 4435 if (hasOverflowClip()) |
| 4436 return m_overflow->selfVisualOverflowRect(); | 4436 return m_overflow->selfVisualOverflowRect(); |
| 4437 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); | 4437 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV
isualOverflowRect()); |
| 4438 } | 4438 } |
| 4439 | 4439 |
| 4440 LayoutUnit LayoutBox::offsetLeft() const | 4440 LayoutUnit LayoutBox::offsetLeft(const Element* parent) const |
| 4441 { | 4441 { |
| 4442 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x(); | 4442 return adjustedPositionRelativeTo(topLeftLocation(), parent).x(); |
| 4443 } | 4443 } |
| 4444 | 4444 |
| 4445 LayoutUnit LayoutBox::offsetTop() const | 4445 LayoutUnit LayoutBox::offsetTop(const Element* parent) const |
| 4446 { | 4446 { |
| 4447 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y(); | 4447 return adjustedPositionRelativeTo(topLeftLocation(), parent).y(); |
| 4448 } | 4448 } |
| 4449 | 4449 |
| 4450 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const | 4450 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const
LayoutPoint& point) const |
| 4451 { | 4451 { |
| 4452 if (!style()->isFlippedBlocksWritingMode()) | 4452 if (!style()->isFlippedBlocksWritingMode()) |
| 4453 return point; | 4453 return point; |
| 4454 | 4454 |
| 4455 // The child is going to add in its x(), so we have to make sure it ends up
in | 4455 // The child is going to add in its x(), so we have to make sure it ends up
in |
| 4456 // the right place. | 4456 // the right place. |
| 4457 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 *
child->location().x()), point.y()); | 4457 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... |
| 4878 m_rareData->m_snapAreas->remove(&snapArea); | 4878 m_rareData->m_snapAreas->remove(&snapArea); |
| 4879 } | 4879 } |
| 4880 } | 4880 } |
| 4881 | 4881 |
| 4882 SnapAreaSet* LayoutBox::snapAreas() const | 4882 SnapAreaSet* LayoutBox::snapAreas() const |
| 4883 { | 4883 { |
| 4884 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4884 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
| 4885 } | 4885 } |
| 4886 | 4886 |
| 4887 } // namespace blink | 4887 } // namespace blink |
| OLD | NEW |