| 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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 return true; | 964 return true; |
| 965 | 965 |
| 966 return false; | 966 return false; |
| 967 } | 967 } |
| 968 | 968 |
| 969 void RenderObject::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRec
t) | 969 void RenderObject::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRec
t) |
| 970 { | 970 { |
| 971 ObjectPainter(*this).paintOutline(paintInfo, paintRect); | 971 ObjectPainter(*this).paintOutline(paintInfo, paintRect); |
| 972 } | 972 } |
| 973 | 973 |
| 974 void RenderObject::addChildFocusRingRects(Vector<LayoutRect>& rects, const Layou
tPoint& additionalOffset, const RenderLayerModelObject* paintContainer) const | |
| 975 { | |
| 976 for (RenderObject* current = slowFirstChild(); current; current = current->n
extSibling()) { | |
| 977 if (current->isText() || current->isListMarker()) | |
| 978 continue; | |
| 979 | |
| 980 if (current->isBox()) { | |
| 981 RenderBox* box = toRenderBox(current); | |
| 982 if (box->hasLayer()) { | |
| 983 Vector<LayoutRect> layerFocusRingRects; | |
| 984 box->addFocusRingRects(layerFocusRingRects, LayoutPoint(), box); | |
| 985 for (size_t i = 0; i < layerFocusRingRects.size(); ++i) { | |
| 986 FloatQuad quadInBox = box->localToContainerQuad(FloatQuad(la
yerFocusRingRects[i]), paintContainer); | |
| 987 LayoutRect rect = LayoutRect(quadInBox.boundingBox()); | |
| 988 if (!rect.isEmpty()) | |
| 989 rects.append(rect); | |
| 990 } | |
| 991 } else { | |
| 992 box->addFocusRingRects(rects, additionalOffset + box->locationOf
fset(), paintContainer); | |
| 993 } | |
| 994 } else { | |
| 995 current->addFocusRingRects(rects, additionalOffset, paintContainer); | |
| 996 } | |
| 997 } | |
| 998 } | |
| 999 | |
| 1000 IntRect RenderObject::absoluteBoundingBoxRect() const | 974 IntRect RenderObject::absoluteBoundingBoxRect() const |
| 1001 { | 975 { |
| 1002 Vector<FloatQuad> quads; | 976 Vector<FloatQuad> quads; |
| 1003 absoluteQuads(quads); | 977 absoluteQuads(quads); |
| 1004 | 978 |
| 1005 size_t n = quads.size(); | 979 size_t n = quads.size(); |
| 1006 if (!n) | 980 if (!n) |
| 1007 return IntRect(); | 981 return IntRect(); |
| 1008 | 982 |
| 1009 IntRect result = quads[0].enclosingBoundingBox(); | 983 IntRect result = quads[0].enclosingBoundingBox(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1024 | 998 |
| 1025 LayoutRect result = rects[0]; | 999 LayoutRect result = rects[0]; |
| 1026 for (size_t i = 1; i < n; ++i) | 1000 for (size_t i = 1; i < n; ++i) |
| 1027 result.unite(rects[i]); | 1001 result.unite(rects[i]); |
| 1028 return pixelSnappedIntRect(result); | 1002 return pixelSnappedIntRect(result); |
| 1029 } | 1003 } |
| 1030 | 1004 |
| 1031 void RenderObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads) | 1005 void RenderObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads) |
| 1032 { | 1006 { |
| 1033 Vector<LayoutRect> rects; | 1007 Vector<LayoutRect> rects; |
| 1034 const RenderLayerModelObject* container = containerForPaintInvalidation(); | 1008 addFocusRingRects(rects, LayoutPoint()); |
| 1035 addFocusRingRects(rects, LayoutPoint(localToContainerPoint(FloatPoint(), con
tainer)), container); | |
| 1036 size_t count = rects.size(); | 1009 size_t count = rects.size(); |
| 1037 for (size_t i = 0; i < count; ++i) | 1010 for (size_t i = 0; i < count; ++i) |
| 1038 quads.append(container->localToAbsoluteQuad(FloatQuad(rects[i]))); | 1011 quads.append(localToAbsoluteQuad(FloatQuad(rects[i]))); |
| 1039 } | 1012 } |
| 1040 | 1013 |
| 1041 FloatRect RenderObject::absoluteBoundingBoxRectForRange(const Range* range) | 1014 FloatRect RenderObject::absoluteBoundingBoxRectForRange(const Range* range) |
| 1042 { | 1015 { |
| 1043 if (!range || !range->startContainer()) | 1016 if (!range || !range->startContainer()) |
| 1044 return FloatRect(); | 1017 return FloatRect(); |
| 1045 | 1018 |
| 1046 range->ownerDocument().updateLayout(); | 1019 range->ownerDocument().updateLayout(); |
| 1047 | 1020 |
| 1048 Vector<FloatQuad> quads; | 1021 Vector<FloatQuad> quads; |
| (...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3187 { | 3160 { |
| 3188 if (object1) { | 3161 if (object1) { |
| 3189 const blink::RenderObject* root = object1; | 3162 const blink::RenderObject* root = object1; |
| 3190 while (root->parent()) | 3163 while (root->parent()) |
| 3191 root = root->parent(); | 3164 root = root->parent(); |
| 3192 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3165 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3193 } | 3166 } |
| 3194 } | 3167 } |
| 3195 | 3168 |
| 3196 #endif | 3169 #endif |
| OLD | NEW |