mshtml: Properly handle conditional comments in IE9+ modes.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-02-22 19:48:03 +01:00 committed by Alexandre Julliard
parent 74d6c6d2fb
commit 67de587f60
2 changed files with 10 additions and 20 deletions

View File

@ -138,14 +138,6 @@ static PRUnichar *handle_insert_comment(HTMLDocumentNode *doc, const PRUnichar *
return NULL;
compat_version = compat_mode_info[doc->document_mode].ie_version;
if(compat_version > 8) {
/*
* Ideally we should handle higher versions, but right now it would cause more problems than it's worth.
* We should revisit that once more IE9 features are implemented, most notably new events APIs.
*/
WARN("Using compat version 8\n");
compat_version = 8;
}
switch(cmpt) {
case CMP_EQ:
@ -748,13 +740,15 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
TRACE("(%p)->(%p %p)\n", This, aDocument, aContent);
nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMComment, (void**)&nscomment);
if(NS_SUCCEEDED(nsres)) {
TRACE("comment node\n");
if(This->document_mode < COMPAT_MODE_IE10) {
nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMComment, (void**)&nscomment);
if(NS_SUCCEEDED(nsres)) {
TRACE("comment node\n");
add_script_runner(This, run_insert_comment, (nsISupports*)nscomment, NULL);
nsIDOMComment_Release(nscomment);
return;
add_script_runner(This, run_insert_comment, (nsISupports*)nscomment, NULL);
nsIDOMComment_Release(nscomment);
return;
}
}
if(This->document_mode == COMPAT_MODE_QUIRKS) {

View File

@ -165,10 +165,6 @@ function test_conditional_comments() {
function test_version(v) {
var version = compat_version ? compat_version : 7;
/* Uncomment and fix tests below once we support that. */
if(version >= 9)
return;
div.innerHTML = "<!--[if lte IE " + v + "]>true<![endif]-->";
ok(div.innerText === (version <= v ? "true" : ""),
"div.innerText = " + div.innerText + " for version (<=) " + v);
@ -178,11 +174,11 @@ function test_conditional_comments() {
"div.innerText = " + div.innerText + " for version (<) " + v);
div.innerHTML = "<!--[if gte IE " + v + "]>true<![endif]-->";
ok(div.innerText === (version >= v ? "true" : ""),
ok(div.innerText === (version >= v && version < 10 ? "true" : ""),
"div.innerText = " + div.innerText + " for version (>=) " + v);
div.innerHTML = "<!--[if gt IE " + v + "]>true<![endif]-->";
ok(div.innerText === (version > v ? "true" : ""),
ok(div.innerText === (version > v && version < 10 ? "true" : ""),
"div.innerText = " + div.innerText + " for version (>) " + v);
}