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

NEW
Assigned to

Status

()

Core
XML
--
minor
12 years ago
9 years ago

People

(Reporter: mats, Assigned: peterv)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

12 years ago
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).
(Reporter)

Comment 1

12 years ago
Created attachment 231244 [details]
Testcase #1
(Reporter)

Comment 2

12 years ago
Created attachment 231245 [details]
Testcase #2
(Reporter)

Comment 3

12 years ago
Created attachment 231246 [details] [diff] [review]
wip

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?
(Reporter)

Updated

12 years ago
Attachment #231246 - Flags: review?(peterv)
(Assignee)

Comment 5

12 years ago
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?
(Reporter)

Comment 6

12 years ago
Created attachment 233036 [details]
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">
(Reporter)

Comment 7

12 years ago
  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.
(Assignee)

Updated

12 years ago
Blocks: 204102
(Assignee)

Comment 8

12 years ago
(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.
(Assignee)

Comment 9

12 years ago
Comment on attachment 231246 [details] [diff] [review]
wip

See comment 8.
Attachment #231246 - Flags: review?(peterv) → review-
(Assignee)

Comment 10

12 years ago
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
(Assignee)

Comment 11

12 years ago
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
You need to log in before you can comment on or make changes to this bug.