Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
dc96c688
Commit
dc96c688
authored
Mar 15, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Notify parser about script evaluation.
parent
699e41cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
5 deletions
+70
-5
mutation.c
dlls/mshtml/mutation.c
+20
-2
nsiface.idl
dlls/mshtml/nsiface.idl
+48
-1
exectest.html
dlls/mshtml/tests/exectest.html
+2
-2
No files found.
dlls/mshtml/mutation.c
View file @
dc96c688
...
...
@@ -310,9 +310,10 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo
return
NS_OK
;
}
static
nsresult
run_insert_script
(
HTMLDocumentNode
*
doc
,
nsISupports
*
script_iface
,
nsISupports
*
arg
)
static
nsresult
run_insert_script
(
HTMLDocumentNode
*
doc
,
nsISupports
*
script_iface
,
nsISupports
*
parser_iface
)
{
nsIDOMHTMLScriptElement
*
nsscript
;
nsIParser
*
nsparser
=
NULL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
doc
,
script_iface
);
...
...
@@ -323,7 +324,24 @@ static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_ifa
return
nsres
;
}
if
(
parser_iface
)
{
nsres
=
nsISupports_QueryInterface
(
parser_iface
,
&
IID_nsIParser
,
(
void
**
)
&
nsparser
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIParser iface: %08x
\n
"
,
nsres
);
nsparser
=
NULL
;
}
}
if
(
nsparser
)
nsIParser_BeginEvaluatingParserInsertedScript
(
nsparser
);
doc_insert_script
(
doc
->
basedoc
.
window
,
nsscript
);
if
(
nsparser
)
{
nsIParser_EndEvaluatingParserInsertedScript
(
nsparser
);
nsIParser_Release
(
nsparser
);
}
nsIDOMHTMLScriptElement_Release
(
nsscript
);
return
NS_OK
;
}
...
...
@@ -649,7 +667,7 @@ static nsresult NSAPI nsDocumentObserver_DoneAddingChildren(nsIDocumentObserver
if
(
NS_SUCCEEDED
(
nsres
))
{
TRACE
(
"script node
\n
"
);
add_script_runner
(
This
,
run_insert_script
,
(
nsISupports
*
)
nsscript
,
NULL
);
add_script_runner
(
This
,
run_insert_script
,
(
nsISupports
*
)
nsscript
,
(
nsISupports
*
)
aParser
);
nsIDOMHTMLScriptElement_Release
(
nsscript
);
}
...
...
dlls/mshtml/nsiface.idl
View file @
dc96c688
...
...
@@ -150,7 +150,9 @@ typedef nsISupports nsIControllers;
typedef nsISupports nsIDOMValidityState;
typedef nsISupports nsIPluginInstanceOwner;
typedef nsISupports nsIPluginStreamListener;
typedef nsISupports nsIParser;
typedef nsISupports nsIContentSink;
typedef nsISupports nsIParserFilter;
typedef nsISupports nsIDTD;
[
object,
...
...
@@ -2960,6 +2962,51 @@ interface nsIMutationObserver : nsISupports
[
object,
uuid(cbc0cbd8-bbb7-46d6-a551-378a6953a714),
local
]
interface nsIParser : nsISupports
{
typedef int nsDTDMode;
typedef int eParserCommands;
void SetContentSink(nsIContentSink *aSink);
nsIContentSink *GetContentSink();
void GetCommand(nsACString *aCommand);
void SetCommand2(const char *aCommand);
void SetCommand(eParserCommands aParserCommand);
void SetDocumentCharset(const nsACString *aCharset, PRInt32 aSource);
void GetDocumentCharset(nsACString *oCharset, PRInt32 *oSource);
void SetParserFilter(nsIParserFilter *aFilter);
nsresult GetChannel(nsIChannel **aChannel);
nsresult GetDTD(nsIDTD **aDTD);
nsresult GetStreamListener(nsIStreamListener **aListener);
nsresult ContinueInterruptedParsing();
void BlockParser();
void UnblockParser();
PRBool IsParserEnabled();
PRBool IsComplete();
nsresult Parse(nsIURI *aURL, nsIRequestObserver *aListener, void *aKey, nsDTDMode aMode);
nsresult Parse2(const nsAString *aSourceBuffer, void *aKey, const nsACString *aMimeType, PRBool aLastCall, nsDTDMode aMode);
void *GetRootContextKey();
nsresult Terminate();
nsresult ParseFragment(const nsAString *aSourceBuffer, void *aKey, void /*nsTArray<nsString>*/ *aTagStack,
PRBool aXMLMode, const nsACString *aContentType, nsDTDMode aMode);
nsresult ParseFragment2(const nsAString *aSourceBuffer, nsIContent *aTargetNode, nsIAtom *aContextLocalName,
PRInt32 aContextNamespace, PRBool aQuirks);
nsresult BuildModel();
nsresult CancelParsingEvents();
void Reset();
PRBool CanInterrupt();
PRBool IsInsertionPointDefined();
void BeginEvaluatingParserInsertedScript();
void EndEvaluatingParserInsertedScript();
void MarkAsNotScriptCreated();
PRBool IsScriptCreated();
}
[
object,
uuid(3d005225-210f-4b07-b1d9-96020574c437),
local
]
...
...
dlls/mshtml/tests/exectest.html
View file @
dc96c688
...
...
@@ -15,12 +15,12 @@ ok(len === 3, "init length = " + len);
document
.
write
(
"<script>"
+
"var len = document.getElementsByTagName('div').length;"
+
"
external.todo_wine_
ok(len === 3, 'unexpected length ' + len);"
+
"ok(len === 3, 'unexpected length ' + len);"
+
"executed = true;"
+
"<"
+
"/script>"
);
len
=
document
.
getElementsByTagName
(
'script'
).
length
;
external
.
todo_wine_
ok
(
len
===
2
,
"script col length = "
+
len
);
ok
(
len
===
2
,
"script col length = "
+
len
);
ok
(
executed
,
"writen script not executed"
);
external
.
reportSuccess
();
...
...
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