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

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

Issue 2282413002: Replaced PassRefPtr copies with moves in Source/core. (Closed)
Patch Set: rebased Created 4 years, 3 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. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
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 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 // Quotes are also LayoutInline, so we need to create an inherited style to avoid 1490 // Quotes are also LayoutInline, so we need to create an inherited style to avoid
1491 // getting an inline with positioning or an invalid display. 1491 // getting an inline with positioning or an invalid display.
1492 // 1492 //
1493 if (isImage() || isQuote()) { 1493 if (isImage() || isQuote()) {
1494 RefPtr<ComputedStyle> style = ComputedStyle::create(); 1494 RefPtr<ComputedStyle> style = ComputedStyle::create();
1495 style->inheritFrom(*pseudoStyle); 1495 style->inheritFrom(*pseudoStyle);
1496 setStyle(style.release()); 1496 setStyle(style.release());
1497 return; 1497 return;
1498 } 1498 }
1499 1499
1500 setStyle(pseudoStyle); 1500 setStyle(std::move(pseudoStyle));
1501 } 1501 }
1502 1502
1503 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const ComputedStyle& newStyle) 1503 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const ComputedStyle& newStyle)
1504 { 1504 {
1505 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle); 1505 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle);
1506 1506
1507 if (diff.needsPaintInvalidation() || diff.textDecorationOrColorChanged()) { 1507 if (diff.needsPaintInvalidation() || diff.textDecorationOrColorChanged()) {
1508 // We need to invalidate all inline boxes in the first line, because the y need to be 1508 // We need to invalidate all inline boxes in the first line, because the y need to be
1509 // repainted with the new style, e.g. background, font style, etc. 1509 // repainted with the new style, e.g. background, font style, etc.
1510 LayoutBlockFlow* firstLineContainer = nullptr; 1510 LayoutBlockFlow* firstLineContainer = nullptr;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 1560
1561 StyleDifference diff; 1561 StyleDifference diff;
1562 if (m_style) 1562 if (m_style)
1563 diff = m_style->visualInvalidationDiff(*style); 1563 diff = m_style->visualInvalidationDiff(*style);
1564 1564
1565 diff = adjustStyleDifference(diff); 1565 diff = adjustStyleDifference(diff);
1566 1566
1567 styleWillChange(diff, *style); 1567 styleWillChange(diff, *style);
1568 1568
1569 RefPtr<ComputedStyle> oldStyle = m_style.release(); 1569 RefPtr<ComputedStyle> oldStyle = m_style.release();
1570 setStyleInternal(style); 1570 setStyleInternal(std::move(style));
1571 1571
1572 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back groundLayers()); 1572 updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, m_style->back groundLayers());
1573 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers ()); 1573 updateFillImages(oldStyle ? &oldStyle->maskLayers() : 0, m_style->maskLayers ());
1574 1574
1575 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI mage().image()); 1575 updateImage(oldStyle ? oldStyle->borderImage().image() : 0, m_style->borderI mage().image());
1576 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo xImage().image()); 1576 updateImage(oldStyle ? oldStyle->maskBoxImage().image() : 0, m_style->maskBo xImage().image());
1577 1577
1578 StyleImage* newContentImage = m_style->contentData() && m_style->contentData ()->isImage() ? 1578 StyleImage* newContentImage = m_style->contentData() && m_style->contentData ()->isImage() ?
1579 toImageContentData(m_style->contentData())->image() : nullptr; 1579 toImageContentData(m_style->contentData())->image() : nullptr;
1580 StyleImage* oldContentImage = oldStyle && oldStyle->contentData() && oldStyl e->contentData()->isImage() ? 1580 StyleImage* oldContentImage = oldStyle && oldStyle->contentData() && oldStyl e->contentData()->isImage() ?
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 updateAnonymousChildStyle(*child, *newStyle); 1777 updateAnonymousChildStyle(*child, *newStyle);
1778 1778
1779 child->setStyle(newStyle.release()); 1779 child->setStyle(newStyle.release());
1780 } 1780 }
1781 } 1781 }
1782 1782
1783 void LayoutObject::setStyleWithWritingModeOf(PassRefPtr<ComputedStyle> style, La youtObject* parent) 1783 void LayoutObject::setStyleWithWritingModeOf(PassRefPtr<ComputedStyle> style, La youtObject* parent)
1784 { 1784 {
1785 if (parent) 1785 if (parent)
1786 style->setWritingMode(parent->styleRef().getWritingMode()); 1786 style->setWritingMode(parent->styleRef().getWritingMode());
1787 setStyle(style); 1787 setStyle(std::move(style));
1788 } 1788 }
1789 1789
1790 void LayoutObject::setStyleWithWritingModeOfParent(PassRefPtr<ComputedStyle> sty le) 1790 void LayoutObject::setStyleWithWritingModeOfParent(PassRefPtr<ComputedStyle> sty le)
1791 { 1791 {
1792 setStyleWithWritingModeOf(style, parent()); 1792 setStyleWithWritingModeOf(std::move(style), parent());
1793 } 1793 }
1794 1794
1795 void LayoutObject::addChildWithWritingModeOfParent(LayoutObject* newChild, Layou tObject* beforeChild) 1795 void LayoutObject::addChildWithWritingModeOfParent(LayoutObject* newChild, Layou tObject* beforeChild)
1796 { 1796 {
1797 if (newChild->mutableStyleRef().setWritingMode(styleRef().getWritingMode()) 1797 if (newChild->mutableStyleRef().setWritingMode(styleRef().getWritingMode())
1798 && newChild->isBoxModelObject()) { 1798 && newChild->isBoxModelObject()) {
1799 newChild->setHorizontalWritingMode(isHorizontalWritingMode()); 1799 newChild->setHorizontalWritingMode(isHorizontalWritingMode());
1800 } 1800 }
1801 addChild(newChild, beforeChild); 1801 addChild(newChild, beforeChild);
1802 } 1802 }
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
3233 const blink::LayoutObject* root = object1; 3233 const blink::LayoutObject* root = object1;
3234 while (root->parent()) 3234 while (root->parent())
3235 root = root->parent(); 3235 root = root->parent();
3236 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3236 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3237 } else { 3237 } else {
3238 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3238 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3239 } 3239 }
3240 } 3240 }
3241 3241
3242 #endif 3242 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFullScreen.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698