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

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

Issue 2904833002: LayoutObject::AbsoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)
Patch Set: updaredPatch Created 3 years, 7 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 Vector<FloatQuad> quads; 1004 Vector<FloatQuad> quads;
1004 quads.AppendVector(ComputeTextQuads(EphemeralRange(range))); 1005 quads.AppendVector(ComputeTextQuads(range));
1005 1006
1006 FloatRect result; 1007 FloatRect result;
1007 for (size_t i = 0; i < quads.size(); ++i) 1008 for (size_t i = 0; i < quads.size(); ++i)
1008 result.Unite(quads[i].BoundingBox()); 1009 result.Unite(quads[i].BoundingBox());
1009 1010
1010 return result; 1011 return result;
1011 } 1012 }
1012 1013
1013 void LayoutObject::AddAbsoluteRectForLayer(IntRect& result) { 1014 void LayoutObject::AddAbsoluteRectForLayer(IntRect& result) {
1014 if (HasLayer()) 1015 if (HasLayer())
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after
3649 const blink::LayoutObject* root = object1; 3650 const blink::LayoutObject* root = object1;
3650 while (root->Parent()) 3651 while (root->Parent())
3651 root = root->Parent(); 3652 root = root->Parent();
3652 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); 3653 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0);
3653 } else { 3654 } else {
3654 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3655 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3655 } 3656 }
3656 } 3657 }
3657 3658
3658 #endif 3659 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698