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

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

Issue 2598923002: Update transform paint property's transform-offset on element size changes (Closed)
Patch Set: Only create transform-origin when needed Created 3 years, 12 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/paint/PaintPropertyTreeBuilder.cpp » ('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) 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 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 void LayoutBox::frameRectChanged() { 1696 void LayoutBox::frameRectChanged() {
1697 if (node() && node()->isElementNode()) { 1697 if (node() && node()->isElementNode()) {
1698 Element& element = toElement(*node()); 1698 Element& element = toElement(*node());
1699 element.setNeedsResizeObserverUpdate(); 1699 element.setNeedsResizeObserverUpdate();
1700 } 1700 }
1701 // The frame rect may change because of layout of other objects. 1701 // The frame rect may change because of layout of other objects.
1702 // Should check this object for paint invalidation. 1702 // Should check this object for paint invalidation.
1703 if (!needsLayout()) 1703 if (!needsLayout())
1704 setMayNeedPaintInvalidation(); 1704 setMayNeedPaintInvalidation();
1705 1705
1706 // The overflow clip paint property depends on the border box rect through 1706 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
1707 // overflowClipRect(). The border box rect's size equals the frame rect's 1707 if (shouldClipOverflow()) {
1708 // size, so we trigger a paint property update when the framerect changes. 1708 // The overflow clip paint property depends on the border box rect through
1709 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && 1709 // overflowClipRect(). The border box rect's size equals the frame rect's
1710 shouldClipOverflow()) 1710 // size so we trigger a paint property update when the frame rect changes.
1711 setNeedsPaintPropertyUpdate(); 1711 setNeedsPaintPropertyUpdate();
1712 } else if (styleRef().hasTransform()) {
1713 // The transform paint property's origin depends on the frame rect because
1714 // transform-origin can be sized with lengths relative to the frame rect.
1715 // See: PaintPropertyTreeBuilder::updateTransform(...).
Xianzhu 2016/12/22 17:28:41 Just thought of 1. perspective-origin has the same
1716 setNeedsPaintPropertyUpdate();
1717 }
1718 }
1712 } 1719 }
1713 1720
1714 bool LayoutBox::intersectsVisibleViewport() const { 1721 bool LayoutBox::intersectsVisibleViewport() const {
1715 LayoutRect rect = visualOverflowRect(); 1722 LayoutRect rect = visualOverflowRect();
1716 LayoutView* layoutView = view(); 1723 LayoutView* layoutView = view();
1717 while (!layoutView->frame()->ownerLayoutItem().isNull()) 1724 while (!layoutView->frame()->ownerLayoutItem().isNull())
1718 layoutView = 1725 layoutView =
1719 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem()) 1726 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem())
1720 ->view(); 1727 ->view();
1721 mapToVisualRectInAncestorSpace(layoutView, rect); 1728 mapToVisualRectInAncestorSpace(layoutView, rect);
(...skipping 3947 matching lines...) Expand 10 before | Expand all | Expand 10 after
5669 block->adjustChildDebugRect(rect); 5676 block->adjustChildDebugRect(rect);
5670 5677
5671 return rect; 5678 return rect;
5672 } 5679 }
5673 5680
5674 bool LayoutBox::shouldClipOverflow() const { 5681 bool LayoutBox::shouldClipOverflow() const {
5675 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); 5682 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip();
5676 } 5683 }
5677 5684
5678 } // namespace blink 5685 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698