New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Treat application/xml like text/xml in ParserContext::process_response #17474
Closed
+86
−6
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Loading status checks…
Treat application/xml like text/xml in ParserContext::process_response
- components/script/dom/servoparser/mod.rs: merged all xml-related branches and added application/xml - tests updated to expect the new result Fixes #15850
- Loading branch information
commit d5bc204710df6d38db0aed504ca975504c73a68f
| @@ -648,13 +648,14 @@ impl FetchResponseListener for ParserContext { | ||
| parser.parse_sync(); | ||
| } | ||
| }, | ||
| Some(ContentType(Mime(TopLevel::Text, SubLevel::Xml, _))) => {}, // Handle text/xml | ||
| // Handle xml (text/xml, application/xml, application/xhtml+xml) | ||
| Some(ContentType(Mime(ref toplevel @ _, ref sublevel @ _, _))) | ||
| if ( | ||
| ((toplevel == &TopLevel::Application) && (sublevel.as_str() == "xhtml+xml")) || | ||
| ((toplevel == &TopLevel::Application) && (sublevel == &SubLevel::Xml)) || | ||
| ((toplevel == &TopLevel::Text) && (sublevel == &SubLevel::Xml)) | ||
| ) => {}, | ||
jdm
Member
|
||
| Some(ContentType(Mime(toplevel, sublevel, _))) => { | ||
| if toplevel.as_str() == "application" && sublevel.as_str() == "xhtml+xml" { | ||
| // Handle xhtml (application/xhtml+xml). | ||
| return; | ||
| } | ||
|
|
||
| // Show warning page for unknown mime types. | ||
| let page = format!("<html><body><p>Unknown content type ({}/{}).</p></body></html>", | ||
| toplevel.as_str(), | ||
| @@ -0,0 +1,6 @@ | ||
| [contenttype_html.html] | ||
| type: testharness | ||
| expected: TIMEOUT | ||
| [HTM document.contentType === 'text/html'] | ||
| expected: TIMEOUT | ||
|
|
| @@ -0,0 +1,6 @@ | ||
| [contenttype_png.html] | ||
| type: testharness | ||
| expected: TIMEOUT | ||
| [PNG document.contentType === 'image/png'] | ||
| expected: TIMEOUT | ||
|
|
| @@ -0,0 +1,6 @@ | ||
| [contenttype_txt.html] | ||
| type: testharness | ||
| expected: TIMEOUT | ||
| [TXT document.contentType === 'text/plain'] | ||
| expected: TIMEOUT | ||
|
|
| @@ -0,0 +1,3 @@ | ||
| [Element-childElementCount-dynamic-add.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-childElementCount-dynamic-remove.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-childElementCount-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-childElementCount.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-firstElementChild-namespace-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-firstElementChild-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-firstElementChild.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-lastElementChild-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-lastElementChild.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-nextElementSibling-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-nextElementSibling.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-previousElementSibling-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-previousElementSibling.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-siblingElement-null-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -0,0 +1,3 @@ | ||
| [Element-siblingElement-null.html] | ||
| type: testharness | ||
| expected: TIMEOUT |
| @@ -1,5 +1,6 @@ | ||
| [Node-isEqualNode-xhtml.xhtml] | ||
| type: testharness | ||
| expected: TIMEOUT | ||
| [isEqualNode should return true when only the internal subsets of DocumentTypes differ.] | ||
| expected: FAIL | ||
|
|
| @@ -0,0 +1,3 @@ | ||
| [getElementsByClassName-30.htm] | ||
| type: testharness | ||
| expected: TIMEOUT |
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
I'm actually not quite fond of using a match guard for this purpose; I'd rather have multiple match arms that matches exactly the TopLevel and SubLevel types.