Closed Bug 418391 Opened 16 years ago Closed 16 years ago

Local XHTML does not load (considered invalid) if a non-existent CSS file is specified.

Categories

(Core :: XML, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9

People

(Reporter: Aleksej, Assigned: MatsPalmgren_bugz)

References

(Depends on 1 open bug)

Details

(Keywords: regression, testcase)

Attachments

(4 files, 2 obsolete files)

Mozilla/5.0 (X11; U; Linux i686 (x86_64); eo; rv:1.9b4pre) Gecko/2008021804 Minefield/3.0b4pre
Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9b4pre) Gecko/2008021902 SeaMonkey/2.0a1pre

Steps to reproduce:
1. Have a valid XHTML document with a CSS file specified using the <link> attribute (see the attachment).
2. Try loading it from disk (the bug does not show up through HTTP):
 a) When the CSS file does exist.
 b) When the CSS file does not exist.

Actual results:


2a: WFM


2b:

XML Parsing Error: 
Location: file:///dev/shm/02/test.xhtml
Line Number 6, Column 71:	<link href="style.css" rel="stylesheet" type="text/css" media="all"/>
-----------------------------------------------------------------------------^


Regression range:

Fx 2007111804…2007111904
SM 2007111902…2007112002

→ bug 401613

See also: bug 404419.
Flags: blocking1.9?
Attached patch Like so? (obsolete) — Splinter Review
Attachment #304296 - Flags: superreview?(bzbarsky)
Attachment #304296 - Flags: review?(bzbarsky)
Comment on attachment 304296 [details] [diff] [review]
Like so?

I don't think the CSSLoader is the right place to be doing this.  We should either do it like bug 404419 (CSS loading errors really should not be fatal to XML parsing) or finally fix that file channel bug so they won't throw from AsyncOpen.  Or both!
Attachment #304296 - Flags: superreview?(bzbarsky)
Attachment #304296 - Flags: superreview-
Attachment #304296 - Flags: review?(bzbarsky)
Attachment #304296 - Flags: review-
Flags: tracking1.9? → blocking1.9?
Would it make sense to land the current patch for now and do the AsyncOpen thing after we've branched for FF3. It seems scary to fix that this close to release.

Or ideal would be to do what Boris says in comment 3. Mats would you be able to write up such a patch?
Assignee: nobody → mats.palmgren
Flags: wanted1.9.0.x+
Flags: wanted1.9+
Flags: blocking1.9?
Flags: blocking1.9-
Forgot to say:

Don't think this is a blocker given that local files are rare, XHTML is rare, and failed CSS is rare, and having all three happen at the same time seems very very rare.
I'm the original reporter of bug #422735 that has just been marked as a duplicate of this one.

It seems that this bug does not impact local files only, but also XHTML documents stored in strings, and then parsed with DOMParser::parseFromString().

Therefore it will probably break some online apps, such as the LiveRC tool on Wikipedia <http://fr.wikipedia.org/wiki/Utilisateur:EDUCA33E/LiveRC/Documentation>. Indeed, LiveRC tries to parse an XHTML document contained in a string. This works fine in Firefox 2, but fails in Firefox 3b4. I think that this issue should be fixed in Firefox 3.
OS: Linux → All
(In reply to comment #3)
> I don't think the CSSLoader is the right place to be doing this.

The CSSLoader part just adds a warning to the Error Console.
The fix is in nsStyleLinkElement.

(In reply to comment #4)
> Mats would you be able to write up such a patch?

Probably not, since I think my patch does it "like bug 404419" so I don't
understand what Boris is asking for...
> The fix is in nsStyleLinkElement.

Ah, indeed.  I'm OK with that.  I don't think we want the CSSLoader change.
Attached patch Patch rev. 2Splinter Review
Ok, without the warning message then...
Attachment #304296 - Attachment is obsolete: true
Attachment #311454 - Flags: superreview?(bzbarsky)
Attachment #311454 - Flags: review?(bzbarsky)
Depends on: 424484
Flags: in-testsuite?
Comment on attachment 311454 [details] [diff] [review]
Patch rev. 2

Please make sure to file a followup bug (dependent on the file:// protocol thing) to remove this once we fix the protocol handler.
Attachment #311454 - Flags: superreview?(bzbarsky)
Attachment #311454 - Flags: superreview+
Attachment #311454 - Flags: review?(bzbarsky)
Attachment #311454 - Flags: review+
Attachment #311454 - Flags: approval1.9?
(In reply to comment #12)
Filed bug 424880
Attachment #311454 - Flags: approval1.9? → approval1.9+
mozilla/content/base/src/nsStyleLinkElement.cpp 	1.48 

-> FIXED
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9
Verified fixed with Mozilla/5.0 (X11; U; Linux i686; eo; rv:1.9pre) Gecko/2008042304 Minefield/3.0pre.
Status: RESOLVED → VERIFIED
Flags: wanted1.9.0.x+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: