Skip to content
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
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

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
rigelk committed Jun 22, 2017
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))
) => {},

This comment has been minimized.

@KiChjang

KiChjang Jun 23, 2017

Member

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.

This comment has been minimized.

@jdm

jdm Jun 23, 2017

Member

I'm ok with it in this case. I think it makes sense to have the XML types grouped together in this way.

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

@@ -1,5 +1,6 @@
[Document-createElement.html]
type: testharness
expected: TIMEOUT
[createElement(undefined) in XML document]
expected: FAIL

@@ -1,5 +1,6 @@
[Document-createElementNS.html]
type: testharness
expected: TIMEOUT
[createElementNS test in XML document: null,null,null]
expected: FAIL

@@ -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
@@ -1,5 +1,6 @@
[Element-matches.html]
type: testharness
expected: TIMEOUT
[In-document Element.matches: Universal selector, matching all children of the specified reference element (with refNode Element): >*]
expected: FAIL

@@ -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 @@
[Element-webkitMatchesSelector.html]
type: testharness
expected: TIMEOUT
[In-document Element.webkitMatchesSelector: Descendant combinator '>>', matching element that is a descendant of an element with id (with no refNodes): #descendant>>div]
expected: FAIL

@@ -75,3 +76,6 @@
[In-document Element.webkitMatchesSelector: Descendant combinator, '>>', matching element with class that is a descendant of an element with class (1) (with no refNodes): .descendant-div1>>.descendant-div3]
expected: FAIL

[Selectors-API Level 2 Test Suite: HTML with Selectors Level 3]
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

@@ -1,5 +1,6 @@
[ParentNode-querySelector-All-xht.xht]
type: testharness
expected: TIMEOUT
[Document.querySelectorAll: :first-line pseudo-element (one-colon syntax) selector, not matching any elements: #pseudo-element:first-line]
expected: FAIL

@@ -252,3 +253,6 @@
[In-document Element.querySelector: Descendant combinator '>>', not matching element with id that is not a descendant of an element with id: #descendant-div1>>#descendant-div4]
expected: FAIL

[Selectors-API Test Suite: XHTML]
expected: TIMEOUT

@@ -1,5 +1,6 @@
[ParentNode-querySelector-All.html]
type: testharness
expected: TIMEOUT
[Document.querySelectorAll: :first-line pseudo-element (one-colon syntax) selector, not matching any elements: #pseudo-element:first-line]
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.
You can’t perform that action at this time.