| 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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 // children when location of this object changed. | 1390 // children when location of this object changed. |
| 1391 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat
ionBacking) | 1391 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat
ionBacking) |
| 1392 return PaintInvalidationLocationChange; | 1392 return PaintInvalidationLocationChange; |
| 1393 | 1393 |
| 1394 if (shouldDoFullPaintInvalidation()) | 1394 if (shouldDoFullPaintInvalidation()) |
| 1395 return m_bitfields.fullPaintInvalidationReason(); | 1395 return m_bitfields.fullPaintInvalidationReason(); |
| 1396 | 1396 |
| 1397 // The focus ring may change because of position change of descendants. For
simplicity, | 1397 // The focus ring may change because of position change of descendants. For
simplicity, |
| 1398 // just force full paint invalidation if this object is marked for checking
paint invalidation | 1398 // just force full paint invalidation if this object is marked for checking
paint invalidation |
| 1399 // for any reason. | 1399 // for any reason. |
| 1400 // TODO(wangxianzhu): extend this to all outlines. |
| 1400 if (styleRef().outlineStyleIsAuto()) | 1401 if (styleRef().outlineStyleIsAuto()) |
| 1401 return PaintInvalidationFocusRing; | 1402 return PaintInvalidationOutline; |
| 1402 | 1403 |
| 1403 // If the bounds are the same then we know that none of the statements below | 1404 // If the bounds are the same then we know that none of the statements below |
| 1404 // can match, so we can early out since we will not need to do any | 1405 // can match, so we can early out since we will not need to do any |
| 1405 // invalidation. | 1406 // invalidation. |
| 1406 if (oldBounds == newBounds) | 1407 if (oldBounds == newBounds) |
| 1407 return PaintInvalidationNone; | 1408 return PaintInvalidationNone; |
| 1408 | 1409 |
| 1409 // If we shifted, we don't know the exact reason so we are conservative and
trigger a full invalidation. Shifting could | 1410 // If we shifted, we don't know the exact reason so we are conservative and
trigger a full invalidation. Shifting could |
| 1410 // be caused by some layout property (left / top) or some in-flow layoutObje
ct inserted / removed before us in the tree. | 1411 // be caused by some layout property (left / top) or some in-flow layoutObje
ct inserted / removed before us in the tree. |
| 1411 if (newBounds.location() != oldBounds.location()) | 1412 if (newBounds.location() != oldBounds.location()) |
| (...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3367 const blink::LayoutObject* root = object1; | 3368 const blink::LayoutObject* root = object1; |
| 3368 while (root->parent()) | 3369 while (root->parent()) |
| 3369 root = root->parent(); | 3370 root = root->parent(); |
| 3370 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3371 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3371 } else { | 3372 } else { |
| 3372 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3373 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3373 } | 3374 } |
| 3374 } | 3375 } |
| 3375 | 3376 |
| 3376 #endif | 3377 #endif |
| OLD | NEW |