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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2617783002: Migrate WTF::Vector::append() to ::push_back() [part 12 of N] (Closed)
Patch Set: rebase 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 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 if (!pseudo) 463 if (!pseudo)
464 return 0; 464 return 0;
465 465
466 ASSERT(pseudo->styleType() > PseudoIdNone); 466 ASSERT(pseudo->styleType() > PseudoIdNone);
467 467
468 ComputedStyle* result = pseudo.get(); 468 ComputedStyle* result = pseudo.get();
469 469
470 if (!m_cachedPseudoStyles) 470 if (!m_cachedPseudoStyles)
471 m_cachedPseudoStyles = WTF::wrapUnique(new PseudoStyleCache); 471 m_cachedPseudoStyles = WTF::wrapUnique(new PseudoStyleCache);
472 472
473 m_cachedPseudoStyles->append(pseudo); 473 m_cachedPseudoStyles->push_back(pseudo);
474 474
475 return result; 475 return result;
476 } 476 }
477 477
478 void ComputedStyle::removeCachedPseudoStyle(PseudoId pid) { 478 void ComputedStyle::removeCachedPseudoStyle(PseudoId pid) {
479 if (!m_cachedPseudoStyles) 479 if (!m_cachedPseudoStyles)
480 return; 480 return;
481 for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) { 481 for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) {
482 ComputedStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get(); 482 ComputedStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get();
483 if (pseudoStyle->styleType() == pid) { 483 if (pseudoStyle->styleType() == pid) {
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 if (hasClip != otherHasClip || 1129 if (hasClip != otherHasClip ||
1130 (hasClip && m_visual->clip != other.m_visual->clip)) 1130 (hasClip && m_visual->clip != other.m_visual->clip))
1131 diff.setCSSClipChanged(); 1131 diff.setCSSClipChanged();
1132 } 1132 }
1133 1133
1134 void ComputedStyle::addPaintImage(StyleImage* image) { 1134 void ComputedStyle::addPaintImage(StyleImage* image) {
1135 if (!m_rareNonInheritedData.access()->m_paintImages) { 1135 if (!m_rareNonInheritedData.access()->m_paintImages) {
1136 m_rareNonInheritedData.access()->m_paintImages = 1136 m_rareNonInheritedData.access()->m_paintImages =
1137 WTF::makeUnique<Vector<Persistent<StyleImage>>>(); 1137 WTF::makeUnique<Vector<Persistent<StyleImage>>>();
1138 } 1138 }
1139 m_rareNonInheritedData.access()->m_paintImages->append(image); 1139 m_rareNonInheritedData.access()->m_paintImages->push_back(image);
1140 } 1140 }
1141 1141
1142 void ComputedStyle::addCursor(StyleImage* image, 1142 void ComputedStyle::addCursor(StyleImage* image,
1143 bool hotSpotSpecified, 1143 bool hotSpotSpecified,
1144 const IntPoint& hotSpot) { 1144 const IntPoint& hotSpot) {
1145 if (!m_rareInheritedData.access()->cursorData) 1145 if (!m_rareInheritedData.access()->cursorData)
1146 m_rareInheritedData.access()->cursorData = new CursorList; 1146 m_rareInheritedData.access()->cursorData = new CursorList;
1147 m_rareInheritedData.access()->cursorData->append( 1147 m_rareInheritedData.access()->cursorData->push_back(
1148 CursorData(image, hotSpotSpecified, hotSpot)); 1148 CursorData(image, hotSpotSpecified, hotSpot));
1149 } 1149 }
1150 1150
1151 void ComputedStyle::setCursorList(CursorList* other) { 1151 void ComputedStyle::setCursorList(CursorList* other) {
1152 m_rareInheritedData.access()->cursorData = other; 1152 m_rareInheritedData.access()->cursorData = other;
1153 } 1153 }
1154 1154
1155 void ComputedStyle::setQuotes(PassRefPtr<QuotesData> q) { 1155 void ComputedStyle::setQuotes(PassRefPtr<QuotesData> q) {
1156 m_rareInheritedData.access()->quotes = q; 1156 m_rareInheritedData.access()->quotes = q;
1157 } 1157 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 hasBackdropFilter() || hasBlendMode() || hasIsolation() || 1219 hasBackdropFilter() || hasBlendMode() || hasIsolation() ||
1220 hasViewportConstrainedPosition() || 1220 hasViewportConstrainedPosition() ||
1221 hasPropertyThatCreatesStackingContext(willChangeProperties()) || 1221 hasPropertyThatCreatesStackingContext(willChangeProperties()) ||
1222 containsPaint()) { 1222 containsPaint()) {
1223 setIsStackingContext(true); 1223 setIsStackingContext(true);
1224 } 1224 }
1225 } 1225 }
1226 1226
1227 void ComputedStyle::addCallbackSelector(const String& selector) { 1227 void ComputedStyle::addCallbackSelector(const String& selector) {
1228 if (!m_rareNonInheritedData->m_callbackSelectors.contains(selector)) 1228 if (!m_rareNonInheritedData->m_callbackSelectors.contains(selector))
1229 m_rareNonInheritedData.access()->m_callbackSelectors.append(selector); 1229 m_rareNonInheritedData.access()->m_callbackSelectors.push_back(selector);
1230 } 1230 }
1231 1231
1232 void ComputedStyle::setContent(ContentData* contentData) { 1232 void ComputedStyle::setContent(ContentData* contentData) {
1233 SET_VAR(m_rareNonInheritedData, m_content, contentData); 1233 SET_VAR(m_rareNonInheritedData, m_content, contentData);
1234 } 1234 }
1235 1235
1236 bool ComputedStyle::hasWillChangeCompositingHint() const { 1236 bool ComputedStyle::hasWillChangeCompositingHint() const {
1237 for (size_t i = 0; 1237 for (size_t i = 0;
1238 i < m_rareNonInheritedData->m_willChange->m_properties.size(); ++i) { 1238 i < m_rareNonInheritedData->m_willChange->m_properties.size(); ++i) {
1239 switch (m_rareNonInheritedData->m_willChange->m_properties[i]) { 1239 switch (m_rareNonInheritedData->m_willChange->m_properties[i]) {
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2463 if (value < 0) 2463 if (value < 0)
2464 fvalue -= 0.5f; 2464 fvalue -= 0.5f;
2465 else 2465 else
2466 fvalue += 0.5f; 2466 fvalue += 0.5f;
2467 } 2467 }
2468 2468
2469 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2469 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2470 } 2470 }
2471 2471
2472 } // namespace blink 2472 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/BasicShapes.h ('k') | third_party/WebKit/Source/core/style/FilterOperationsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698