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

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

Issue 2732113002: Move ::selection invalidation to applyPseudoStyleChanges. (Closed)
Patch Set: Rebased Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 else 1726 else
1727 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); 1727 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange);
1728 } 1728 }
1729 1729
1730 if (diff.needsPaintInvalidationSubtree() || 1730 if (diff.needsPaintInvalidationSubtree() ||
1731 updatedDiff.needsPaintInvalidationSubtree()) 1731 updatedDiff.needsPaintInvalidationSubtree())
1732 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); 1732 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
1733 else if (diff.needsPaintInvalidationObject() || 1733 else if (diff.needsPaintInvalidationObject() ||
1734 updatedDiff.needsPaintInvalidationObject()) 1734 updatedDiff.needsPaintInvalidationObject())
1735 setShouldDoFullPaintInvalidation(); 1735 setShouldDoFullPaintInvalidation();
1736 else if (diff.needsPaintInvalidationSelection())
1737 invalidatePaintForSelection();
1738 1736
1739 // Text nodes share style with their parents but the paint properties don't 1737 // Text nodes share style with their parents but the paint properties don't
1740 // apply to them, hence the !isText() check. 1738 // apply to them, hence the !isText() check.
1741 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() && 1739 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() &&
1742 (diff.transformChanged() || diff.opacityChanged() || 1740 (diff.transformChanged() || diff.opacityChanged() ||
1743 diff.zIndexChanged() || diff.filterChanged() || 1741 diff.zIndexChanged() || diff.filterChanged() ||
1744 diff.backdropFilterChanged() || diff.cssClipChanged())) { 1742 diff.backdropFilterChanged() || diff.cssClipChanged())) {
1745 setNeedsPaintPropertyUpdate(); 1743 setNeedsPaintPropertyUpdate();
1746 1744
1747 // We don't need to invalidate paint of objects on SPv2 when only paint 1745 // We don't need to invalidate paint of objects on SPv2 when only paint
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 1931
1934 if (oldStyle && oldStyle->styleType() == PseudoIdNone) 1932 if (oldStyle && oldStyle->styleType() == PseudoIdNone)
1935 applyPseudoStyleChanges(*oldStyle); 1933 applyPseudoStyleChanges(*oldStyle);
1936 } 1934 }
1937 1935
1938 void LayoutObject::applyPseudoStyleChanges(const ComputedStyle& oldStyle) { 1936 void LayoutObject::applyPseudoStyleChanges(const ComputedStyle& oldStyle) {
1939 if (oldStyle.hasPseudoStyle(PseudoIdFirstLine) || 1937 if (oldStyle.hasPseudoStyle(PseudoIdFirstLine) ||
1940 styleRef().hasPseudoStyle(PseudoIdFirstLine)) 1938 styleRef().hasPseudoStyle(PseudoIdFirstLine))
1941 applyFirstLineChanges(oldStyle); 1939 applyFirstLineChanges(oldStyle);
1942 1940
1943 // TODO(rune@opera.com): Move the invalidation for ::selection here. 1941 if (oldStyle.hasPseudoStyle(PseudoIdSelection) ||
1944 // Instead of having a PaintInvalidationSelectionOnly PaintInvalidationType 1942 styleRef().hasPseudoStyle(PseudoIdSelection))
1945 // used for the element diff, we should use PaintInvalidationObject diff on 1943 invalidatePaintForSelection();
1946 // the pseudo element style here instead.
1947 } 1944 }
1948 1945
1949 void LayoutObject::applyFirstLineChanges(const ComputedStyle& oldStyle) { 1946 void LayoutObject::applyFirstLineChanges(const ComputedStyle& oldStyle) {
1950 if (oldStyle.hasPseudoStyle(PseudoIdFirstLine)) { 1947 if (oldStyle.hasPseudoStyle(PseudoIdFirstLine)) {
1951 RefPtr<ComputedStyle> oldPseudoStyle = 1948 RefPtr<ComputedStyle> oldPseudoStyle =
1952 oldStyle.getCachedPseudoStyle(PseudoIdFirstLine); 1949 oldStyle.getCachedPseudoStyle(PseudoIdFirstLine);
1953 if (styleRef().hasPseudoStyle(PseudoIdFirstLine) && oldPseudoStyle) { 1950 if (styleRef().hasPseudoStyle(PseudoIdFirstLine) && oldPseudoStyle) {
1954 RefPtr<ComputedStyle> newPseudoStyle = 1951 RefPtr<ComputedStyle> newPseudoStyle =
1955 uncachedFirstLineStyle(mutableStyle()); 1952 uncachedFirstLineStyle(mutableStyle());
1956 if (newPseudoStyle) { 1953 if (newPseudoStyle) {
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after
3599 const blink::LayoutObject* root = object1; 3596 const blink::LayoutObject* root = object1;
3600 while (root->parent()) 3597 while (root->parent())
3601 root = root->parent(); 3598 root = root->parent();
3602 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3599 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3603 } else { 3600 } else {
3604 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3601 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3605 } 3602 }
3606 } 3603 }
3607 3604
3608 #endif 3605 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698