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.

What I want to do is, I increase the Text size and the  container of
the text will increase its height so that no content will overlapped.

I have been looking at the SetTextZoom() of DocumentViewerImpl, but I
don't know what does "aChild->SetTextZoom(textZoomInfo->mTextZoom);"
do? Where does it walk thru each text node in the DOM to adjust the
text size?


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