| 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 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. 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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 LayoutUnit horizontalOffsets = | 995 LayoutUnit horizontalOffsets = |
| 996 minimumValueForLength(style()->right(), | 996 minimumValueForLength(style()->right(), |
| 997 LayoutUnit(constrainingSize.width())) + | 997 LayoutUnit(constrainingSize.width())) + |
| 998 minimumValueForLength(style()->left(), | 998 minimumValueForLength(style()->left(), |
| 999 LayoutUnit(constrainingSize.width())); | 999 LayoutUnit(constrainingSize.width())); |
| 1000 bool skipRight = false; | 1000 bool skipRight = false; |
| 1001 bool skipLeft = false; | 1001 bool skipLeft = false; |
| 1002 if (!style()->left().isAuto() && !style()->right().isAuto()) { | 1002 if (!style()->left().isAuto() && !style()->right().isAuto()) { |
| 1003 if (horizontalOffsets > | 1003 if (horizontalOffsets > |
| 1004 scrollContainerRelativeContainingBlockRect.width() || | 1004 scrollContainerRelativeContainingBlockRect.width() || |
| 1005 horizontalOffsets + scrollContainerRelativeContainingBlockRect.width() > | 1005 horizontalOffsets + stickyBoxRect.width() > constrainingSize.width()) { |
| 1006 constrainingSize.width()) { | |
| 1007 skipRight = style()->isLeftToRightDirection(); | 1006 skipRight = style()->isLeftToRightDirection(); |
| 1008 skipLeft = !skipRight; | 1007 skipLeft = !skipRight; |
| 1009 } | 1008 } |
| 1010 } | 1009 } |
| 1011 | 1010 |
| 1012 if (!style()->left().isAuto() && !skipLeft) { | 1011 if (!style()->left().isAuto() && !skipLeft) { |
| 1013 constraints.setLeftOffset(minimumValueForLength( | 1012 constraints.setLeftOffset(minimumValueForLength( |
| 1014 style()->left(), LayoutUnit(constrainingSize.width()))); | 1013 style()->left(), LayoutUnit(constrainingSize.width()))); |
| 1015 constraints.addAnchorEdge( | 1014 constraints.addAnchorEdge( |
| 1016 StickyPositionScrollingConstraints::AnchorEdgeLeft); | 1015 StickyPositionScrollingConstraints::AnchorEdgeLeft); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1027 // TODO(flackr): Exclude top or bottom edge offset depending on the writing | 1026 // TODO(flackr): Exclude top or bottom edge offset depending on the writing |
| 1028 // mode when related sections are fixed in spec. | 1027 // mode when related sections are fixed in spec. |
| 1029 // See http://lists.w3.org/Archives/Public/www-style/2014May/0286.html | 1028 // See http://lists.w3.org/Archives/Public/www-style/2014May/0286.html |
| 1030 LayoutUnit verticalOffsets = | 1029 LayoutUnit verticalOffsets = |
| 1031 minimumValueForLength(style()->top(), | 1030 minimumValueForLength(style()->top(), |
| 1032 LayoutUnit(constrainingSize.height())) + | 1031 LayoutUnit(constrainingSize.height())) + |
| 1033 minimumValueForLength(style()->bottom(), | 1032 minimumValueForLength(style()->bottom(), |
| 1034 LayoutUnit(constrainingSize.height())); | 1033 LayoutUnit(constrainingSize.height())); |
| 1035 if (!style()->top().isAuto() && !style()->bottom().isAuto()) { | 1034 if (!style()->top().isAuto() && !style()->bottom().isAuto()) { |
| 1036 if (verticalOffsets > scrollContainerRelativeContainingBlockRect.height() || | 1035 if (verticalOffsets > scrollContainerRelativeContainingBlockRect.height() || |
| 1037 verticalOffsets + scrollContainerRelativeContainingBlockRect.height() > | 1036 verticalOffsets + stickyBoxRect.height() > constrainingSize.height()) { |
| 1038 constrainingSize.height()) { | |
| 1039 skipBottom = true; | 1037 skipBottom = true; |
| 1040 } | 1038 } |
| 1041 } | 1039 } |
| 1042 | 1040 |
| 1043 if (!style()->top().isAuto()) { | 1041 if (!style()->top().isAuto()) { |
| 1044 constraints.setTopOffset(minimumValueForLength( | 1042 constraints.setTopOffset(minimumValueForLength( |
| 1045 style()->top(), LayoutUnit(constrainingSize.height()))); | 1043 style()->top(), LayoutUnit(constrainingSize.height()))); |
| 1046 constraints.addAnchorEdge( | 1044 constraints.addAnchorEdge( |
| 1047 StickyPositionScrollingConstraints::AnchorEdgeTop); | 1045 StickyPositionScrollingConstraints::AnchorEdgeTop); |
| 1048 } | 1046 } |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 if (rootElementStyle->hasBackground()) | 1466 if (rootElementStyle->hasBackground()) |
| 1469 return false; | 1467 return false; |
| 1470 | 1468 |
| 1471 if (node() != document().firstBodyElement()) | 1469 if (node() != document().firstBodyElement()) |
| 1472 return false; | 1470 return false; |
| 1473 | 1471 |
| 1474 return true; | 1472 return true; |
| 1475 } | 1473 } |
| 1476 | 1474 |
| 1477 } // namespace blink | 1475 } // namespace blink |
| OLD | NEW |