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

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

Issue 2622043003: Replaced RefPtr::release with std::move in Source/core. (Closed)
Patch Set: Created 3 years, 11 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 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 // Images are special and must inherit the pseudoStyle so the width and height 1575 // Images are special and must inherit the pseudoStyle so the width and height
1576 // of the pseudo element doesn't change the size of the image. In all other 1576 // of the pseudo element doesn't change the size of the image. In all other
1577 // cases we can just share the style. 1577 // cases we can just share the style.
1578 // 1578 //
1579 // Quotes are also LayoutInline, so we need to create an inherited style to 1579 // Quotes are also LayoutInline, so we need to create an inherited style to
1580 // avoid getting an inline with positioning or an invalid display. 1580 // avoid getting an inline with positioning or an invalid display.
1581 // 1581 //
1582 if (isImage() || isQuote()) { 1582 if (isImage() || isQuote()) {
1583 RefPtr<ComputedStyle> style = ComputedStyle::create(); 1583 RefPtr<ComputedStyle> style = ComputedStyle::create();
1584 style->inheritFrom(*pseudoStyle); 1584 style->inheritFrom(*pseudoStyle);
1585 setStyle(style.release()); 1585 setStyle(std::move(style));
1586 return; 1586 return;
1587 } 1587 }
1588 1588
1589 setStyle(std::move(pseudoStyle)); 1589 setStyle(std::move(pseudoStyle));
1590 } 1590 }
1591 1591
1592 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, 1592 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle,
1593 const ComputedStyle& newStyle) { 1593 const ComputedStyle& newStyle) {
1594 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle); 1594 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle);
1595 1595
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 } 1654 }
1655 1655
1656 StyleDifference diff; 1656 StyleDifference diff;
1657 if (m_style) 1657 if (m_style)
1658 diff = m_style->visualInvalidationDiff(*style); 1658 diff = m_style->visualInvalidationDiff(*style);
1659 1659
1660 diff = adjustStyleDifference(diff); 1660 diff = adjustStyleDifference(diff);
1661 1661
1662 styleWillChange(diff, *style); 1662 styleWillChange(diff, *style);
1663 1663
1664 RefPtr<ComputedStyle> oldStyle = m_style.release(); 1664 RefPtr<ComputedStyle> oldStyle = std::move(m_style);
1665 setStyleInternal(std::move(style)); 1665 setStyleInternal(std::move(style));
1666 1666
1667 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, 1667 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0,
1668 m_style->backgroundLayers()); 1668 m_style->backgroundLayers());
1669 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, 1669 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0,
1670 m_style->maskLayers()); 1670 m_style->maskLayers());
1671 1671
1672 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, 1672 updateImage(oldStyle ? oldStyle->borderImage().image() : 0,
1673 m_style->borderImage().image()); 1673 m_style->borderImage().image());
1674 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, 1674 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0,
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 1948
1949 // Preserve the position style of anonymous block continuations as they can 1949 // Preserve the position style of anonymous block continuations as they can
1950 // have relative position when they contain block descendants of relative 1950 // have relative position when they contain block descendants of relative
1951 // positioned inlines. 1951 // positioned inlines.
1952 if (child->isInFlowPositioned() && child->isLayoutBlockFlow() && 1952 if (child->isInFlowPositioned() && child->isLayoutBlockFlow() &&
1953 toLayoutBlockFlow(child)->isAnonymousBlockContinuation()) 1953 toLayoutBlockFlow(child)->isAnonymousBlockContinuation())
1954 newStyle->setPosition(child->style()->position()); 1954 newStyle->setPosition(child->style()->position());
1955 1955
1956 updateAnonymousChildStyle(*child, *newStyle); 1956 updateAnonymousChildStyle(*child, *newStyle);
1957 1957
1958 child->setStyle(newStyle.release()); 1958 child->setStyle(std::move(newStyle));
1959 } 1959 }
1960 } 1960 }
1961 1961
1962 void LayoutObject::setStyleWithWritingModeOf(PassRefPtr<ComputedStyle> style, 1962 void LayoutObject::setStyleWithWritingModeOf(PassRefPtr<ComputedStyle> style,
1963 LayoutObject* parent) { 1963 LayoutObject* parent) {
1964 if (parent) 1964 if (parent)
1965 style->setWritingMode(parent->styleRef().getWritingMode()); 1965 style->setWritingMode(parent->styleRef().getWritingMode());
1966 setStyle(std::move(style)); 1966 setStyle(std::move(style));
1967 } 1967 }
1968 1968
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
3537 const blink::LayoutObject* root = object1; 3537 const blink::LayoutObject* root = object1;
3538 while (root->parent()) 3538 while (root->parent())
3539 root = root->parent(); 3539 root = root->parent();
3540 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3540 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3541 } else { 3541 } else {
3542 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3542 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3543 } 3543 }
3544 } 3544 }
3545 3545
3546 #endif 3546 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698