Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 711493004: Remove unnecessary paintContainer parameter from addFocusRingRects (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderTextControl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 if (mustInvalidateFillLayersPaintOnHeightChange(style()->backgroundLayers()) ) 959 if (mustInvalidateFillLayersPaintOnHeightChange(style()->backgroundLayers()) )
960 return true; 960 return true;
961 961
962 // Our fill layers are ok. Let's check border. 962 // Our fill layers are ok. Let's check border.
963 if (style()->hasBorder() && canRenderBorderImage()) 963 if (style()->hasBorder() && canRenderBorderImage())
964 return true; 964 return true;
965 965
966 return false; 966 return false;
967 } 967 }
968 968
969 void RenderObject::addChildFocusRingRects(Vector<LayoutRect>& rects, const Layou tPoint& additionalOffset, const RenderLayerModelObject* paintContainer) const
970 {
971 for (RenderObject* current = slowFirstChild(); current; current = current->n extSibling()) {
972 if (current->isText() || current->isListMarker())
973 continue;
974
975 if (current->isBox()) {
976 RenderBox* box = toRenderBox(current);
977 if (box->hasLayer()) {
978 Vector<LayoutRect> layerFocusRingRects;
979 box->addFocusRingRects(layerFocusRingRects, LayoutPoint(), box);
980 for (size_t i = 0; i < layerFocusRingRects.size(); ++i) {
981 FloatQuad quadInBox = box->localToContainerQuad(FloatQuad(la yerFocusRingRects[i]), paintContainer);
982 LayoutRect rect = LayoutRect(quadInBox.boundingBox());
983 if (!rect.isEmpty())
984 rects.append(rect);
985 }
986 } else {
987 box->addFocusRingRects(rects, additionalOffset + box->locationOf fset(), paintContainer);
988 }
989 } else {
990 current->addFocusRingRects(rects, additionalOffset, paintContainer);
991 }
992 }
993 }
994
995 IntRect RenderObject::absoluteBoundingBoxRect() const 969 IntRect RenderObject::absoluteBoundingBoxRect() const
996 { 970 {
997 Vector<FloatQuad> quads; 971 Vector<FloatQuad> quads;
998 absoluteQuads(quads); 972 absoluteQuads(quads);
999 973
1000 size_t n = quads.size(); 974 size_t n = quads.size();
1001 if (!n) 975 if (!n)
1002 return IntRect(); 976 return IntRect();
1003 977
1004 IntRect result = quads[0].enclosingBoundingBox(); 978 IntRect result = quads[0].enclosingBoundingBox();
(...skipping 14 matching lines...) Expand all
1019 993
1020 LayoutRect result = rects[0]; 994 LayoutRect result = rects[0];
1021 for (size_t i = 1; i < n; ++i) 995 for (size_t i = 1; i < n; ++i)
1022 result.unite(rects[i]); 996 result.unite(rects[i]);
1023 return pixelSnappedIntRect(result); 997 return pixelSnappedIntRect(result);
1024 } 998 }
1025 999
1026 IntRect RenderObject::absoluteFocusRingBoundingBoxRect() const 1000 IntRect RenderObject::absoluteFocusRingBoundingBoxRect() const
1027 { 1001 {
1028 Vector<LayoutRect> rects; 1002 Vector<LayoutRect> rects;
1029 const RenderLayerModelObject* container = containerForPaintInvalidation(); 1003 const RenderLayerModelObject* container = enclosingLayer()->renderer();
1030 addFocusRingRects(rects, LayoutPoint(localToContainerPoint(FloatPoint(), con tainer)), container); 1004 addFocusRingRects(rects, LayoutPoint(localToContainerPoint(FloatPoint(), con tainer)));
1031 return container->localToAbsoluteQuad(FloatQuad(unionRect(rects))).enclosing BoundingBox(); 1005 return container->localToAbsoluteQuad(FloatQuad(unionRect(rects))).enclosing BoundingBox();
1032 } 1006 }
1033 1007
1034 FloatRect RenderObject::absoluteBoundingBoxRectForRange(const Range* range) 1008 FloatRect RenderObject::absoluteBoundingBoxRectForRange(const Range* range)
1035 { 1009 {
1036 if (!range || !range->startContainer()) 1010 if (!range || !range->startContainer())
1037 return FloatRect(); 1011 return FloatRect();
1038 1012
1039 range->ownerDocument().updateLayout(); 1013 range->ownerDocument().updateLayout();
1040 1014
(...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 { 3150 {
3177 if (object1) { 3151 if (object1) {
3178 const blink::RenderObject* root = object1; 3152 const blink::RenderObject* root = object1;
3179 while (root->parent()) 3153 while (root->parent())
3180 root = root->parent(); 3154 root = root->parent();
3181 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3155 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3182 } 3156 }
3183 } 3157 }
3184 3158
3185 #endif 3159 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderTextControl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698