2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
23 #include "CSSHelper.h"
25 #include "PlatformString.h"
26 #include <wtf/Vector.h>
30 String deprecatedParseURL(const String& url)
32 StringImpl* i = url.impl();
39 while (o < l && (*i)[o] <= ' ') {
43 while (l > 0 && (*i)[o + l - 1] <= ' ')
47 && ((*i)[o] == 'u' || (*i)[o] == 'U')
48 && ((*i)[o + 1] == 'r' || (*i)[o + 1] == 'R')
49 && ((*i)[o + 2] == 'l' || (*i)[o + 2] == 'L')
51 && (*i)[o + l - 1] == ')') {
56 while (o < l && (*i)[o] <= ' ') {
60 while (l > 0 && (*i)[o + l - 1] <= ' ')
63 if (l >= 2 && (*i)[o] == (*i)[o + l - 1] && ((*i)[o] == '\'' || (*i)[o] == '\"')) {
68 while (o < l && (*i)[o] <= ' ') {
72 while (l > 0 && (*i)[o + l - 1] <= ' ')
75 Vector<UChar, 2048> buffer(l);
78 for (int k = o; k < o + l; k++) {
84 return String(buffer.data(), nl);
87 } // namespace WebCore