Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e722268d
Commit
e722268d
authored
Jul 22, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added support for javascript URIs.
parent
2ab3d226
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
1 deletion
+93
-1
uri.c
dlls/urlmon/tests/uri.c
+75
-1
uri.c
dlls/urlmon/uri.c
+18
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
e722268d
...
...
@@ -4192,7 +4192,81 @@ static const uri_properties uri_tests[] = {
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
},
{
"javascript:void"
,
0
,
S_OK
,
FALSE
,
{
{
"javascript:void"
,
S_OK
},
{
""
,
S_FALSE
},
{
"javascript:void"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"void"
,
S_OK
},
{
"void"
,
S_OK
},
{
""
,
S_FALSE
},
{
"javascript:void"
,
S_OK
},
{
"javascript"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_JAVASCRIPT
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
{
"javascript://undefined"
,
0
,
S_OK
,
FALSE
,
{
{
"javascript://undefined"
,
S_OK
},
{
""
,
S_FALSE
},
{
"javascript://undefined"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"//undefined"
,
S_OK
},
{
"//undefined"
,
S_OK
},
{
""
,
S_FALSE
},
{
"javascript://undefined"
,
S_OK
},
{
"javascript"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_JAVASCRIPT
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
},
{
"JavaSCript:escape('/
\\
?#?')"
,
0
,
S_OK
,
FALSE
,
{
{
"javascript:escape('/
\\
?#?')"
,
S_OK
},
{
""
,
S_FALSE
},
{
"javascript:escape('/
\\
?#?')"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
},
{
"escape('/
\\
?#?')"
,
S_OK
},
{
"escape('/
\\
?#?')"
,
S_OK
},
{
""
,
S_FALSE
},
{
"JavaSCript:escape('/
\\
?#?')"
,
S_OK
},
{
"javascript"
,
S_OK
},
{
""
,
S_FALSE
},
{
""
,
S_FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
},
{
0
,
S_FALSE
},
{
URL_SCHEME_JAVASCRIPT
,
S_OK
},
{
URLZONE_INVALID
,
E_NOTIMPL
}
}
}
};
typedef
struct
_invalid_uri
{
...
...
dlls/urlmon/uri.c
View file @
e722268d
...
...
@@ -2068,6 +2068,15 @@ static BOOL parse_path_opaque(const WCHAR **ptr, parse_data *data, DWORD flags)
static
BOOL
parse_hierpart
(
const
WCHAR
**
ptr
,
parse_data
*
data
,
DWORD
flags
)
{
const
WCHAR
*
start
=
*
ptr
;
/* For javascript: URIs, simply set everything as a path */
if
(
data
->
scheme_type
==
URL_SCHEME_JAVASCRIPT
)
{
data
->
path
=
*
ptr
;
data
->
path_len
=
strlenW
(
*
ptr
);
data
->
is_opaque
=
TRUE
;
*
ptr
+=
data
->
path_len
;
return
TRUE
;
}
/* Checks if the authority information needs to be parsed. */
if
(
is_hierarchical_uri
(
ptr
,
data
))
{
/* Only treat it as a hierarchical URI if the scheme_type is known or
...
...
@@ -3079,6 +3088,15 @@ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD fla
uri
->
path_start
=
uri
->
canon_len
;
/* For javascript: URIs, simply copy path part withoutany canonicalization */
if
(
data
->
scheme_type
==
URL_SCHEME_JAVASCRIPT
)
{
if
(
!
computeOnly
)
memcpy
(
uri
->
canon_uri
+
uri
->
canon_len
,
data
->
path
,
data
->
path_len
*
sizeof
(
WCHAR
));
uri
->
path_len
=
data
->
path_len
;
uri
->
canon_len
+=
data
->
path_len
;
return
TRUE
;
}
/* Windows doesn't allow a "//" to appear after the scheme
* of a URI, if it's an opaque URI.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment