HTML: Parser
16 years ago
15 years ago


(Reporter: Tom Jac, Assigned: Tanu Mutreja)



Firefox Tracking Flags

(Not tracked)


(Whiteboard: [patch needs a=], URL)


(3 attachments, 1 obsolete attachment)



16 years ago
go to
make a search, i.e. "test"  click [Suchen]

click on a result... doesnt work:
Ihre Aktion bezieht sich auf ein inzwischen nicht mehr vorhandenes Suchergebnis.

netscape 4.7 works.
% ping
PING ( from : 56(84) bytes of data.
From ( Destination Host Unreachable
From ( Destination Host Unreachable
From ( Destination Host Unreachable

--- ping statistics ---
10 packets transmitted, 0 packets received, +3 errors, 100% packet loss

not very helpful.... can you actually access the site?  What mozilla build are
you using?

Comment 2

16 years ago
Yes I've got access now (13:24):

When did you tried it, at night? Perhaps they made a backup? (It's a library
catalogue: Stately Library Berlin, on of the largest librarys in Germany.)  If
you need translation from German it would be a pleasure to help - if I can.
Thanks a lot.


Comment 3

16 years ago
I use build 2001122106 (0.9.7) for windows and linux.

Comment 5

16 years ago
Assignee: asa → neeti
Component: Browser-General → Networking
Ever confirmed: true
QA Contact: doronr → benc

Comment 6

16 years ago
This works for me on windows2000

Comment 7

16 years ago
cc'ing darin

Comment 8

16 years ago
-> badami for investigation
Assignee: neeti → badami

Comment 9

16 years ago
This does not seem to be a networking bug.
When i do the following 
1. go to
2. make a search, i.e. "test"  click [Suchen]
3. Open the first result in a new window,

With IE the URL for the first result is
However, when i do it with Mozilla,

If i do try to open the IE URL in Mozilla, I get the correct response.
So the problem seems to be that we seem to be forgetting our base URL or href.

Comment 10

16 years ago
badami: two possible explanations that come to mind:

1) relative URL resolution problem - mozilla bug
2) relative URL resolution problem - server violating RFC 2396
3) server not sniffing mozilla useragent correctly, sending mozilla garbage.

if it's a problem with relative URL resolution, then we need to identify the
problem so we can either fix it on our end or provide the evangelism team with
suitable information.  likewise, if it's problem 3.

Comment 11

16 years ago
This problem is occuring because base href is ignored when it occurs within the 
body tag and not the head tag for a form. Hence for a relative actionURL, the 
generated actionurl during the submit is not relative to the base href url but 
is with respect to the document url.

I observe that the in the nsHTMLFormElement::GetActionURL, which calls 
mDocument->GetBaseURL, returns a baseurl value but which is not the base href 
value. This is because the baseurl is not getting updated with base href value 
in the mDocument.

I have attached the test case, which verifies that the base href tag occuring 
in the body is ignored for a form.

Comment 12

16 years ago
Created attachment 72792 [details]
.tar.gz file having the testcase

test case for the comment 11

Comment 13

16 years ago
Created attachment 73679 [details] [diff] [review]
Patch to fix it...

This is Parser bug, in fact not a bug but a better way to deal with malformed
HTML, where BASE tag is appearing outside HEAD. Though HTML specs recommends it
to be inside HEAD but the patch provides a fix to handle it in the way other
browsers do.

Comment 14

16 years ago
CC'ing Harish for review and comments.


16 years ago
Whiteboard: [patch needs r/sr=]

Comment 15

16 years ago
Could you exploit mFlags memeber instead? That is, do something like

Index: nsHTMLContentSink.cpp
RCS file: /cvsroot/mozilla/content/html/document/src/nsHTMLContentSink.cpp,v
retrieving revision 3.526
diff -u -r3.526 nsHTMLContentSink.cpp
--- nsHTMLContentSink.cpp       6 Mar 2002 07:46:31 -0000       3.526
+++ nsHTMLContentSink.cpp       13 Mar 2002 19:33:52 -0000
@@ -195,6 +195,7 @@
 #define NS_SINK_FLAG_CAN_INTERRUPT_PARSER 0x20 //Interrupt parsing when
 #define NS_SINK_FLAG_DYNAMIC_LOWER_VALUE 0x40 // Lower the value for
+#define NS_SINK_FLAG_IS_BASE_HREF_SET 0x80 // Lower the value for

 #define NS_DELAY_FOR_WINDOW_CREATION  500000  // 1/2 second fudge factor for window
 #define NS_MAX_TOKENS_DEFLECTED_IN_LOW_FREQ_MODE 200 //200 determined
empirically to
ser response without
@@ -4150,12 +4151,13 @@
   rv = NS_NewURI(getter_AddRefs(baseHrefURI), aBaseHref, nsnull);
   if (NS_FAILED(rv)) return;

-  if (nsnull == mBody) {  // still in real HEAD
+  if ((mFlags & NS_SINK_FLAG_IS_BASE_HREF_SET) || nsnull == mBody) {  // still
in re
     rv = mDocument->SetBaseURL(baseHrefURI); // The document checks if it is
legal t

     if (NS_SUCCEEDED(rv)) {
   else {  // NAV compatibility quirk

Comment 16

16 years ago
->parser + QA

Please update the component (and QA) when you take bugs out of networking...
Component: Networking → Parser

Comment 17

16 years ago
Created attachment 74077 [details] [diff] [review]
Incorporated Harish's suggestions
Attachment #73679 - Attachment is obsolete: true

Comment 18

16 years ago
Comment on attachment 74077 [details] [diff] [review]
Incorporated Harish's suggestions

r=harishd [ provided IE exhibits the same behavior ]
Attachment #74077 - Flags: review+

Comment 19

16 years ago
IE is taking the last BASE HREF appearing in HTML document irrespective of 
the fact whether it's appearing in HEAD or BODY. I feel by giving preference to 
the BASE appearing in HEAD over the one appearing in BODY, we are favoring the 
HTML specifications more closely. 

Comment 20

16 years ago
Reassigning to Tanu since she wrote up the patch.
Assignee: badami → tmutreja
Comment on attachment 74077 [details] [diff] [review]
Incorporated Harish's suggestions

Attachment #74077 - Flags: superreview+


16 years ago
Whiteboard: [patch needs r/sr=] → [patch needs a=]

Comment 22

16 years ago
Comment on attachment 74077 [details] [diff] [review]
Incorporated Harish's suggestions

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #74077 - Flags: approval+


16 years ago
QA Contact: benc → moied

Comment 23

16 years ago
Fixed with checkin
C:\mozilla\content\html\document\src>cvs commit
cvs commit: Examining .
Checking in nsHTMLContentSink.cpp;
/cvsroot/mozilla/content/html/document/src/nsHTMLContentSink.cpp,v  <--  nsHTMLC
new revision: 3.528; previous revision: 3.527
Last Resolved: 16 years ago
Resolution: --- → FIXED


16 years ago
Attachment #72792 - Attachment mime type: application/octet-stream → application/x-gzip
Created attachment 90820 [details] [diff] [review]
Patch for harish

This patch makes forms honor _base_href, a necessity when Harish implements
with bug 141537

Comment 25

16 years ago
After investigating bug 141537 it turns out that the fix in this bug breaks
backwards compatibility. JKeiser and I discussed about it and have a solution in

Resolution: FIXED → ---


16 years ago
Depends on: 141537
Fixed with bug 141537.
Last Resolved: 16 years ago15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.