-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use DOMUtils's new pseudo-class lock API for locking pseudo-classes #4
Conversation
What version of Firebug has (or will have) this API? It looks like we will need to keep a list of elements whose state we have changed, such that we can reset them on certain events. Obviously, resetting all of them on Firebug close is required. I can add some code to your patch to show how to listen to that particular event. The other times to reset them seems to still be an open issue though. I often want to set the hover an element then select the child element to see how its CSS rules have changed. So resetting based on selecting another element doesn't seem like the solution. However, I'm not sure what is the solution if just clicking on the content page is not enough. Thoughts? |
This API will be in Firefox 13. Keeping a list would be hard. What Firefox devtools did is keep the lock around only if you move to an element within the hierarchy chain in the breadcrumbs. This allows inspecting parent elements with the lock after locking it on a child element. You can see the feature in Aurora right now by right clicking the node's selector, instructions here: http://www.youtube.com/watch?feature=player_embedded&v=wuZB6JA4dCU. |
As far as I saw the new functions are:
So we obviously need to keep track of the elements with locked state to be able to call Sebastian |
It doesn't support NodeLists. You can iterate over a NodeList and use any of the functions on each node individually. Check out the UI for this in the built-in Firefox devtools, I'd recommend playing around with it. It adds an orange ":hover" to the selectors in the breadcrumbs, for one. Devtools removes the lock when you inspect a new node altogether, unless you are just navigating up the tree with the breadcrumbs, then the lock is retained. This covers all the most common use cases for wanting to keep a lock around. All other pseudo-classes are supported, but the :visited issue is a whole different issue altogether. :visited rules aren't exposed to |
I did that and it's pretty hidden like in Firebug. I would like to make these options more obvious and move them away from the normal options, because they are not panel specific but element specific. At least they should be put into the context menu of the elements. That doesn't make it much more obvious but at least they would be right placed.
That's great. So maybe there should be an item for each one? Or do you think this would congest the UI?
Thanks for the hint. Sebastian |
So hidden in fact, that I can figure out how to do it... :( |
Devtools is planning on putting it in a special new node-specific menu on that "infobar" (the thing that show's the node's selector) soon to make it more discoverable. The HTML view could be a good place to put the control in Firebug, as a context menu on the elements of the tree. I don't think you want an item for each pseudo-class in existence, and there are too many them. There's only really need for If this is going to take a long time to figure out it might be worthwhile to just hook up the new API to the current UI at first, as it's still a significant improvement in UX. |
Heather, would it be possible to help us here with an updated patch according to the things we discussed? Sebastian |
It might be a better use of time for someone more familiar with Firebug's code to do this. Were the functionality and UI specified? |
In my previous comment I tried to explain how I imagine it to work. We discussed this in a conf call earlier and it seemed people agreed to that UI. Sebastian |
I wouldn't be able to get around to it anytime soon, but I'm here to answer questions. |
After hesitating for that long I decided to use your patch. Currently I applied it to a separate branch. Sebastian |
This uses the new DOMUtils pseudo-class lock API from bug 708874 to toggle
:hover
,:active
, and:focus
on the CSS panel.This is preferable to what Firebug currently has because setting these locks doesn't update the element's actual content state, rather it just updates the element's style. So mousing over another element doesn't lose the
:hover
, etc.I can't figure out how to listen for when a new element is selected and listen for when Firebug is closed from the CSS panel. So right now the pseudo-class stays on the element until you manually uncheck it.