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

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

Issue 1363913004: [Reland] Invalidate whitespace text on text color changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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. 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 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 diff.setNeedsPaintInvalidationLayer(); 1715 diff.setNeedsPaintInvalidationLayer();
1716 } 1716 }
1717 1717
1718 // If backdrop filter changed, and the layer does not paint into its own sep arate backing or it paints with filters, then we need to invalidate paints. 1718 // If backdrop filter changed, and the layer does not paint into its own sep arate backing or it paints with filters, then we need to invalidate paints.
1719 if (diff.backdropFilterChanged() && hasLayer()) { 1719 if (diff.backdropFilterChanged() && hasLayer()) {
1720 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(this)->layer(); 1720 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(this)->layer();
1721 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint sWithBackdropFilters()) 1721 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint sWithBackdropFilters())
1722 diff.setNeedsPaintInvalidationLayer(); 1722 diff.setNeedsPaintInvalidationLayer();
1723 } 1723 }
1724 1724
1725 if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()) { 1725 // Optimization: for decoration/color property changes, invalidation is only needed if we have style or text affected by these properties.
1726 if (diff.textDecorationOrColorChanged() && !diff.needsPaintInvalidation()) {
1726 if (style()->hasBorder() || style()->hasOutline() 1727 if (style()->hasBorder() || style()->hasOutline()
1727 || style()->isBackgroundColorCurrentColor() 1728 || style()->isBackgroundColorCurrentColor()
1728 || (isText() && !toLayoutText(this)->isAllCollapsibleWhitespace())) 1729 // Skip any text nodes that do not contain text boxes. Whitespace ca nnot be
1730 // skipped or we will miss invalidating decorations (e.g., underline s).
1731 || (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()))
1729 diff.setNeedsPaintInvalidationObject(); 1732 diff.setNeedsPaintInvalidationObject();
1730 } 1733 }
1731 1734
1732 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch ange without the actual 1735 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch ange without the actual
1733 // style changing, since it depends on whether we decide to composite these elements. When the 1736 // style changing, since it depends on whether we decide to composite these elements. When the
1734 // layer status of one of these elements changes, we need to force a layout. 1737 // layer status of one of these elements changes, we need to force a layout.
1735 if (!diff.needsFullLayout() && style() && isBoxModelObject()) { 1738 if (!diff.needsFullLayout() && style() && isBoxModelObject()) {
1736 bool requiresLayer = toLayoutBoxModelObject(this)->layerTypeRequired() ! = NoDeprecatedPaintLayer; 1739 bool requiresLayer = toLayoutBoxModelObject(this)->layerTypeRequired() ! = NoDeprecatedPaintLayer;
1737 if (hasLayer() != requiresLayer) 1740 if (hasLayer() != requiresLayer)
1738 diff.setNeedsFullLayout(); 1741 diff.setNeedsFullLayout();
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
3391 const blink::LayoutObject* root = object1; 3394 const blink::LayoutObject* root = object1;
3392 while (root->parent()) 3395 while (root->parent())
3393 root = root->parent(); 3396 root = root->parent();
3394 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3397 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3395 } else { 3398 } else {
3396 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3399 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3397 } 3400 }
3398 } 3401 }
3399 3402
3400 #endif 3403 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698