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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 state.setStyle(ComputedStyle::clone(*baseComputedStyle)); 667 state.setStyle(ComputedStyle::clone(*baseComputedStyle));
668 if (!state.parentStyle()) 668 if (!state.parentStyle())
669 state.setParentStyle(initialStyleForElement()); 669 state.setParentStyle(initialStyleForElement());
670 } else { 670 } else {
671 if (state.parentStyle()) { 671 if (state.parentStyle()) {
672 RefPtr<ComputedStyle> style = ComputedStyle::create(); 672 RefPtr<ComputedStyle> style = ComputedStyle::create();
673 style->inheritFrom(*state.parentStyle(), 673 style->inheritFrom(*state.parentStyle(),
674 isAtShadowBoundary(element) 674 isAtShadowBoundary(element)
675 ? ComputedStyleBase::AtShadowBoundary 675 ? ComputedStyleBase::AtShadowBoundary
676 : ComputedStyleBase::NotAtShadowBoundary); 676 : ComputedStyleBase::NotAtShadowBoundary);
677 state.setStyle(style.release()); 677 state.setStyle(std::move(style));
678 } else { 678 } else {
679 state.setStyle(initialStyleForElement()); 679 state.setStyle(initialStyleForElement());
680 state.setParentStyle(ComputedStyle::clone(*state.style())); 680 state.setParentStyle(ComputedStyle::clone(*state.style()));
681 } 681 }
682 } 682 }
683 683
684 // contenteditable attribute (implemented by -webkit-user-modify) should 684 // contenteditable attribute (implemented by -webkit-user-modify) should
685 // be propagated from shadow host to distributed node. 685 // be propagated from shadow host to distributed node.
686 if (state.distributedToInsertionPoint()) { 686 if (state.distributedToInsertionPoint()) {
687 if (Element* parent = element->parentElement()) { 687 if (Element* parent = element->parentElement()) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 Element* pseudoElement = element.pseudoElement(pseudoStyleRequest.pseudoId); 873 Element* pseudoElement = element.pseudoElement(pseudoStyleRequest.pseudoId);
874 874
875 const ComputedStyle* baseComputedStyle = 875 const ComputedStyle* baseComputedStyle =
876 calculateBaseComputedStyle(state, pseudoElement); 876 calculateBaseComputedStyle(state, pseudoElement);
877 877
878 if (baseComputedStyle) { 878 if (baseComputedStyle) {
879 state.setStyle(ComputedStyle::clone(*baseComputedStyle)); 879 state.setStyle(ComputedStyle::clone(*baseComputedStyle));
880 } else if (pseudoStyleRequest.allowsInheritance(state.parentStyle())) { 880 } else if (pseudoStyleRequest.allowsInheritance(state.parentStyle())) {
881 RefPtr<ComputedStyle> style = ComputedStyle::create(); 881 RefPtr<ComputedStyle> style = ComputedStyle::create();
882 style->inheritFrom(*state.parentStyle()); 882 style->inheritFrom(*state.parentStyle());
883 state.setStyle(style.release()); 883 state.setStyle(std::move(style));
884 } else { 884 } else {
885 state.setStyle(initialStyleForElement()); 885 state.setStyle(initialStyleForElement());
886 state.setParentStyle(ComputedStyle::clone(*state.style())); 886 state.setParentStyle(ComputedStyle::clone(*state.style()));
887 } 887 }
888 888
889 state.style()->setStyleType(pseudoStyleRequest.pseudoId); 889 state.style()->setStyleType(pseudoStyleRequest.pseudoId);
890 890
891 // Since we don't use pseudo-elements in any of our quirk/print 891 // Since we don't use pseudo-elements in any of our quirk/print
892 // user agent rules, don't waste time walking those rules. 892 // user agent rules, don't waste time walking those rules.
893 893
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 PassRefPtr<ComputedStyle> StyleResolver::styleForPage(int pageIndex) { 965 PassRefPtr<ComputedStyle> StyleResolver::styleForPage(int pageIndex) {
966 // m_rootElementStyle will be set to the document style. 966 // m_rootElementStyle will be set to the document style.
967 StyleResolverState state(document(), document().documentElement()); 967 StyleResolverState state(document(), document().documentElement());
968 968
969 RefPtr<ComputedStyle> style = ComputedStyle::create(); 969 RefPtr<ComputedStyle> style = ComputedStyle::create();
970 const ComputedStyle* rootElementStyle = state.rootElementStyle() 970 const ComputedStyle* rootElementStyle = state.rootElementStyle()
971 ? state.rootElementStyle() 971 ? state.rootElementStyle()
972 : document().computedStyle(); 972 : document().computedStyle();
973 DCHECK(rootElementStyle); 973 DCHECK(rootElementStyle);
974 style->inheritFrom(*rootElementStyle); 974 style->inheritFrom(*rootElementStyle);
975 state.setStyle(style.release()); 975 state.setStyle(std::move(style));
976 976
977 PageRuleCollector collector(rootElementStyle, pageIndex); 977 PageRuleCollector collector(rootElementStyle, pageIndex);
978 978
979 collector.matchPageRules( 979 collector.matchPageRules(
980 CSSDefaultStyleSheets::instance().defaultPrintStyle()); 980 CSSDefaultStyleSheets::instance().defaultPrintStyle());
981 981
982 if (ScopedStyleResolver* scopedResolver = document().scopedStyleResolver()) 982 if (ScopedStyleResolver* scopedResolver = document().scopedStyleResolver())
983 scopedResolver->matchPageRules(collector); 983 scopedResolver->matchPageRules(collector);
984 984
985 bool inheritedOnly = false; 985 bool inheritedOnly = false;
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1935 1935
1936 DEFINE_TRACE(StyleResolver) { 1936 DEFINE_TRACE(StyleResolver) {
1937 visitor->trace(m_matchedPropertiesCache); 1937 visitor->trace(m_matchedPropertiesCache);
1938 visitor->trace(m_selectorFilter); 1938 visitor->trace(m_selectorFilter);
1939 visitor->trace(m_styleSharingLists); 1939 visitor->trace(m_styleSharingLists);
1940 visitor->trace(m_document); 1940 visitor->trace(m_document);
1941 visitor->trace(m_tracker); 1941 visitor->trace(m_tracker);
1942 } 1942 }
1943 1943
1944 } // namespace blink 1944 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698