| 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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 clone->appendChild(n->cloneNode(true), exceptionState); | 854 clone->appendChild(n->cloneNode(true), exceptionState); |
| 855 } | 855 } |
| 856 | 856 |
| 857 | 857 |
| 858 bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const | 858 bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const |
| 859 { | 859 { |
| 860 if (!renderer()) | 860 if (!renderer()) |
| 861 return false; | 861 return false; |
| 862 | 862 |
| 863 // FIXME: What is this code really trying to do? | 863 // FIXME: What is this code really trying to do? |
| 864 RenderObject* o = renderer(); | 864 LayoutObject* o = renderer(); |
| 865 if (!o->isInline() || o->isReplaced()) { | 865 if (!o->isInline() || o->isReplaced()) { |
| 866 point = o->localToAbsolute(FloatPoint(), UseTransforms); | 866 point = o->localToAbsolute(FloatPoint(), UseTransforms); |
| 867 return true; | 867 return true; |
| 868 } | 868 } |
| 869 | 869 |
| 870 // Find the next text/image child, to get a position. | 870 // Find the next text/image child, to get a position. |
| 871 while (o) { | 871 while (o) { |
| 872 RenderObject* p = o; | 872 LayoutObject* p = o; |
| 873 if (RenderObject* oFirstChild = o->slowFirstChild()) { | 873 if (LayoutObject* oFirstChild = o->slowFirstChild()) { |
| 874 o = oFirstChild; | 874 o = oFirstChild; |
| 875 } else if (o->nextSibling()) { | 875 } else if (o->nextSibling()) { |
| 876 o = o->nextSibling(); | 876 o = o->nextSibling(); |
| 877 } else { | 877 } else { |
| 878 RenderObject* next = nullptr; | 878 LayoutObject* next = nullptr; |
| 879 while (!next && o->parent()) { | 879 while (!next && o->parent()) { |
| 880 o = o->parent(); | 880 o = o->parent(); |
| 881 next = o->nextSibling(); | 881 next = o->nextSibling(); |
| 882 } | 882 } |
| 883 o = next; | 883 o = next; |
| 884 | 884 |
| 885 if (!o) | 885 if (!o) |
| 886 break; | 886 break; |
| 887 } | 887 } |
| 888 ASSERT(o); | 888 ASSERT(o); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 909 | 909 |
| 910 // If the target doesn't have any children or siblings that could be used to
calculate the scroll position, we must be | 910 // If the target doesn't have any children or siblings that could be used to
calculate the scroll position, we must be |
| 911 // at the end of the document. Scroll to the bottom. FIXME: who said anythin
g about scrolling? | 911 // at the end of the document. Scroll to the bottom. FIXME: who said anythin
g about scrolling? |
| 912 if (!o && document().view()) { | 912 if (!o && document().view()) { |
| 913 point = FloatPoint(0, document().view()->contentsHeight()); | 913 point = FloatPoint(0, document().view()->contentsHeight()); |
| 914 return true; | 914 return true; |
| 915 } | 915 } |
| 916 return false; | 916 return false; |
| 917 } | 917 } |
| 918 | 918 |
| 919 static inline RenderObject* endOfContinuations(RenderObject* renderer) | 919 static inline LayoutObject* endOfContinuations(LayoutObject* renderer) |
| 920 { | 920 { |
| 921 RenderObject* prev = nullptr; | 921 LayoutObject* prev = nullptr; |
| 922 RenderObject* cur = renderer; | 922 LayoutObject* cur = renderer; |
| 923 | 923 |
| 924 if (!cur->isRenderInline() && !cur->isRenderBlock()) | 924 if (!cur->isRenderInline() && !cur->isRenderBlock()) |
| 925 return nullptr; | 925 return nullptr; |
| 926 | 926 |
| 927 while (cur) { | 927 while (cur) { |
| 928 prev = cur; | 928 prev = cur; |
| 929 if (cur->isRenderInline()) | 929 if (cur->isRenderInline()) |
| 930 cur = toRenderInline(cur)->continuation(); | 930 cur = toRenderInline(cur)->continuation(); |
| 931 else | 931 else |
| 932 cur = toRenderBlock(cur)->continuation(); | 932 cur = toRenderBlock(cur)->continuation(); |
| 933 } | 933 } |
| 934 | 934 |
| 935 return prev; | 935 return prev; |
| 936 } | 936 } |
| 937 | 937 |
| 938 bool ContainerNode::getLowerRightCorner(FloatPoint& point) const | 938 bool ContainerNode::getLowerRightCorner(FloatPoint& point) const |
| 939 { | 939 { |
| 940 if (!renderer()) | 940 if (!renderer()) |
| 941 return false; | 941 return false; |
| 942 | 942 |
| 943 RenderObject* o = renderer(); | 943 LayoutObject* o = renderer(); |
| 944 if (!o->isInline() || o->isReplaced()) { | 944 if (!o->isInline() || o->isReplaced()) { |
| 945 RenderBox* box = toRenderBox(o); | 945 RenderBox* box = toRenderBox(o); |
| 946 point = o->localToAbsolute(FloatPoint(box->size()), UseTransforms); | 946 point = o->localToAbsolute(FloatPoint(box->size()), UseTransforms); |
| 947 return true; | 947 return true; |
| 948 } | 948 } |
| 949 | 949 |
| 950 RenderObject* startContinuation = nullptr; | 950 LayoutObject* startContinuation = nullptr; |
| 951 // Find the last text/image child, to get a position. | 951 // Find the last text/image child, to get a position. |
| 952 while (o) { | 952 while (o) { |
| 953 if (RenderObject* oLastChild = o->slowLastChild()) { | 953 if (LayoutObject* oLastChild = o->slowLastChild()) { |
| 954 o = oLastChild; | 954 o = oLastChild; |
| 955 } else if (o != renderer() && o->previousSibling()) { | 955 } else if (o != renderer() && o->previousSibling()) { |
| 956 o = o->previousSibling(); | 956 o = o->previousSibling(); |
| 957 } else { | 957 } else { |
| 958 RenderObject* prev = nullptr; | 958 LayoutObject* prev = nullptr; |
| 959 while (!prev) { | 959 while (!prev) { |
| 960 // Check if the current renderer has contiunation and move the l
ocation for finding the renderer | 960 // Check if the current renderer has contiunation and move the l
ocation for finding the renderer |
| 961 // to the end of continuations if there is the continuation. | 961 // to the end of continuations if there is the continuation. |
| 962 // Skip to check the contiunation on contiunations section | 962 // Skip to check the contiunation on contiunations section |
| 963 if (startContinuation == o) { | 963 if (startContinuation == o) { |
| 964 startContinuation = nullptr; | 964 startContinuation = nullptr; |
| 965 } else if (!startContinuation) { | 965 } else if (!startContinuation) { |
| 966 if (RenderObject* continuation = endOfContinuations(o)) { | 966 if (LayoutObject* continuation = endOfContinuations(o)) { |
| 967 startContinuation = o; | 967 startContinuation = o; |
| 968 prev = continuation; | 968 prev = continuation; |
| 969 break; | 969 break; |
| 970 } | 970 } |
| 971 } | 971 } |
| 972 // Prevent to overrun out of own render tree | 972 // Prevent to overrun out of own render tree |
| 973 if (o == renderer()) { | 973 if (o == renderer()) { |
| 974 return false; | 974 return false; |
| 975 } | 975 } |
| 976 o = o->parent(); | 976 o = o->parent(); |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 return true; | 1468 return true; |
| 1469 | 1469 |
| 1470 if (node->isElementNode() && toElement(node)->shadow()) | 1470 if (node->isElementNode() && toElement(node)->shadow()) |
| 1471 return true; | 1471 return true; |
| 1472 | 1472 |
| 1473 return false; | 1473 return false; |
| 1474 } | 1474 } |
| 1475 #endif | 1475 #endif |
| 1476 | 1476 |
| 1477 } // namespace blink | 1477 } // namespace blink |
| OLD | NEW |