Open Bug 346444 Opened 18 years ago Updated 2 years ago

WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsExpatDriver.cpp, line 708

Categories

(Core :: XML, defect)

defect

Tracking

()

People

(Reporter: MatsPalmgren_bugz, Assigned: peterv)

References

Details

(Keywords: testcase)

Attachments

(4 files)

STEPS TO REPRODUCE
1. load testcase in a debug build

ACTUAL RESULT
A warning is printed on the console

EXPECTED RESULT
No warning on the console and perhaps even an XML Parsing Error in the
main content window? (it's blank currently).
Attached file Testcase #1
Attached image Testcase #2
Attached patch wipSplinter Review
Like so?
This makes it a parse error. Using "return XML_STATUS_OK" in the first block
fixes the warning and accepts the input silently.
Peter, can you check this out?
Attachment #231246 - Flags: review?(peterv)
Comment on attachment 231246 [details] [diff] [review]
wip

>Index: parser/htmlparser/src/nsExpatDriver.cpp
>===================================================================

>+    return openEntityNames ? XML_STATUS_ERROR : XML_STATUS_OK;

Why make it conditional on openEntityNames?
Attached image Testcase #3
(In reply to comment #5)
> Why make it conditional on openEntityNames?
> 

Because otherwise we would fail to parse DOCTYPEs, for example:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
                     "http://www.w3.org/TR/SVG/DTD/svg10.dtd">
  return !publicId ? XML_STATUS_ERROR : XML_STATUS_OK;

seem to work too. But it also gives a parse error for:
<!DOCTYPE svg SYSTEM "nonexistent">

(which the attached patch accepts).
I'm not sure if that's desirable or not.
Blocks: 204102
(In reply to comment #7)
>   return !publicId ? XML_STATUS_ERROR : XML_STATUS_OK;
> 
> seem to work too. But it also gives a parse error for:
> <!DOCTYPE svg SYSTEM "nonexistent">
> 
> (which the attached patch accepts).
> I'm not sure if that's desirable or not.

So I'm not entirely sure, but I think we want this.
Comment on attachment 231246 [details] [diff] [review]
wip

See comment 8.
Attachment #231246 - Flags: review?(peterv) → review-
Actually, we should probably take into account whether the doc is standalone. Mats, let me know if you object to me taking this bug.
Assignee: xml → peterv
Note that if we follow the XML spec to the letter, both testcases shouldn't give an error. Only if they had standalone="yes" would there be an error (see the last paragraph in http://www.w3.org/TR/xml/#wf-entdeclared).
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b1pre) Gecko/20080927200111 Minefield/3.1b1pre] (home, debug default) (W2Ksp4)

'/toolkit/components/feeds/test' reftest reports
{
PASS | xml/rss09x/rss090.xml | Test was: "RSS 0.90 works" | feed.title.plainText() == "Mozilla Dot Org" && result.version == "rss090" |
*** loading ISO8601DateUtils
WARNING: NS_ENSURE_SUCCESS(rv, 1) failed with result 0x80004001: file .../parser/htmlparser/src/nsExpatDriver.cpp, line 735
PASS | xml/rss09x/rss091.xml | Test was: "RSS 0.91 works" | feed.title.plainText() == "Scripting News" && result.version == "rss091" |
WARNING: NS_ENSURE_SUCCESS(rv, 1) failed with result 0x80004001: file .../parser/htmlparser/src/nsExpatDriver.cpp, line 735
PASS | xml/rss09x/rss091_withNS.xml | Test was: "RSS 0.91 works" | feed.title.plainText() == "Scripting News" && result.version == "rss091" |
}
QA Contact: ashshbhatt → xml
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: