00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#include "csshelper.h"
00023
00024
#include <qfontmetrics.h>
00025
#include <qfontinfo.h>
00026
#include <qpaintdevice.h>
00027
#include <qpaintdevicemetrics.h>
00028
#include <qfontdatabase.h>
00029
00030
#include <kcharsets.h>
00031
#include <kglobal.h>
00032
#include <kdebug.h>
00033
00034
#include "rendering/render_style.h"
00035
#include "css_valueimpl.h"
00036
#include "dom/css_value.h"
00037
#include "misc/helper.h"
00038
#include "xml/dom_stringimpl.h"
00039
#include "khtml_settings.h"
00040
00041
using namespace DOM;
00042
using namespace khtml;
00043
00044
00045
DOMString khtml::parseURL(
const DOMString &url)
00046 {
00047 DOMStringImpl* i = url.
implementation();
00048
if(!i)
return DOMString();
00049
00050
int o = 0;
00051
int l = i->l;
00052
while(o < l && (i->s[o] <=
' ')) { o++; l--; }
00053
while(l > 0 && (i->s[o+l-1] <=
' ')) l--;
00054
00055
if(l >= 5 &&
00056 (i->s[o].lower() ==
'u') &&
00057 (i->s[o+1].lower() ==
'r') &&
00058 (i->s[o+2].lower() ==
'l') &&
00059 i->s[o+3].latin1() ==
'(' &&
00060 i->s[o+l-1].latin1() ==
')') {
00061 o += 4;
00062 l -= 5;
00063 }
00064
00065
while(o < l && (i->s[o] <=
' ')) { o++; l--; }
00066
while(l > 0 && (i->s[o+l-1] <=
' ')) l--;
00067
00068
if(l >= 2 && i->s[o] == i->s[o+l-1] &&
00069 (i->s[o].latin1() ==
'\'' || i->s[o].latin1() ==
'\"')) {
00070 o++;
00071 l -= 2;
00072 }
00073
00074
while(o < l && (i->s[o] <=
' ')) { o++; l--; }
00075
while(l > 0 && (i->s[o+l-1] <=
' ')) l--;
00076
00077 DOMStringImpl* j =
new DOMStringImpl(i->s+o,l);
00078
00079
int nl = 0;
00080
for(
int k = o; k < o+l; k++)
00081
if(i->s[k].unicode() >
'\r')
00082 j->s[nl++] = i->s[k];
00083
00084 j->l = nl;
00085
00086
return j;
00087 }