Closed
Bug 757293
Opened 14 years ago
Closed 14 years ago
When selecting an element, the selected DOM element should be vertically centered
Categories
(DevTools :: Inspector, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 724071
People
(Reporter: espadrine, Assigned: espadrine)
Details
Attachments
(1 file)
|
685 bytes,
patch
|
Details | Diff | Splinter Review |
Open the DOM inspector.
Select an element in the page with the mouse.
The corresponding DOM element is highlighted below,
but we don't see its context because it is not vertically centered.
Instead, it is shown at the top of the Inspector pane.
This issue is similar to bug https://bugzilla.mozilla.org/show_bug.cgi?id=171237.
| Assignee | ||
Comment 1•14 years ago
|
||
This fix makes sure that, unlike with scrollIntoView(),
the selected DOM element shows up vertically centered in the
DOM inspector.
Comment 2•14 years ago
|
||
I would prefer to see a more generic approach.
See bug 703346, bug 724071 and bug 724515. Also bug 724585 for the generic approach.
Comment 3•14 years ago
|
||
Espadrine, thanks for the patch. I dupe this bug, but that doesn't mean we don't want you to work on that :) Just move your work to the appropriate bug (see comment 2).
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Comment 4•14 years ago
|
||
Thaddée, did you want to copy your patch into bug 724071? I'll review it there if you like.
Comment 5•14 years ago
|
||
Comment on attachment 625871 [details] [diff] [review]
Scroll to center the selected DOM node.
canceling review here.
This looks promising.
objectBox.offsetTop + // is the node's offset from parent
window.innerHeight - // should be the viewport - scrollbars if any.
objectBox.offsetHeight // height of the objectBox including borders.
This looks to me like it'll scroll the element to the bottom of the viewport? Also, are you sure the parent node is the absolute container of the objectbox? It probably is, but I can't remember if that docType node is in the same hierarchy or not and could be introducing additional offset.
Attachment #625871 -
Flags: review?(rcampbell)
| Assignee | ||
Comment 6•14 years ago
|
||
Rob: actually, I have a quick and ugly fix that seems to work most of the time.
I'll submit it at <https://bugzilla.mozilla.org/show_bug.cgi?id=724585>.
I'm not really happy with it, but it does work.
Updated•8 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•