| 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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 else if (windowAutoscrollPoint.y() > windowBox.maxY() - autoscrollBeltSize) | 1035 else if (windowAutoscrollPoint.y() > windowBox.maxY() - autoscrollBeltSize) |
| 1036 windowAutoscrollPoint.move(0, autoscrollBeltSize); | 1036 windowAutoscrollPoint.move(0, autoscrollBeltSize); |
| 1037 | 1037 |
| 1038 return windowAutoscrollPoint - pointInRootFrame; | 1038 return windowAutoscrollPoint - pointInRootFrame; |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 LayoutBox* LayoutBox::findAutoscrollable(LayoutObject* layoutObject) { | 1041 LayoutBox* LayoutBox::findAutoscrollable(LayoutObject* layoutObject) { |
| 1042 while ( | 1042 while ( |
| 1043 layoutObject && | 1043 layoutObject && |
| 1044 !(layoutObject->isBox() && toLayoutBox(layoutObject)->canAutoscroll())) { | 1044 !(layoutObject->isBox() && toLayoutBox(layoutObject)->canAutoscroll())) { |
| 1045 // Do not start autoscroll when the node is inside a fixed-position element. |
| 1046 if (layoutObject->isBox() && toLayoutBox(layoutObject)->hasLayer() && |
| 1047 toLayoutBox(layoutObject)->layer()->scrollsWithViewport()) { |
| 1048 return nullptr; |
| 1049 } |
| 1050 |
| 1045 if (!layoutObject->parent() && | 1051 if (!layoutObject->parent() && |
| 1046 layoutObject->node() == layoutObject->document() && | 1052 layoutObject->node() == layoutObject->document() && |
| 1047 layoutObject->document().localOwner()) | 1053 layoutObject->document().localOwner()) |
| 1048 layoutObject = layoutObject->document().localOwner()->layoutObject(); | 1054 layoutObject = layoutObject->document().localOwner()->layoutObject(); |
| 1049 else | 1055 else |
| 1050 layoutObject = layoutObject->parent(); | 1056 layoutObject = layoutObject->parent(); |
| 1051 } | 1057 } |
| 1052 | 1058 |
| 1053 return layoutObject && layoutObject->isBox() ? toLayoutBox(layoutObject) : 0; | 1059 return layoutObject && layoutObject->isBox() ? toLayoutBox(layoutObject) |
| 1060 : nullptr; |
| 1054 } | 1061 } |
| 1055 | 1062 |
| 1056 static inline int adjustedScrollDelta(int beginningDelta) { | 1063 static inline int adjustedScrollDelta(int beginningDelta) { |
| 1057 // This implemention matches Firefox's. | 1064 // This implemention matches Firefox's. |
| 1058 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml#8
56. | 1065 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml#8
56. |
| 1059 const int speedReducer = 12; | 1066 const int speedReducer = 12; |
| 1060 | 1067 |
| 1061 int adjustedDelta = beginningDelta / speedReducer; | 1068 int adjustedDelta = beginningDelta / speedReducer; |
| 1062 if (adjustedDelta > 1) | 1069 if (adjustedDelta > 1) |
| 1063 adjustedDelta = static_cast<int>(adjustedDelta * | 1070 adjustedDelta = static_cast<int>(adjustedDelta * |
| (...skipping 4568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5632 LayoutRect rect = frameRect(); | 5639 LayoutRect rect = frameRect(); |
| 5633 | 5640 |
| 5634 LayoutBlock* block = containingBlock(); | 5641 LayoutBlock* block = containingBlock(); |
| 5635 if (block) | 5642 if (block) |
| 5636 block->adjustChildDebugRect(rect); | 5643 block->adjustChildDebugRect(rect); |
| 5637 | 5644 |
| 5638 return rect; | 5645 return rect; |
| 5639 } | 5646 } |
| 5640 | 5647 |
| 5641 } // namespace blink | 5648 } // namespace blink |
| OLD | NEW |