| 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 return true; | 888 return true; |
| 889 } | 889 } |
| 890 | 890 |
| 891 if (p->node() && p->node() == this && o->isText() && !o->isBR() && !toRe
nderText(o)->firstTextBox()) { | 891 if (p->node() && p->node() == this && o->isText() && !o->isBR() && !toRe
nderText(o)->firstTextBox()) { |
| 892 // Do nothing - skip unrendered whitespace that is a child or next s
ibling of the anchor. | 892 // Do nothing - skip unrendered whitespace that is a child or next s
ibling of the anchor. |
| 893 } else if ((o->isText() && !o->isBR()) || o->isReplaced()) { | 893 } else if ((o->isText() && !o->isBR()) || o->isReplaced()) { |
| 894 point = FloatPoint(); | 894 point = FloatPoint(); |
| 895 if (o->isText() && toRenderText(o)->firstTextBox()) { | 895 if (o->isText() && toRenderText(o)->firstTextBox()) { |
| 896 point.move(toRenderText(o)->linesBoundingBox().x(), toRenderText
(o)->firstTextBox()->root().lineTop().toFloat()); | 896 point.move(toRenderText(o)->linesBoundingBox().x(), toRenderText
(o)->firstTextBox()->root().lineTop().toFloat()); |
| 897 } else if (o->isBox()) { | 897 } else if (o->isBox()) { |
| 898 RenderBox* box = toRenderBox(o); | 898 LayoutBox* box = toLayoutBox(o); |
| 899 point.moveBy(box->location()); | 899 point.moveBy(box->location()); |
| 900 } | 900 } |
| 901 point = o->container()->localToAbsolute(point, UseTransforms); | 901 point = o->container()->localToAbsolute(point, UseTransforms); |
| 902 return true; | 902 return true; |
| 903 } | 903 } |
| 904 } | 904 } |
| 905 | 905 |
| 906 // If the target doesn't have any children or siblings that could be used to
calculate the scroll position, we must be | 906 // If the target doesn't have any children or siblings that could be used to
calculate the scroll position, we must be |
| 907 // at the end of the document. Scroll to the bottom. FIXME: who said anythin
g about scrolling? | 907 // at the end of the document. Scroll to the bottom. FIXME: who said anythin
g about scrolling? |
| 908 if (!o && document().view()) { | 908 if (!o && document().view()) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 931 return prev; | 931 return prev; |
| 932 } | 932 } |
| 933 | 933 |
| 934 bool ContainerNode::getLowerRightCorner(FloatPoint& point) const | 934 bool ContainerNode::getLowerRightCorner(FloatPoint& point) const |
| 935 { | 935 { |
| 936 if (!renderer()) | 936 if (!renderer()) |
| 937 return false; | 937 return false; |
| 938 | 938 |
| 939 LayoutObject* o = renderer(); | 939 LayoutObject* o = renderer(); |
| 940 if (!o->isInline() || o->isReplaced()) { | 940 if (!o->isInline() || o->isReplaced()) { |
| 941 RenderBox* box = toRenderBox(o); | 941 LayoutBox* box = toLayoutBox(o); |
| 942 point = o->localToAbsolute(FloatPoint(box->size()), UseTransforms); | 942 point = o->localToAbsolute(FloatPoint(box->size()), UseTransforms); |
| 943 return true; | 943 return true; |
| 944 } | 944 } |
| 945 | 945 |
| 946 LayoutObject* startContinuation = nullptr; | 946 LayoutObject* startContinuation = nullptr; |
| 947 // Find the last text/image child, to get a position. | 947 // Find the last text/image child, to get a position. |
| 948 while (o) { | 948 while (o) { |
| 949 if (LayoutObject* oLastChild = o->slowLastChild()) { | 949 if (LayoutObject* oLastChild = o->slowLastChild()) { |
| 950 o = oLastChild; | 950 o = oLastChild; |
| 951 } else if (o != renderer() && o->previousSibling()) { | 951 } else if (o != renderer() && o->previousSibling()) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 979 ASSERT(o); | 979 ASSERT(o); |
| 980 if (o->isText() || o->isReplaced()) { | 980 if (o->isText() || o->isReplaced()) { |
| 981 point = FloatPoint(); | 981 point = FloatPoint(); |
| 982 if (o->isText()) { | 982 if (o->isText()) { |
| 983 RenderText* text = toRenderText(o); | 983 RenderText* text = toRenderText(o); |
| 984 IntRect linesBox = text->linesBoundingBox(); | 984 IntRect linesBox = text->linesBoundingBox(); |
| 985 if (!linesBox.maxX() && !linesBox.maxY()) | 985 if (!linesBox.maxX() && !linesBox.maxY()) |
| 986 continue; | 986 continue; |
| 987 point.moveBy(linesBox.maxXMaxYCorner()); | 987 point.moveBy(linesBox.maxXMaxYCorner()); |
| 988 } else { | 988 } else { |
| 989 RenderBox* box = toRenderBox(o); | 989 LayoutBox* box = toLayoutBox(o); |
| 990 point.moveBy(box->frameRect().maxXMaxYCorner()); | 990 point.moveBy(box->frameRect().maxXMaxYCorner()); |
| 991 } | 991 } |
| 992 point = o->container()->localToAbsolute(point, UseTransforms); | 992 point = o->container()->localToAbsolute(point, UseTransforms); |
| 993 return true; | 993 return true; |
| 994 } | 994 } |
| 995 } | 995 } |
| 996 return true; | 996 return true; |
| 997 } | 997 } |
| 998 | 998 |
| 999 // FIXME: This override is only needed for inline anchors without an | 999 // FIXME: This override is only needed for inline anchors without an |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 return true; | 1464 return true; |
| 1465 | 1465 |
| 1466 if (node->isElementNode() && toElement(node)->shadow()) | 1466 if (node->isElementNode() && toElement(node)->shadow()) |
| 1467 return true; | 1467 return true; |
| 1468 | 1468 |
| 1469 return false; | 1469 return false; |
| 1470 } | 1470 } |
| 1471 #endif | 1471 #endif |
| 1472 | 1472 |
| 1473 } // namespace blink | 1473 } // namespace blink |
| OLD | NEW |