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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLElement.cpp

Issue 2583233002: Migrate WTF::Vector::append() to ::push_back() [part 7 of N] (Closed)
Patch Set: Created 4 years 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 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 size_t i = 0; 941 size_t i = 0;
942 // Skip a leading #. 942 // Skip a leading #.
943 if (colorString[0] == '#') 943 if (colorString[0] == '#')
944 i = 1; 944 i = 1;
945 945
946 // Grab the first 128 characters, replacing non-hex characters with 0. 946 // Grab the first 128 characters, replacing non-hex characters with 0.
947 // Non-BMP characters are replaced with "00" due to them appearing as two 947 // Non-BMP characters are replaced with "00" due to them appearing as two
948 // "characters" in the String. 948 // "characters" in the String.
949 for (; i < colorString.length() && digitBuffer.size() < maxColorLength; i++) { 949 for (; i < colorString.length() && digitBuffer.size() < maxColorLength; i++) {
950 if (!isASCIIHexDigit(colorString[i])) 950 if (!isASCIIHexDigit(colorString[i]))
951 digitBuffer.append('0'); 951 digitBuffer.push_back('0');
952 else 952 else
953 digitBuffer.append(colorString[i]); 953 digitBuffer.push_back(colorString[i]);
954 } 954 }
955 955
956 if (!digitBuffer.size()) 956 if (!digitBuffer.size())
957 return Color::black; 957 return Color::black;
958 958
959 // Pad the buffer out to at least the next multiple of three in size. 959 // Pad the buffer out to at least the next multiple of three in size.
960 digitBuffer.append('0'); 960 digitBuffer.push_back('0');
961 digitBuffer.append('0'); 961 digitBuffer.push_back('0');
962 962
963 if (digitBuffer.size() < 6) 963 if (digitBuffer.size() < 6)
964 return makeRGB(toASCIIHexValue(digitBuffer[0]), 964 return makeRGB(toASCIIHexValue(digitBuffer[0]),
965 toASCIIHexValue(digitBuffer[1]), 965 toASCIIHexValue(digitBuffer[1]),
966 toASCIIHexValue(digitBuffer[2])); 966 toASCIIHexValue(digitBuffer[2]));
967 967
968 // Split the digits into three components, then search the last 8 digits of 968 // Split the digits into three components, then search the last 8 digits of
969 // each component. 969 // each component.
970 DCHECK_GE(digitBuffer.size(), 6u); 970 DCHECK_GE(digitBuffer.size(), 6u);
971 size_t componentLength = digitBuffer.size() / 3; 971 size_t componentLength = digitBuffer.size() / 3;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 1192
1193 #ifndef NDEBUG 1193 #ifndef NDEBUG
1194 1194
1195 // For use in the debugger 1195 // For use in the debugger
1196 void dumpInnerHTML(blink::HTMLElement*); 1196 void dumpInnerHTML(blink::HTMLElement*);
1197 1197
1198 void dumpInnerHTML(blink::HTMLElement* element) { 1198 void dumpInnerHTML(blink::HTMLElement* element) {
1199 printf("%s\n", element->innerHTML().ascii().data()); 1199 printf("%s\n", element->innerHTML().ascii().data());
1200 } 1200 }
1201 #endif 1201 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLDimension.cpp ('k') | third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698