Re: Support for title attribute in tooltips

Johannes Hofmann <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
On Sat, Jul 30, 2011 at 11:38:17PM +0000, corvid wrote:
> Rob wrote:
> > You are all likely to cringe in horror when you see what I have been
> > up to today.  I basically wanted to add hover/tooltip functionality
> > for elements which contain the title attribute.
> 
> I remember discussing this with Johannes, and I think he had some reason
> that he was reluctant to check for the title attr there...? I hope he
> remembers because I can't seem to find record of it.

I guess you are refering to this discussion:

On Wed, Sep 30, 2009 at 05:09:10PM +0200, Johannes Hofmann wrote:
> On Wed, Sep 30, 2009 at 04:31:42AM +0000, corvid wrote:
> > Johannes wrote:
> > > On Sun, Sep 27, 2009 at 06:47:31PM +0000, corvid wrote:
> > > > Also, I tried moving the title attribute check
> > > > to Html_parse_common_attrs because it's part
> > > > of %coreattrs (as the html spec puts it), and
> > > > styleengine's style0() gave me an assertion
> > > > because now I'm doing too much style computation.
> > > > What should I do in light of this?
> > > 
> > > Currently you can call StyleEngine::setNonCssHints() only once per
> > > element. So we would need to pass the CssPropertyList that holds the
> > > NonCssHints until we have collected them all in html.cc and then set
> > > them once.
> > 
> > Another thing to think about if we change the attr stuff
> > around is that gprof shows me
> > (unoptimized, auto img loading off, remote css off,
> >  embedded css on)
> > 
> >   %   cumulative   self              self     total           
> >  time   seconds   seconds    calls  ms/call  ms/call  name    
> >   7.63      2.26     2.26   259353     0.01     0.01  Html_get_attr2(DilloHtml*, char const*, int, char const*, int)
> >   4.23      3.51     1.25                             rgb_to_565d(unsigned char const*, unsigned char*, int, int)
> >   2.40      4.22     0.71   329489     0.00     0.00  dw::Textblock::wordWrap(int)
> >   2.27      4.89     0.67   194573     0.00     0.01  CssStyleSheet::apply(CssPropertyList*, Doctree*, DoctreeNode const*)
> >   1.93      5.46     0.57      382     1.49     9.67  Html_write_raw(DilloHtml*, char*, int, int)
> >   1.62      5.94     0.48   369132     0.00     0.00  lout::object::ConstString::hashValue(char const*)
> >   1.32      6.33     0.39   149410     0.00     0.01  dw::core::Widget::queueResize(int, bool)
> >   1.22      6.69     0.36   745628     0.00     0.00  Html_tag_compare(char const*, char const*)
> > ..
> > 
> > I remember Jorge saying something once about having experimented
> > with a more sophisticated/complicated get_attr system long ago
> > but it not having been worth the complexity at the time.
> > 
> 
> Ah yes, I also thought about parsing attrs in one go and storing the
> result in some data structure.
> Whether this is really faster than the current approach needs to be
> tested.

I'm not opposed to check for a title attribute in every element, we
just need to make sure it doesn't slow things down too much.

Cheers,
Johannes
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.