Closed Bug 31594 Opened 26 years ago Closed 26 years ago

Editor underlines named anchors but browser doesn't when anchor is not terminated

Categories

(Core :: DOM: HTML Parser, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: attinasi)

References

()

Details

(Whiteboard: [nsbeta2+][Fix In Hand])

Attachments

(1 file)

The editor underlines text inside <a name=> tags, but the browser doesn't. I think not underlining is the correct behavior but I'm not sure. See http://bugzilla.mozilla.org/showattachment.cgi?attach_id=6464 for an example. Other bugs that use the same testcase: Bug 31592, named anchor image on each line and overlaps text Bug 31588, text inside named anchor functions as link to anchor.
reassign to cmanske
Assignee: brade → cmanske
Target Milestone: M17
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Editor underines named anchors but browser doesn't → Editor underines named anchors but browser doesn't when anchor is not terminated
*** Bug 31588 has been marked as a duplicate of this bug. ***
The test case is definitely incorrect HTML. The correct HTML syntax for named anchor should always have </a> immediatley following the <a>. Thus the "bug" is in the behavior of the parser, which should fixup bad HTML. The parser should automatically "insert" the </a> when it detects a <a name=...> tag that isn't terminated. It isn't clear why there is a difference between the browser and editor.
Assignee: cmanske → rickg
Component: Editor → Parser
Blocks: 31592
This doesnt make sense to me. The parser does close the <a> when the document ends (it would do so earlier if it needed to). Named anchors don't get underlined -- so there's no bug here. Back to charlie for me info or to close.
Assignee: rickg → cmanske
But shouldn't named anchors get closed immediately, and NOT at the end of the document as a <a href=...> (i.e., link) should? The real mystery to me is why it doesn't look underlined in browser, but it does in editor. We are using the same layout! If you load the page in Composer, then use Debug | Dump Content tree, you will see that the <a> is closed just before the table, then redistributed around the lines after the table. That is the behavior I would expect for auto-closing a link. Note that this content tree is exactly what we receive from the parser, right, Akkana? Do you have an equivalent way of seeing the content from the browser so we can see if the content tree is the same there?
The full browser has no equivalent way AFAIK, but viewer has a debug menu to dump the content tree. Try viewer.
This is a parser or layout problem. Don't have time to play with it now.
Status: NEW → ASSIGNED
Target Milestone: M17 → M20
just filed a related bug, 40078. perhaps the test case there might be helpful here, it's much more minimal... http://bugzilla.mozilla.org/showattachment.cgi?attach_id=8951
There is one very simple solution, in my opinion: The parser should immediately terminated the <a> node (effective "inserting </a> " when content is written out) after encountering <a name="foo"> if there is no "href" attribute (a dual anchor/link which is a silly thing to do, but I suppose is legal.)
Charles, the spec is clear: <a> can contain inline elements in html4.0, and navigator even allows <a> to contain certain block-level elements. The parser is performing correctly. Your proposal would violate the spec and backward compatibility behavior.
Rick: I realize that now. So do you have any idea why the content in the named anchor is underlined as if it were a link *only* in Composer? If you click on the "Edit Preview" button at the bottom of Composer's content window (you will have to uncollapse the toolbar to display those buttons), you are in a mode where there is no extra style except for this (from EditorOverride.css): /* Override the browser's pointer cursor over links */ a:link, a:visited, a:active, a:out-of-date { cursor: text; } /* We want the default arrow when hover over the various objects, such as the image that represents the named anchor */ a:link img, a:visited img, a:active img, a:out-of-date img, img[usemap], object[usemap], a[name] { cursor: default; } And I even tried deleting those styles just to be sure, and we still get the underlining of content even though there's no "href" set. So it's probably not a parser or editor bug, but something in layout/CSS. Reassigning to Rick to find the right engineer.
Assignee: cmanske → rickg
Status: ASSIGNED → NEW
Thanks for CC'ing me. Rick will probably appreciate that I am taking this one - it sure smells like a style issue.
Assignee: rickg → attinasi
This is a bug in the SelectorMatches function. We test for the link to have an HREF but when it does not have one we end up considering it as non-visited! The change is extremely simple - we need to check the result before going out to the link handler... I'll attach the patch.
Status: NEW → ASSIGNED
I'm nominating this for nsbeta2 because the fix is extremely simple (check for error where it shuld have been all along) and the editor will benefit greatly from this (it looks silly to underline named anchors with no href...).
Keywords: nsbeta2
Whiteboard: [Fix In Hand]
Target Milestone: M20 → M16
Summary: Editor underines named anchors but browser doesn't when anchor is not terminated → Editor underlines named anchors but browser doesn't when anchor is not terminated
Putting on [nsbeta2+] radar for beta2 fix.
Whiteboard: [Fix In Hand] → [nsbeta2+][Fix In Hand]
Fixed. (nsCSSStyleSheet.cpp)
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
this is a parser/layout problem...qa_contact assign to gerardo for his group...
QA Contact: sujay → gerardok
QA Contact: gerardok → petersen
Fixed in the June 09 M17 build (2000060908).
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: