Closed
Bug 56858
Opened 25 years ago
Closed 25 years ago
RFE: Pref to make link traversal select target
Categories
(Core :: Layout, enhancement, P3)
Core
Layout
Tracking
()
VERIFIED
FIXED
mozilla0.9.1
People
(Reporter: hjtoi-bugzilla, Assigned: hjtoi-bugzilla)
References
Details
(Keywords: testcase, Whiteboard: [fixinhand])
Attachments
(5 files)
|
3.65 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.76 KB,
patch
|
Details | Diff | Splinter Review | |
|
337 bytes,
text/html
|
Details | |
|
679 bytes,
text/xml
|
Details | |
|
3.96 KB,
patch
|
Details | Diff | Splinter Review |
I want to have a pref that controls whether or not the target of link (once it
is traversed) is selected or not. Currently it is not.
I implemented this functionality into DocZilla, a Mozilla-based browser
(http://www.doczilla.com).
I think it makes it easier to spot what a link is really pointing to if the
target is highlighted somehow. CSS3 will most likely address the styling.
However, CSS will not *select* the target. Selection is handy because as soon as
you traverse the link you can copy the target to clipboard.
I know that perhaps the majority of old websites use empty A for anchor
locations so this pref/styling wouldn't show anything different than what we do
now. Newer websites, and people with SGML/XML background are more likely to use
the ID attribute to mark whole sections, which makes more sense anyway.
| Assignee | ||
Updated•25 years ago
|
Target Milestone: --- → Future
| Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Updated•25 years ago
|
Target Milestone: Future → mozilla0.9
| Assignee | ||
Comment 1•25 years ago
|
||
| Assignee | ||
Comment 2•25 years ago
|
||
| Assignee | ||
Comment 3•25 years ago
|
||
| Assignee | ||
Comment 4•25 years ago
|
||
| Assignee | ||
Comment 5•25 years ago
|
||
This turned out to be trickier than I thought. The problematic case is the
selection of the document's root element.
The first patch does nothing if the anchor happens to be the root element. This
is because we try to get the content's parent, which does not exist. In this
patch we must have the parent to be able to make a selection.
The second patch should work fine even if the anchor is the root element.
Unfortunately this causes crash in nsContentSubtreeIterator::Init() because the
code does QI to content and uses this pointer without null-checks. It is null
because the document does not implement the nsIContent implementation.
After this experiment it is my understanding that it is impossible to select a
complete document. I opened bug 59785 for this.
It is possible to select all of the document EXCEPT the root element. In most
cases the user would think the whole document was selected. But if you were able
to paste HTML/XML or used code to check the contents of the selection you would
immediately notice it is wrong.
Depends on: 59785
| Assignee | ||
Updated•25 years ago
|
Whiteboard: [fixinhand]
Comment 6•25 years ago
|
||
Upon managerial request, adding the "testcase" keyword to 84 open layout bugs that
do not have the "testcase" keyword and yet have an attachement with the word
"test" in the description field. Apologies for any mistakes.
Keywords: testcase
| Assignee | ||
Updated•25 years ago
|
Target Milestone: mozilla0.9 → mozilla0.9.1
| Assignee | ||
Comment 7•25 years ago
|
||
Anthony, could you review my second patch here?
How is it going with bug 59785, you said you had the fix in your tree a while
ago...?
| Assignee | ||
Comment 8•25 years ago
|
||
| Assignee | ||
Comment 9•25 years ago
|
||
This is weird... Applying the latest patch the HTML testcase works fine, and the
XML testcase doesn't crash either. The only problem is with the link to the
document root in the XML sample, which doesn't select anything (but it does not
crash either). Brief debugging shows that we get into GoToAnchor() twice which
seems absurd...
| Assignee | ||
Comment 10•25 years ago
|
||
Hmm, now I know why we can get into GoToAnchor() twice. If the first time
returns an error, we try again after intl conversion magic. Even though I don't
like dropping possibly serious error returns, maybe that is what is needed here
for the select code. After all, the caller of GoToAnchor() WILL drop return values.
Comment 11•25 years ago
|
||
so are you happy with the last patch? if so, sr=waterson
Comment 12•25 years ago
|
||
r=vidur for the last patch.
| Assignee | ||
Comment 13•25 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 15•25 years ago
|
||
Actually this applies to all links with #ref.
Comment 16•25 years ago
|
||
Verified on
build: 2001-05-29-20-Trunk
platform: Win NT
The target are getting highlighted now in both XML and HTML test cases.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•