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

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

Issue 1224933002: Combine outline and focus ring code paths (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 3 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 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 { 1396 {
1397 // First check for InvalidationLocationChange to avoid it from being hidden by other 1397 // First check for InvalidationLocationChange to avoid it from being hidden by other
1398 // invalidation reasons because we'll need to force check for paint invalida tion for 1398 // invalidation reasons because we'll need to force check for paint invalida tion for
1399 // children when location of this object changed. 1399 // children when location of this object changed.
1400 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat ionBacking) 1400 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat ionBacking)
1401 return PaintInvalidationLocationChange; 1401 return PaintInvalidationLocationChange;
1402 1402
1403 if (shouldDoFullPaintInvalidation()) 1403 if (shouldDoFullPaintInvalidation())
1404 return m_bitfields.fullPaintInvalidationReason(); 1404 return m_bitfields.fullPaintInvalidationReason();
1405 1405
1406 // The focus ring may change because of position change of descendants. For simplicity, 1406 // The outline may change shape because of position change of descendants. F or simplicity,
1407 // just force full paint invalidation if this object is marked for checking paint invalidation 1407 // just force full paint invalidation if this object is marked for checking paint invalidation
1408 // for any reason. 1408 // for any reason.
1409 // TODO(wangxianzhu): extend this to all outlines. 1409 if (styleRef().hasOutline())
1410 if (styleRef().outlineStyleIsAuto())
1411 return PaintInvalidationOutline; 1410 return PaintInvalidationOutline;
1412 1411
1413 // If the bounds are the same then we know that none of the statements below 1412 // If the bounds are the same then we know that none of the statements below
1414 // can match, so we can early out since we will not need to do any 1413 // can match, so we can early out since we will not need to do any
1415 // invalidation. 1414 // invalidation.
1416 if (oldBounds == newBounds) 1415 if (oldBounds == newBounds)
1417 return PaintInvalidationNone; 1416 return PaintInvalidationNone;
1418 1417
1419 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could 1418 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
1420 // be caused by some layout property (left / top) or some in-flow layoutObje ct inserted / removed before us in the tree. 1419 // be caused by some layout property (left / top) or some in-flow layoutObje ct inserted / removed before us in the tree.
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after
3401 const blink::LayoutObject* root = object1; 3400 const blink::LayoutObject* root = object1;
3402 while (root->parent()) 3401 while (root->parent())
3403 root = root->parent(); 3402 root = root->parent();
3404 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3403 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3405 } else { 3404 } else {
3406 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3405 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3407 } 3406 }
3408 } 3407 }
3409 3408
3410 #endif 3409 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698