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

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

Issue 2573963002: [SPInvalidation] Update paint properties when border radii change (Closed)
Patch Set: Rebase Created 4 years 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle); 316 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle);
317 317
318 updateBackgroundAttachmentFixedStatusAfterStyleChange(); 318 updateBackgroundAttachmentFixedStatusAfterStyleChange();
319 319
320 if (oldStyle) { 320 if (oldStyle) {
321 LayoutFlowThread* flowThread = flowThreadContainingBlock(); 321 LayoutFlowThread* flowThread = flowThreadContainingBlock();
322 if (flowThread && flowThread != this) 322 if (flowThread && flowThread != this)
323 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle); 323 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle);
324 324
325 updateScrollSnapMappingAfterStyleChange(&newStyle, oldStyle); 325 updateScrollSnapMappingAfterStyleChange(&newStyle, oldStyle);
326 }
327 326
328 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 327 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() &&
329 if (hasOverflowClip() || styleRef().containsPaint() || hasControlClip()) { 328 shouldClipOverflow()) {
330 // The overflow clip paint property depends on border sizes through 329 // The overflow clip paint property depends on border sizes through
331 // overflowClipRect() so we update properties on border size changes. 330 // overflowClipRect(), and border radii, so we update properties on
332 if (oldStyle && !oldStyle->border().sizeEquals(newStyle.border())) 331 // border size or radii change.
332 if (!oldStyle->border().sizeEquals(newStyle.border()) ||
333 !oldStyle->border().radiiEqual(newStyle.border()))
333 setNeedsPaintPropertyUpdate(); 334 setNeedsPaintPropertyUpdate();
334 } 335 }
335 } 336 }
336 337
337 // Non-atomic inlines should be LayoutInline or LayoutText, not LayoutBox. 338 // Non-atomic inlines should be LayoutInline or LayoutText, not LayoutBox.
338 DCHECK(!isInline() || isAtomicInlineLevel()); 339 DCHECK(!isInline() || isAtomicInlineLevel());
339 } 340 }
340 341
341 void LayoutBox::updateBackgroundAttachmentFixedStatusAfterStyleChange() { 342 void LayoutBox::updateBackgroundAttachmentFixedStatusAfterStyleChange() {
342 if (!frameView()) 343 if (!frameView())
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 void LayoutBox::frameRectChanged() { 1696 void LayoutBox::frameRectChanged() {
1696 if (node() && node()->isElementNode()) { 1697 if (node() && node()->isElementNode()) {
1697 Element& element = toElement(*node()); 1698 Element& element = toElement(*node());
1698 element.setNeedsResizeObserverUpdate(); 1699 element.setNeedsResizeObserverUpdate();
1699 } 1700 }
1700 // The frame rect may change because of layout of other objects. 1701 // The frame rect may change because of layout of other objects.
1701 // Should check this object for paint invalidation. 1702 // Should check this object for paint invalidation.
1702 if (!needsLayout()) 1703 if (!needsLayout())
1703 setMayNeedPaintInvalidation(); 1704 setMayNeedPaintInvalidation();
1704 1705
1705 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 1706 // The overflow clip paint property depends on the border box rect through
1706 // The overflow clip paint property depends on the border box rect through 1707 // overflowClipRect(). The border box rect's size equals the frame rect's
1707 // overflowClipRect(). The border box rect's size equals the frame rect's 1708 // size, so we trigger a paint property update when the framerect changes.
1708 // size, so we trigger a paint property update when the framerect changes. 1709 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() &&
1709 if (hasOverflowClip() || styleRef().containsPaint() || hasControlClip()) 1710 shouldClipOverflow())
1710 setNeedsPaintPropertyUpdate(); 1711 setNeedsPaintPropertyUpdate();
1711 }
1712 } 1712 }
1713 1713
1714 bool LayoutBox::intersectsVisibleViewport() const { 1714 bool LayoutBox::intersectsVisibleViewport() const {
1715 LayoutRect rect = visualOverflowRect(); 1715 LayoutRect rect = visualOverflowRect();
1716 LayoutView* layoutView = view(); 1716 LayoutView* layoutView = view();
1717 while (!layoutView->frame()->ownerLayoutItem().isNull()) 1717 while (!layoutView->frame()->ownerLayoutItem().isNull())
1718 layoutView = 1718 layoutView =
1719 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem()) 1719 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem())
1720 ->view(); 1720 ->view();
1721 mapToVisualRectInAncestorSpace(layoutView, rect); 1721 mapToVisualRectInAncestorSpace(layoutView, rect);
(...skipping 3940 matching lines...) Expand 10 before | Expand all | Expand 10 after
5662 LayoutRect LayoutBox::debugRect() const { 5662 LayoutRect LayoutBox::debugRect() const {
5663 LayoutRect rect = frameRect(); 5663 LayoutRect rect = frameRect();
5664 5664
5665 LayoutBlock* block = containingBlock(); 5665 LayoutBlock* block = containingBlock();
5666 if (block) 5666 if (block)
5667 block->adjustChildDebugRect(rect); 5667 block->adjustChildDebugRect(rect);
5668 5668
5669 return rect; 5669 return rect;
5670 } 5670 }
5671 5671
5672 bool LayoutBox::shouldClipOverflow() const {
5673 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip();
5674 }
5675
5672 } // namespace blink 5676 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698