On May 19, 4:43 pm, fantasai <[EMAIL PROTECTED]> wrote:
> ken wrote:
> > Hi,
>
> > I have a question about SetTextZoom method in DocumentViewerImpl. I
> > think this method is eventully being called when users do the "Text
> > Size->Increase" command.
>
> > But what i notice is when I incease text size, some content get over
> > lapped. For example the 'latest news' in CNN'. Text there will be
> > overlapped when you increase text by 1 times.
>
> This is probably because the page was coded with fixed-size containers:
> it was not coded to accomodate other font sizes. Try zooming on, for
> example, mozilla.org's pages. It does not have this problem until you
> get to much higher zoom levels.
>
> ~fantasai


Thanks.

Can you please tell me what does "aChild->SetTextZoom(textZoomInfo-
>mTextZoom);"
do? Where does it walk thru each text node in the DOM to adjust the
text size?

Thank you.



2643 static void
2644 SetChildTextZoom(nsIMarkupDocumentViewer* aChild, void* aClosure)
2645 {
2646   struct TextZoomInfo* textZoomInfo = (struct TextZoomInfo*)
aClosure;
2647   aChild->SetTextZoom(textZoomInfo->mTextZoom);
2648 }
2649
2650 NS_IMETHODIMP
2651 DocumentViewerImpl::SetTextZoom(float aTextZoom)
2652 {
2653   mTextZoom = aTextZoom;
2654
2655   if (mViewManager) {
2656     mViewManager->BeginUpdateViewBatch();
2657   }
2658
2659   // Set the text zoom on all children of mContainer (even if our
zoom didn't
2660   // change, our children's zoom may be different, though it
would be unusual).
2661   // Do this first, in case kids are auto-sizing and post reflow
commands on
2662   // our presshell (which should be subsumed into our own style
change reflow).
2663   struct TextZoomInfo textZoomInfo = { aTextZoom };
2664   CallChildren(SetChildTextZoom, &textZoomInfo);
2665
2666   // Now change our own zoom
2667   if (mPresContext && aTextZoom != mPresContext->TextZoom()) {
2668       mPresContext->SetTextZoom(aTextZoom);
2669   }
2670
2671   if (mViewManager) {
2672     mViewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
2673   }
2674
2675   return NS_OK;
2676 }

_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to