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

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

Issue 1269123002: Preparation for combining paths of focus rings and outlines (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove debug from fast/css/focus-ring-recursive-continuations.html Created 5 years, 4 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 | Annotate | Revision Log
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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 size_t n = rects.size(); 991 size_t n = rects.size();
992 if (!n) 992 if (!n)
993 return IntRect(); 993 return IntRect();
994 994
995 IntRect result = rects[0]; 995 IntRect result = rects[0];
996 for (size_t i = 1; i < n; ++i) 996 for (size_t i = 1; i < n; ++i)
997 result.unite(rects[i]); 997 result.unite(rects[i]);
998 return result; 998 return result;
999 } 999 }
1000 1000
1001 IntRect LayoutObject::absoluteFocusRingBoundingBoxRect() const 1001 IntRect LayoutObject::absoluteOutlineBoundingBoxRect() const
1002 { 1002 {
1003 Vector<LayoutRect> rects; 1003 Vector<LayoutRect> rects;
1004 const LayoutBoxModelObject* container = enclosingLayer()->layoutObject(); 1004 const LayoutBoxModelObject* container = enclosingLayer()->layoutObject();
1005 addFocusRingRects(rects, LayoutPoint(localToContainerPoint(FloatPoint(), con tainer))); 1005 addOutlineRects(rects, LayoutPoint(localToContainerPoint(FloatPoint(), conta iner)));
1006 return container->localToAbsoluteQuad(FloatQuad(unionRect(rects))).enclosing BoundingBox(); 1006 return container->localToAbsoluteQuad(FloatQuad(unionRect(rects))).enclosing BoundingBox();
1007 } 1007 }
1008 1008
1009 FloatRect LayoutObject::absoluteBoundingBoxRectForRange(const Range* range) 1009 FloatRect LayoutObject::absoluteBoundingBoxRectForRange(const Range* range)
1010 { 1010 {
1011 if (!range || !range->startContainer()) 1011 if (!range || !range->startContainer())
1012 return FloatRect(); 1012 return FloatRect();
1013 1013
1014 range->ownerDocument().updateLayout(); 1014 range->ownerDocument().updateLayout();
1015 1015
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 // children when location of this object changed. 1389 // children when location of this object changed.
1390 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat ionBacking) 1390 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat ionBacking)
1391 return PaintInvalidationLocationChange; 1391 return PaintInvalidationLocationChange;
1392 1392
1393 if (shouldDoFullPaintInvalidation()) 1393 if (shouldDoFullPaintInvalidation())
1394 return m_bitfields.fullPaintInvalidationReason(); 1394 return m_bitfields.fullPaintInvalidationReason();
1395 1395
1396 // The focus ring may change because of position change of descendants. For simplicity, 1396 // The focus ring may change because of position change of descendants. For simplicity,
1397 // just force full paint invalidation if this object is marked for checking paint invalidation 1397 // just force full paint invalidation if this object is marked for checking paint invalidation
1398 // for any reason. 1398 // for any reason.
1399 // TODO(wangxianzhu): extend this to all outlines.
1399 if (styleRef().outlineStyleIsAuto()) 1400 if (styleRef().outlineStyleIsAuto())
1400 return PaintInvalidationFocusRing; 1401 return PaintInvalidationOutline;
1401 1402
1402 // If the bounds are the same then we know that none of the statements below 1403 // If the bounds are the same then we know that none of the statements below
1403 // can match, so we can early out since we will not need to do any 1404 // can match, so we can early out since we will not need to do any
1404 // invalidation. 1405 // invalidation.
1405 if (oldBounds == newBounds) 1406 if (oldBounds == newBounds)
1406 return PaintInvalidationNone; 1407 return PaintInvalidationNone;
1407 1408
1408 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could 1409 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
1409 // be caused by some layout property (left / top) or some in-flow layoutObje ct inserted / removed before us in the tree. 1410 // be caused by some layout property (left / top) or some in-flow layoutObje ct inserted / removed before us in the tree.
1410 if (newBounds.location() != oldBounds.location()) 1411 if (newBounds.location() != oldBounds.location())
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
3366 const blink::LayoutObject* root = object1; 3367 const blink::LayoutObject* root = object1;
3367 while (root->parent()) 3368 while (root->parent())
3368 root = root->parent(); 3369 root = root->parent();
3369 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3370 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3370 } else { 3371 } else {
3371 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3372 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3372 } 3373 }
3373 } 3374 }
3374 3375
3375 #endif 3376 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698