|Submitter||Diff||Changes||Open Issues||Last Updated|
|Error loading review requests:|
It looks as if we don't fire any of these events for stylesheets, at least in my testing. These events would be useful for bug 1141041 if we decide to keep a cache of available stylesheets in a page on the <xul:browser> in the parent process. Testcase incoming.
Created attachment 8668030 [details] MozReview Request: Bug 1210074 - Testcase. Bug 1210074 - Testcase.
http://hg.mozilla.org/mozilla-central/annotate/97e537f85183/dom/html/HTMLLinkElement.cpp#l244 looks odd. Is != ATTR_VALUE_NO_MATCH really right?
I guess on purpose https://bugzilla.mozilla.org/show_bug.cgi?id=103097#c27
And the other parts come from https://bugzilla.mozilla.org/show_bug.cgi?id=123379
But maybe we should do something lower level for bug 1141041 and deal with this stuff in C++ without any events? Not sure.
(In reply to Olli Pettay [:smaug] from comment #5) > But maybe we should do something lower level for bug 1141041 and deal with > this stuff in C++ without any events? Not sure. I had two plans: 1) Use events, like DOMLinkAdded (or StyleSheetAdded, if turning those events on didn't regress tp5) to message the stylesheet list up to the parent for the parent to cache, so the page style menupopup can synchronously access that list 2) Have the parent send down a message when the menupopup is opened, and dynamically inject menuitems into the Page Style menu on a response, assuming the menupopup is still open when the response arrives. I kinda liked the first plan better, since there's less chance of a fast flicker in the menupopup when the user opens it with new nodes getting injected after it opens... Not sure what other low-level options there are. Was there anything in particular you had in mind?
I was just thinking that perhaps HTMLLinkElement could do something like ownrDoc()->docshell->getInterface(nsITabChild)->SendDOMLinkAdded(params..). But perhaps allowing the events to fire always wouldn't be that bad. And removing odd special cases is always good. However, mutationEvents do cause significant slow down. I think I'd be ok to remove the special case to not fire events for stylesheet, but bz might have different opinion.
So the idea of the current code is to optimize out the event firing for <link rel="stylesheet"> for two reasons: 1) The initial consumer of this code (the link toolbar) didn't care about those <link> elements. 2) The original consumer was quite slow at processing the events, so extra events were a bad idea. If we want this specifically for page style, then we need to also respond to @title changes on stylesheets, right?
(In reply to Boris Zbarsky [:bz] from comment #8) > If we want this specifically for page style, then we need to also respond to > @title changes on stylesheets, right? That's true - through the DOMLinkChanged event, I suppose. If this is too much trouble, I don't think it'd be so bad to just fill the menupopup asynchronously.
You need to log in before you can comment on or make changes to this bug.