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 28 matching lines...) Expand all Loading... |
39 #include "core/dom/StyleEngine.h" | 39 #include "core/dom/StyleEngine.h" |
40 #include "core/dom/shadow/ElementShadow.h" | 40 #include "core/dom/shadow/ElementShadow.h" |
41 #include "core/dom/shadow/ShadowRoot.h" | 41 #include "core/dom/shadow/ShadowRoot.h" |
42 #include "core/events/MutationEvent.h" | 42 #include "core/events/MutationEvent.h" |
43 #include "core/html/HTMLCollection.h" | 43 #include "core/html/HTMLCollection.h" |
44 #include "core/html/HTMLFrameOwnerElement.h" | 44 #include "core/html/HTMLFrameOwnerElement.h" |
45 #include "core/html/HTMLTagCollection.h" | 45 #include "core/html/HTMLTagCollection.h" |
46 #include "core/html/RadioNodeList.h" | 46 #include "core/html/RadioNodeList.h" |
47 #include "core/inspector/InspectorInstrumentation.h" | 47 #include "core/inspector/InspectorInstrumentation.h" |
48 #include "core/layout/LayoutInline.h" | 48 #include "core/layout/LayoutInline.h" |
| 49 #include "core/layout/LayoutText.h" |
49 #include "core/layout/LayoutTheme.h" | 50 #include "core/layout/LayoutTheme.h" |
50 #include "core/layout/LayoutView.h" | 51 #include "core/layout/LayoutView.h" |
51 #include "core/layout/line/InlineTextBox.h" | 52 #include "core/layout/line/InlineTextBox.h" |
52 #include "core/rendering/RenderText.h" | |
53 #include "platform/EventDispatchForbiddenScope.h" | 53 #include "platform/EventDispatchForbiddenScope.h" |
54 #include "platform/ScriptForbiddenScope.h" | 54 #include "platform/ScriptForbiddenScope.h" |
55 | 55 |
56 namespace blink { | 56 namespace blink { |
57 | 57 |
58 using namespace HTMLNames; | 58 using namespace HTMLNames; |
59 | 59 |
60 static void dispatchChildInsertionEvents(Node&); | 60 static void dispatchChildInsertionEvents(Node&); |
61 static void dispatchChildRemovalEvents(Node&); | 61 static void dispatchChildRemovalEvents(Node&); |
62 | 62 |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 if (!o) | 894 if (!o) |
895 break; | 895 break; |
896 } | 896 } |
897 ASSERT(o); | 897 ASSERT(o); |
898 | 898 |
899 if (!o->isInline() || o->isReplaced()) { | 899 if (!o->isInline() || o->isReplaced()) { |
900 point = o->localToAbsolute(FloatPoint(), UseTransforms); | 900 point = o->localToAbsolute(FloatPoint(), UseTransforms); |
901 return true; | 901 return true; |
902 } | 902 } |
903 | 903 |
904 if (p->node() && p->node() == this && o->isText() && !o->isBR() && !toRe
nderText(o)->firstTextBox()) { | 904 if (p->node() && p->node() == this && o->isText() && !o->isBR() && !toLa
youtText(o)->firstTextBox()) { |
905 // Do nothing - skip unrendered whitespace that is a child or next s
ibling of the anchor. | 905 // Do nothing - skip unrendered whitespace that is a child or next s
ibling of the anchor. |
906 } else if ((o->isText() && !o->isBR()) || o->isReplaced()) { | 906 } else if ((o->isText() && !o->isBR()) || o->isReplaced()) { |
907 point = FloatPoint(); | 907 point = FloatPoint(); |
908 if (o->isText() && toRenderText(o)->firstTextBox()) { | 908 if (o->isText() && toLayoutText(o)->firstTextBox()) { |
909 point.move(toRenderText(o)->linesBoundingBox().x(), toRenderText
(o)->firstTextBox()->root().lineTop().toFloat()); | 909 point.move(toLayoutText(o)->linesBoundingBox().x(), toLayoutText
(o)->firstTextBox()->root().lineTop().toFloat()); |
910 } else if (o->isBox()) { | 910 } else if (o->isBox()) { |
911 LayoutBox* box = toLayoutBox(o); | 911 LayoutBox* box = toLayoutBox(o); |
912 point.moveBy(box->location()); | 912 point.moveBy(box->location()); |
913 } | 913 } |
914 point = o->container()->localToAbsolute(point, UseTransforms); | 914 point = o->container()->localToAbsolute(point, UseTransforms); |
915 return true; | 915 return true; |
916 } | 916 } |
917 } | 917 } |
918 | 918 |
919 // If the target doesn't have any children or siblings that could be used to
calculate the scroll position, we must be | 919 // If the target doesn't have any children or siblings that could be used to
calculate the scroll position, we must be |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 if (!o) | 986 if (!o) |
987 return false; | 987 return false; |
988 prev = o->previousSibling(); | 988 prev = o->previousSibling(); |
989 } | 989 } |
990 o = prev; | 990 o = prev; |
991 } | 991 } |
992 ASSERT(o); | 992 ASSERT(o); |
993 if (o->isText() || o->isReplaced()) { | 993 if (o->isText() || o->isReplaced()) { |
994 point = FloatPoint(); | 994 point = FloatPoint(); |
995 if (o->isText()) { | 995 if (o->isText()) { |
996 RenderText* text = toRenderText(o); | 996 LayoutText* text = toLayoutText(o); |
997 IntRect linesBox = text->linesBoundingBox(); | 997 IntRect linesBox = text->linesBoundingBox(); |
998 if (!linesBox.maxX() && !linesBox.maxY()) | 998 if (!linesBox.maxX() && !linesBox.maxY()) |
999 continue; | 999 continue; |
1000 point.moveBy(linesBox.maxXMaxYCorner()); | 1000 point.moveBy(linesBox.maxXMaxYCorner()); |
1001 } else { | 1001 } else { |
1002 LayoutBox* box = toLayoutBox(o); | 1002 LayoutBox* box = toLayoutBox(o); |
1003 point.moveBy(box->frameRect().maxXMaxYCorner()); | 1003 point.moveBy(box->frameRect().maxXMaxYCorner()); |
1004 } | 1004 } |
1005 point = o->container()->localToAbsolute(point, UseTransforms); | 1005 point = o->container()->localToAbsolute(point, UseTransforms); |
1006 return true; | 1006 return true; |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 return true; | 1477 return true; |
1478 | 1478 |
1479 if (node->isElementNode() && toElement(node)->shadow()) | 1479 if (node->isElementNode() && toElement(node)->shadow()) |
1480 return true; | 1480 return true; |
1481 | 1481 |
1482 return false; | 1482 return false; |
1483 } | 1483 } |
1484 #endif | 1484 #endif |
1485 | 1485 |
1486 } // namespace blink | 1486 } // namespace blink |
OLD | NEW |