Closed Bug 1559008 Opened 6 years ago Closed 6 years ago

Catalog DTDs not loaded properly when document URI is a non-hierarchical scheme

Categories

(Core :: XML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Simplest testcase I could create:

data:text/xml,<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"><root>&Aacute;</root>

That URL works fine in Chrome and in Safari, but in Firefox it fails with an "undefined entity" error. The reason it fails is that we land in nsExpatDriver::OpenInputStreamFromExternalDTD with aBaseURL set to the data: URL and aURLStr set to "DTD/xhtml1-strict.dtd". The NS_NewURI call to create uri fails, and we bail out without loading the DTD.

This bites about: URLs as well, if they pass the about: URL to the parser, which is where bug 1558693 came from.

Looking into sane ways of fixing this now; I think we should make it work.

Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Priority: -- → P2

With the load all XUL as XHTML patch and this patch applied, when I run ./mach test browser_addons_debug_info.js I get:

###!!! ASSERTION: Null parameter.: 'aDTD', file /home/bdahl/projects/gecko/parser/htmlparser/nsExpatDriver.cpp, line 197

Oops, that assertion should be removed. I only tested in opt, clearly... ;)

Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e65bee2165ec Load catalog DTDs even if we don't have a useful DTD URI, since we ignore that URI anyway when we find a catalog DTD. r=peterv
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/17485 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: