In article 
<[EMAIL PROTECTED]>,
 "L. David Baron" <[EMAIL PROTECTED]> wrote:

> On Friday 2006-06-02 01:25 +0300, Henri Sivonen wrote:
> > Right now the code lives (for my convenience) in my private copy of 
> > layout/inspector/src/inDOMUtils.cpp. I wouldn't be too surprised if it 
> > was eventually placed somewhere else.
> > 
> > The idea is to implement the algorithm from 
> > https://bugzilla.mozilla.org/show bug.cgi?id=31961
> > in C++.
> 
> Something like this should probably live on nsIMarkupDocumentViewer /
> nsDocumentViewer.

My current patch is at
https://bugzilla.mozilla.org/attachment.cgi?id=224534

Should I move the rest of my JS changes to the C++ side and add an 
autoZoom() method to nsIMarkupDocumentViewer / nsDocumentViewer instead 
of adding a scriptable method for getting the dominant size? If I move 
the code over, what's the right way to get the presShell for the 
nsIDOMDocument? I assume it is not OK for nsDocumentViewer to depend on 
DOM Inspector.

Of course, one could active the autozoom when a negative value is used 
as the zoom level, which would keep the interface as is, but that seem 
dirty. How big a deal is the addition of a method to 
nsIMarkupDocumentViewer which is visible to extensions?

> > I am assuming it always exists for elements that have a defined and 
> > non-null contentDocument property and are neither display: none; nor 
> > visibility: hidden;.
> 
> visibility:hidden isn't particularly interesting and you probably don't
> want to treat it specially.

OK. Not caring about it.

> > The idea is to check if an element that has a contentDocument is "small" 
> > in the sense that its width or height is less than 130px. (This 
> > heuristic should catch most ad <iframe>s.)
> 
> Why not just zoom each document independently?

It didn't occur to me, because I didn't know different frames can be 
zoomed independently. Back in the pre-Firefox days, there was the UI 
option for zooming to a custom level, so I was thinking of picking that 
number automatically.

-- 
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to