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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2904833002: LayoutObject::AbsoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)
Patch Set: RebasedAndUpdatedWithComments Created 3 years, 6 months 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
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. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 987
988 IntRect LayoutObject::AbsoluteElementBoundingBoxRect() const { 988 IntRect LayoutObject::AbsoluteElementBoundingBoxRect() const {
989 Vector<LayoutRect> rects; 989 Vector<LayoutRect> rects;
990 const LayoutBoxModelObject& container = EnclosingLayer()->GetLayoutObject(); 990 const LayoutBoxModelObject& container = EnclosingLayer()->GetLayoutObject();
991 AddElementVisualOverflowRects( 991 AddElementVisualOverflowRects(
992 rects, LayoutPoint(LocalToAncestorPoint(FloatPoint(), &container))); 992 rects, LayoutPoint(LocalToAncestorPoint(FloatPoint(), &container)));
993 return container.LocalToAbsoluteQuad(FloatQuad(FloatRect(UnionRect(rects)))) 993 return container.LocalToAbsoluteQuad(FloatQuad(FloatRect(UnionRect(rects))))
994 .EnclosingBoundingBox(); 994 .EnclosingBoundingBox();
995 } 995 }
996 996
997 FloatRect LayoutObject::AbsoluteBoundingBoxRectForRange(const Range* range) { 997 FloatRect LayoutObject::AbsoluteBoundingBoxRectForRange(
998 if (!range || !range->startContainer()) 998 const EphemeralRange& range) {
999 if (range.IsNull() || !range.StartPosition().ComputeContainerNode())
999 return FloatRect(); 1000 return FloatRect();
1000 1001
1001 range->OwnerDocument().UpdateStyleAndLayout(); 1002 range.GetDocument().UpdateStyleAndLayout();
1002 1003
1003 return ComputeTextFloatRect(EphemeralRange(range)); 1004 return ComputeTextFloatRect(range);
1004 } 1005 }
1005 1006
1006 void LayoutObject::AddAbsoluteRectForLayer(IntRect& result) { 1007 void LayoutObject::AddAbsoluteRectForLayer(IntRect& result) {
1007 if (HasLayer()) 1008 if (HasLayer())
1008 result.Unite(AbsoluteBoundingBoxRect()); 1009 result.Unite(AbsoluteBoundingBoxRect());
1009 for (LayoutObject* current = SlowFirstChild(); current; 1010 for (LayoutObject* current = SlowFirstChild(); current;
1010 current = current->NextSibling()) 1011 current = current->NextSibling())
1011 current->AddAbsoluteRectForLayer(result); 1012 current->AddAbsoluteRectForLayer(result);
1012 } 1013 }
1013 1014
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after
3642 const blink::LayoutObject* root = object1; 3643 const blink::LayoutObject* root = object1;
3643 while (root->Parent()) 3644 while (root->Parent())
3644 root = root->Parent(); 3645 root = root->Parent();
3645 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); 3646 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0);
3646 } else { 3647 } else {
3647 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3648 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3648 } 3649 }
3649 } 3650 }
3650 3651
3651 #endif 3652 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698