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

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

Issue 2727843004: needsPaintInvalidation() should not return true for selection. (Closed)
Patch Set: Renaming. 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
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 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 } 1501 }
1502 } 1502 }
1503 1503
1504 // TODO(wangxianzhu): We may avoid subtree paint invalidation on CSS clip 1504 // TODO(wangxianzhu): We may avoid subtree paint invalidation on CSS clip
1505 // change for SPv2. 1505 // change for SPv2.
1506 if (diff.cssClipChanged()) 1506 if (diff.cssClipChanged())
1507 diff.setNeedsPaintInvalidationSubtree(); 1507 diff.setNeedsPaintInvalidationSubtree();
1508 1508
1509 // Optimization: for decoration/color property changes, invalidation is only 1509 // Optimization: for decoration/color property changes, invalidation is only
1510 // needed if we have style or text affected by these properties. 1510 // needed if we have style or text affected by these properties.
1511 if (diff.textDecorationOrColorChanged() && !diff.needsPaintInvalidation()) { 1511 if (diff.textDecorationOrColorChanged() &&
1512 !diff.needsFullPaintInvalidation()) {
1512 if (style()->hasBorder() || style()->hasOutline() || 1513 if (style()->hasBorder() || style()->hasOutline() ||
1513 style()->hasBackgroundRelatedColorReferencingCurrentColor() || 1514 style()->hasBackgroundRelatedColorReferencingCurrentColor() ||
1514 // Skip any text nodes that do not contain text boxes. Whitespace cannot 1515 // Skip any text nodes that do not contain text boxes. Whitespace cannot
1515 // be skipped or we will miss invalidating decorations (e.g., 1516 // be skipped or we will miss invalidating decorations (e.g.,
1516 // underlines). 1517 // underlines).
1517 (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()) || 1518 (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()) ||
1518 (isSVG() && style()->svgStyle().isFillColorCurrentColor()) || 1519 (isSVG() && style()->svgStyle().isFillColorCurrentColor()) ||
1519 (isSVG() && style()->svgStyle().isStrokeColorCurrentColor()) || 1520 (isSVG() && style()->svgStyle().isStrokeColorCurrentColor()) ||
1520 isListMarker()) 1521 isListMarker())
1521 diff.setNeedsPaintInvalidationObject(); 1522 diff.setNeedsPaintInvalidationObject();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 return; 1558 return;
1558 } 1559 }
1559 1560
1560 setStyle(std::move(pseudoStyle)); 1561 setStyle(std::move(pseudoStyle));
1561 } 1562 }
1562 1563
1563 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, 1564 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle,
1564 const ComputedStyle& newStyle) { 1565 const ComputedStyle& newStyle) {
1565 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle); 1566 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle);
1566 1567
1567 if (diff.needsPaintInvalidation() || diff.textDecorationOrColorChanged()) { 1568 if (diff.needsFullPaintInvalidation() ||
1569 diff.textDecorationOrColorChanged()) {
1568 // We need to invalidate all inline boxes in the first line, because they 1570 // We need to invalidate all inline boxes in the first line, because they
1569 // need to be repainted with the new style, e.g. background, font style, 1571 // need to be repainted with the new style, e.g. background, font style,
1570 // etc. 1572 // etc.
1571 LayoutBlockFlow* firstLineContainer = nullptr; 1573 LayoutBlockFlow* firstLineContainer = nullptr;
1572 if (behavesLikeBlockContainer()) { 1574 if (behavesLikeBlockContainer()) {
1573 // This object is a LayoutBlock having PseudoIdFirstLine pseudo style 1575 // This object is a LayoutBlock having PseudoIdFirstLine pseudo style
1574 // changed. 1576 // changed.
1575 firstLineContainer = 1577 firstLineContainer =
1576 toLayoutBlock(this)->nearestInnerBlockWithFirstLine(); 1578 toLayoutBlock(this)->nearestInnerBlockWithFirstLine();
1577 } else if (isLayoutInline()) { 1579 } else if (isLayoutInline()) {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1896 if (oldStyle && !areCursorsEqual(oldStyle, style())) { 1898 if (oldStyle && !areCursorsEqual(oldStyle, style())) {
1897 if (LocalFrame* frame = this->frame()) { 1899 if (LocalFrame* frame = this->frame()) {
1898 // Cursor update scheduling is done by the local root, which is the main 1900 // Cursor update scheduling is done by the local root, which is the main
1899 // frame if there are no RemoteFrame ancestors in the frame tree. Use of 1901 // frame if there are no RemoteFrame ancestors in the frame tree. Use of
1900 // localFrameRoot() is discouraged but will change when cursor update 1902 // localFrameRoot() is discouraged but will change when cursor update
1901 // scheduling is moved from EventHandler to PageEventHandler. 1903 // scheduling is moved from EventHandler to PageEventHandler.
1902 frame->localFrameRoot()->eventHandler().scheduleCursorUpdate(); 1904 frame->localFrameRoot()->eventHandler().scheduleCursorUpdate();
1903 } 1905 }
1904 } 1906 }
1905 1907
1906 if (diff.needsPaintInvalidation() && oldStyle) { 1908 if (diff.needsFullPaintInvalidation() && oldStyle) {
1907 if (resolveColor(*oldStyle, CSSPropertyBackgroundColor) != 1909 if (resolveColor(*oldStyle, CSSPropertyBackgroundColor) !=
1908 resolveColor(CSSPropertyBackgroundColor) || 1910 resolveColor(CSSPropertyBackgroundColor) ||
1909 oldStyle->backgroundLayers() != styleRef().backgroundLayers()) 1911 oldStyle->backgroundLayers() != styleRef().backgroundLayers())
1910 setBackgroundChangedSinceLastPaintInvalidation(); 1912 setBackgroundChangedSinceLastPaintInvalidation();
1911 } 1913 }
1912 } 1914 }
1913 1915
1914 void LayoutObject::propagateStyleToAnonymousChildren() { 1916 void LayoutObject::propagateStyleToAnonymousChildren() {
1915 // FIXME: We could save this call when the change only affected non-inherited 1917 // FIXME: We could save this call when the change only affected non-inherited
1916 // properties. 1918 // properties.
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after
3529 const blink::LayoutObject* root = object1; 3531 const blink::LayoutObject* root = object1;
3530 while (root->parent()) 3532 while (root->parent())
3531 root = root->parent(); 3533 root = root->parent();
3532 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3534 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3533 } else { 3535 } else {
3534 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3536 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3535 } 3537 }
3536 } 3538 }
3537 3539
3538 #endif 3540 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698