Closed Bug 73160 Opened 24 years ago Closed 24 years ago

Handling of <?xml-stylesheet?> without href attribute

Categories

(Core :: XML, defect, P5)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: basic, Assigned: hjtoi-bugzilla)

Details

(Whiteboard: [fixinhand])

Attachments

(3 files)

When loading an xml file with a <?xml-stylesheet type="text/css"?> tag, mozilla would just stop loading the page. It doesn't give an error message, it doesn't display a blank page and it doesn't even display an error message in the console. In fact according to the console the page was successfully loaded. I'm not sure what the right behavior should be, but the current behavior is bad.
The first attachment will display nothing. The second attachment works.
Status: UNCONFIRMED → NEW
Ever confirmed: true
In fact the page loaded ok. The content area just does not get refreshed. If you do view source, you will see the page loaded. But yeah, this is a valid bug and should be fixed. I don't see it as too serious though, you will immediately notice something is vevy, vevy wong if you try to it...
Will try to fix, probably trivial. But breakage is obvious to any developer and the workaround is simple.
Severity: normal → minor
Priority: -- → P5
Target Milestone: --- → mozilla0.9.1
The fix was indeed simple. If there is no href attribute, nsParserUtils::GetQuotedAttributeValue() will return NS_ERROR_FAILURE. If we propagate that, we won't display the page. If there was an href but it was empty we bail out early but do not return with an error value, hence the difference in behaviour. With this fix we treat !href and href="" the same. The patch also includes a couple of changes that might slightly improve performance on some platforms. I wanted to remove all the NS_Convert... calls to NS_LITERAL_STRING, but it turns out that would have required rather substantial changes elsewhere.
Status: NEW → ASSIGNED
Whiteboard: [fixinhand]
I did some measuring, and AssignWithConversion is faster than Assign(NS_LITERAL_STRING()), so I decided not to change those, just the return value (so the fix is one line change). The fix is also included in the patch to bug 67887, in block @@ -1231,8 +1279,8 @@.
r=harishd
sr=vidur. We should confirm that no content sink codepaths force an unintentional error return code. I'm guessing that implementors (including me) weren't aware of the repercussions of returning error codes to the parser.
Nisheeth says r=nisheeth
Really.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking verified in the May 25th build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: