Closed Bug 745489 Opened 11 years ago Closed 2 years ago

when in CSS writing "pointer-events: none" for some element and next we cannot select this element with Web Inspector

Categories

(DevTools :: Inspector, defect, P3)

14 Branch
x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1129488

People

(Reporter: nekr, Unassigned)

References

Details

(Whiteboard: [devtools-platform])

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120414 Firefox/14.0a1
Build ID: 20120414030731

Steps to reproduce:

I added CSS property to acticle element via class name. 


Actual results:

Web Inspector could not to select these elements.


Expected results:

Web Inspector still should to select these elements because it's developer tool :)
Component: Untriaged → Developer Tools: Inspector
QA Contact: untriaged → developer.tools.inspector
Well, usually, using pointer-events:none means you want some elements under it to be reachable with the mouse.

The breadcrumbs display or the HTML Panel should help to reach this element.
When I use the |pointer-events:none| I expect what users will have not pointer actions on this element. But I developer and I expect that I will have full ability to inspect my proudct/work. ,
I understand what you're saying, but imagine this use case: the developer use a <div> that is the size of the page and covers the content. Of just covers some other elements. If this happens, a lot of elements won't be selectable anymore.

This is not an hypothetical use case. This is a typical use of pointer-events:none.

So I prefer to keep click-through elements not selectable via the highlighter, but only via the breadcrumbs display and the HTML Panel.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
I understand your position too. But I writing email app for b2g and I prevented pointer events for most elements, but these elements are not main elements, it's just components of messages or theirs summaries. So i cannot comfortable work because I permanently should to select these elements by the breadcrumbs, but these elements maybe in deep position of tree.
I see. It might be worth to have an option here, or at least have a way to select through elements (z-index traversal). I'll think about that.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: WONTFIX → ---
Ok, some optional feature will be good way.
Assignee: nobody → paul
Attached patch Patch v1 (obsolete) — Splinter Review
Matt, what I'm trying to do here is to make it optional to ignore `pointer-events:none` when we use DOMWindowUtils.elementFromPoint().

I touched a lot of C++ code here, and I'm not very confident.

Let me know what you think.
Attachment #775636 - Flags: review?(matt.woodrow)
(not for later: typo in the IDL comment)
Comment on attachment 775636 [details] [diff] [review]
Patch v1

I don't feel comfortable reviewing this sorry, deferring to roc.

Not a fan of adding even more bool parameters to elementFromPoint though.
Attachment #775636 - Flags: review?(matt.woodrow) → review?(roc)
Comment on attachment 775636 [details] [diff] [review]
Patch v1

Review of attachment 775636 [details] [diff] [review]:
-----------------------------------------------------------------

I think you should add the bool to HitTestState instead of modifying the signature of HitTest.

I think you should add this to nodesFromRect, since that's the most general function.

But instead of adding another boolean, let's introduce nodesFromRectWithFlags to nsIDOMWindowUtils and pass a flags word, which includes all three booleans it will take.
Attachment #775636 - Flags: review?(roc)
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #11)
> But instead of adding another boolean, let's introduce
> nodesFromRectWithFlags to nsIDOMWindowUtils and pass a flags word, which
> includes all three booleans it will take.

I guess I should also create ElementFromPointWithFlags?
Attached patch patch v2 - WIPSplinter Review
This patch doesn't even compile yet, but before moving forward, I'd need some feedback.

This is what I do:

* define flags in nsLayoutUtils.h:

>  enum {
>    IGNORE_ROOT_SCROLL_FRAME = 0x01,
>    FLUSH_LAYOUT = 0x02,
>    IGNORE_SUPPRESSION = 0x04,
>    IGNORE_MOUSE_THROUGH = 0x08
>  }

* 2 new methods in nsIDOMWindowUtils.idl:

> nodesFromRectWithFlags
> elementFromPointWithFlags

* in nsDOMWindowUtils.cpp, nsDOMWindowUtils::ElementFromPoint and nsDOMWindowUtils::NodesFromRect just reuse the *WithFlags methods.

* nsDOMWindowUtils::*WithFlags methods use methods from nsDocument.cpp:
> nsDocument::ElementFromPointHelper
> nsDocument::NodesFromRectHelper

* I change the definition of these functions to accept flags instead of bools (this is where I'm not sure it's the right thing to do as public/nsIDocument.h also references these functions. Should I also implement *WithFlags methods here? Or should I not use flags at all at this point and add a 3rd boolean for CLICKTHROUGH?).

* methods from nsDocument use nsLayoutUtils::GetFrameForPoint and nsLayoutUtils::GetFramesForArea, where, again, I change the definitions of the functions to accept flags instead of booleans (bad?).

* nsLayoutUtils::GetFramesForArea uses HitTest. I add a flag to hitTestState to ignore pointer-events.
Attachment #775636 - Attachment is obsolete: true
Attachment #776285 - Flags: feedback?(roc)
(In reply to Paul Rouget [:paul] from comment #14)
> * in nsDOMWindowUtils.cpp, nsDOMWindowUtils::ElementFromPoint and
> nsDOMWindowUtils::NodesFromRect just reuse the *WithFlags methods.
> 
> * nsDOMWindowUtils::*WithFlags methods use methods from nsDocument.cpp:
> > nsDocument::ElementFromPointHelper
> > nsDocument::NodesFromRectHelper
> 
> * I change the definition of these functions to accept flags instead of
> bools (this is where I'm not sure it's the right thing to do as
> public/nsIDocument.h also references these functions. Should I also
> implement *WithFlags methods here? Or should I not use flags at all at this
> point and add a 3rd boolean for CLICKTHROUGH?).

I'd just change everything in C++ to use flags. 

> * methods from nsDocument use nsLayoutUtils::GetFrameForPoint and
> nsLayoutUtils::GetFramesForArea, where, again, I change the definitions of
> the functions to accept flags instead of booleans (bad?).

That's fine.
I won't be working on that anytime soon.
Assignee: paul → nobody
Whiteboard: [devtools-platform]
Marking as P3 because:
- I think comment 3 is still valid
- this bug hasn't been worked on in a long while and we haven't received further feedback about this issue in the meantime
- also because Chrome has the same issue.

Note that we are not using elementFromPoint anymore, but simple event.originalTarget (see findAndAttachElement in https://dxr.mozilla.org/mozilla-central/source/devtools/server/actors/highlighters.js#351-357 )
Priority: -- → P3
Product: Firefox → DevTools
See Also: → 1129488
Status: REOPENED → RESOLVED
Closed: 11 years ago2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.