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. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 4882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4893 else | 4893 else |
4894 overflowRect.shiftXEdgeTo(std::max(overflowRect.x(), clientBox.x())); | 4894 overflowRect.shiftXEdgeTo(std::max(overflowRect.x(), clientBox.x())); |
4895 | 4895 |
4896 // Now re-test with the adjusted rectangle and see if it has become | 4896 // Now re-test with the adjusted rectangle and see if it has become |
4897 // unreachable or fully | 4897 // unreachable or fully |
4898 // contained. | 4898 // contained. |
4899 if (clientBox.contains(overflowRect) || overflowRect.isEmpty()) | 4899 if (clientBox.contains(overflowRect) || overflowRect.isEmpty()) |
4900 return; | 4900 return; |
4901 } | 4901 } |
4902 | 4902 |
4903 if (!m_overflow) | 4903 if (!m_overflow) { |
4904 m_overflow = wrapUnique(new BoxOverflowModel(clientBox, borderBoxRect())); | 4904 m_overflow = |
| 4905 WTF::wrapUnique(new BoxOverflowModel(clientBox, borderBoxRect())); |
| 4906 } |
4905 | 4907 |
4906 m_overflow->addLayoutOverflow(overflowRect); | 4908 m_overflow->addLayoutOverflow(overflowRect); |
4907 } | 4909 } |
4908 | 4910 |
4909 void LayoutBox::addSelfVisualOverflow(const LayoutRect& rect) { | 4911 void LayoutBox::addSelfVisualOverflow(const LayoutRect& rect) { |
4910 if (rect.isEmpty()) | 4912 if (rect.isEmpty()) |
4911 return; | 4913 return; |
4912 | 4914 |
4913 LayoutRect borderBox = borderBoxRect(); | 4915 LayoutRect borderBox = borderBoxRect(); |
4914 if (borderBox.contains(rect)) | 4916 if (borderBox.contains(rect)) |
4915 return; | 4917 return; |
4916 | 4918 |
4917 if (!m_overflow) | 4919 if (!m_overflow) { |
4918 m_overflow = wrapUnique(new BoxOverflowModel(noOverflowRect(), borderBox)); | 4920 m_overflow = |
| 4921 WTF::wrapUnique(new BoxOverflowModel(noOverflowRect(), borderBox)); |
| 4922 } |
4919 | 4923 |
4920 m_overflow->addSelfVisualOverflow(rect); | 4924 m_overflow->addSelfVisualOverflow(rect); |
4921 } | 4925 } |
4922 | 4926 |
4923 void LayoutBox::addContentsVisualOverflow(const LayoutRect& rect) { | 4927 void LayoutBox::addContentsVisualOverflow(const LayoutRect& rect) { |
4924 if (rect.isEmpty()) | 4928 if (rect.isEmpty()) |
4925 return; | 4929 return; |
4926 | 4930 |
4927 // If hasOverflowClip() we always save contents visual overflow because we | 4931 // If hasOverflowClip() we always save contents visual overflow because we |
4928 // need it | 4932 // need it |
4929 // e.g. to determine whether to apply rounded corner clip on contents. | 4933 // e.g. to determine whether to apply rounded corner clip on contents. |
4930 // Otherwise we save contents visual overflow only if it overflows the border | 4934 // Otherwise we save contents visual overflow only if it overflows the border |
4931 // box. | 4935 // box. |
4932 LayoutRect borderBox = borderBoxRect(); | 4936 LayoutRect borderBox = borderBoxRect(); |
4933 if (!hasOverflowClip() && borderBox.contains(rect)) | 4937 if (!hasOverflowClip() && borderBox.contains(rect)) |
4934 return; | 4938 return; |
4935 | 4939 |
4936 if (!m_overflow) | 4940 if (!m_overflow) { |
4937 m_overflow = wrapUnique(new BoxOverflowModel(noOverflowRect(), borderBox)); | 4941 m_overflow = |
| 4942 WTF::wrapUnique(new BoxOverflowModel(noOverflowRect(), borderBox)); |
| 4943 } |
4938 m_overflow->addContentsVisualOverflow(rect); | 4944 m_overflow->addContentsVisualOverflow(rect); |
4939 } | 4945 } |
4940 | 4946 |
4941 void LayoutBox::clearLayoutOverflow() { | 4947 void LayoutBox::clearLayoutOverflow() { |
4942 if (!m_overflow) | 4948 if (!m_overflow) |
4943 return; | 4949 return; |
4944 | 4950 |
4945 if (!hasSelfVisualOverflow() && contentsVisualOverflowRect().isEmpty()) { | 4951 if (!hasSelfVisualOverflow() && contentsVisualOverflowRect().isEmpty()) { |
4946 clearAllOverflows(); | 4952 clearAllOverflows(); |
4947 return; | 4953 return; |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5646 LayoutRect rect = frameRect(); | 5652 LayoutRect rect = frameRect(); |
5647 | 5653 |
5648 LayoutBlock* block = containingBlock(); | 5654 LayoutBlock* block = containingBlock(); |
5649 if (block) | 5655 if (block) |
5650 block->adjustChildDebugRect(rect); | 5656 block->adjustChildDebugRect(rect); |
5651 | 5657 |
5652 return rect; | 5658 return rect; |
5653 } | 5659 } |
5654 | 5660 |
5655 } // namespace blink | 5661 } // namespace blink |
OLD | NEW |