Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2004-04-18 14:30:37 +00:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla SVG project.
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
* Crocodile Clips Ltd..
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2002
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2004-04-18 14:30:37 +00:00
|
|
|
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 14:30:37 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 14:30:37 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* ***** END LICENSE BLOCK ***** */
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
|
|
|
#include "nsContainerFrame.h"
|
|
|
|
#include "nsIDOMSVGTextElement.h"
|
2004-07-31 23:15:21 +00:00
|
|
|
#include "nsPresContext.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
#include "nsISVGTextFrame.h"
|
|
|
|
#include "nsISVGRendererCanvas.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
#include "nsISVGValue.h"
|
|
|
|
#include "nsISVGValueObserver.h"
|
|
|
|
#include "nsIDOMSVGTransformable.h"
|
|
|
|
#include "nsIDOMSVGAnimTransformList.h"
|
|
|
|
#include "nsIDOMSVGSVGElement.h"
|
|
|
|
#include "nsIDOMSVGMatrix.h"
|
|
|
|
#include "nsIDOMSVGLengthList.h"
|
|
|
|
#include "nsIDOMSVGLength.h"
|
|
|
|
#include "nsISVGValueUtils.h"
|
|
|
|
#include "nsIDOMSVGAnimatedLengthList.h"
|
2004-08-05 09:01:13 +00:00
|
|
|
#include "nsIDOMSVGTransformList.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
#include "nsISVGContainerFrame.h"
|
|
|
|
#include "nsISVGChildFrame.h"
|
|
|
|
#include "nsISVGGlyphFragmentNode.h"
|
|
|
|
#include "nsISVGGlyphFragmentLeaf.h"
|
|
|
|
#include "nsISVGRendererGlyphMetrics.h"
|
|
|
|
#include "nsISVGOuterSVGFrame.h"
|
|
|
|
#include "nsIDOMSVGRect.h"
|
|
|
|
#include "nsISVGTextContentMetrics.h"
|
2004-12-05 22:12:43 +00:00
|
|
|
#include "nsSVGRect.h"
|
2004-12-24 16:26:10 +00:00
|
|
|
#include "nsSVGMatrix.h"
|
2005-04-01 19:56:08 +00:00
|
|
|
#include "nsLayoutAtoms.h"
|
2005-08-26 02:49:52 +00:00
|
|
|
#include "nsISVGPathFlatten.h"
|
|
|
|
#include "nsSVGUtils.h"
|
2005-09-06 22:30:40 +00:00
|
|
|
#include "nsSVGFilterFrame.h"
|
|
|
|
#include "nsSVGUtils.h"
|
2005-12-02 23:57:47 +00:00
|
|
|
#include "nsDOMError.h"
|
2006-01-20 17:00:43 +00:00
|
|
|
#include "nsSVGMaskFrame.h"
|
|
|
|
#include "nsSVGClipPathFrame.h"
|
|
|
|
#include "nsISVGRendererSurface.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
|
|
|
typedef nsContainerFrame nsSVGTextFrameBase;
|
|
|
|
|
|
|
|
class nsSVGTextFrame : public nsSVGTextFrameBase,
|
|
|
|
public nsISVGTextFrame, // : nsISVGTextContainerFrame
|
|
|
|
public nsISVGChildFrame,
|
|
|
|
public nsISVGContainerFrame,
|
|
|
|
public nsISVGValueObserver,
|
|
|
|
public nsISVGTextContentMetrics,
|
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
2005-11-11 02:36:29 +00:00
|
|
|
friend nsIFrame*
|
|
|
|
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
protected:
|
|
|
|
nsSVGTextFrame();
|
|
|
|
virtual ~nsSVGTextFrame();
|
|
|
|
nsresult Init();
|
|
|
|
|
|
|
|
// nsISupports interface:
|
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
|
|
|
private:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
|
|
|
|
public:
|
|
|
|
// nsIFrame:
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD AppendFrames(nsIAtom* aListName,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* aFrameList);
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD InsertFrames(nsIAtom* aListName,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList);
|
2005-02-07 01:58:25 +00:00
|
|
|
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* aOldFrame);
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Init(nsPresContext* aPresContext,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsStyleContext* aContext,
|
|
|
|
nsIFrame* aPrevInFlow);
|
|
|
|
|
2005-09-07 16:49:21 +00:00
|
|
|
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIAtom* aAttribute,
|
2005-04-19 03:48:10 +00:00
|
|
|
PRInt32 aModType);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD DidSetStyleContext(nsPresContext* aPresContext);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-04-01 19:56:08 +00:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsLayoutAtoms::svgTextFrame
|
|
|
|
*/
|
|
|
|
virtual nsIAtom* GetType() const;
|
2006-01-25 21:16:12 +00:00
|
|
|
virtual PRBool IsFrameOfType(PRUint32 aFlags) const;
|
2005-04-01 19:56:08 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("SVGText"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
// nsISVGValueObserver
|
2005-01-16 01:44:52 +00:00
|
|
|
NS_IMETHOD WillModifySVGObservable(nsISVGValue* observable,
|
|
|
|
nsISVGValue::modificationType aModType);
|
|
|
|
NS_IMETHOD DidModifySVGObservable (nsISVGValue* observable,
|
|
|
|
nsISVGValue::modificationType aModType);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
|
|
|
// nsISVGTextContentMetrics
|
|
|
|
NS_IMETHOD GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval);
|
|
|
|
|
|
|
|
// nsISupportsWeakReference
|
|
|
|
// implementation inherited from nsSupportsWeakReference
|
|
|
|
|
|
|
|
// nsISVGChildFrame interface:
|
2005-09-06 22:30:40 +00:00
|
|
|
NS_IMETHOD PaintSVG(nsISVGRendererCanvas* canvas,
|
|
|
|
const nsRect& dirtyRectTwips,
|
|
|
|
PRBool ignoreFilter);
|
2005-04-19 03:48:10 +00:00
|
|
|
NS_IMETHOD GetFrameForPointSVG(float x, float y, nsIFrame** hit);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
NS_IMETHOD_(already_AddRefed<nsISVGRendererRegion>) GetCoveredRegion();
|
|
|
|
NS_IMETHOD InitialUpdate();
|
2005-09-06 22:30:40 +00:00
|
|
|
NS_IMETHOD NotifyCanvasTMChanged(PRBool suppressInvalidation);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
NS_IMETHOD NotifyRedrawSuspended();
|
|
|
|
NS_IMETHOD NotifyRedrawUnsuspended();
|
2004-12-24 16:26:10 +00:00
|
|
|
NS_IMETHOD SetMatrixPropagation(PRBool aPropagate);
|
2005-09-06 22:30:40 +00:00
|
|
|
NS_IMETHOD SetOverrideCTM(nsIDOMSVGMatrix *aCTM);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
NS_IMETHOD GetBBox(nsIDOMSVGRect **_retval);
|
2005-09-06 22:30:40 +00:00
|
|
|
NS_IMETHOD GetFilterRegion(nsISVGRendererRegion **_retval) {
|
|
|
|
*_retval = mFilterRegion;
|
|
|
|
NS_IF_ADDREF(*_retval);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
|
|
|
// nsISVGContainerFrame interface:
|
2004-08-05 09:01:13 +00:00
|
|
|
already_AddRefed<nsIDOMSVGMatrix> GetCanvasTM();
|
|
|
|
already_AddRefed<nsSVGCoordCtxProvider> GetCoordContextProvider();
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
|
|
|
// nsISVGTextFrame interface:
|
|
|
|
NS_IMETHOD_(void) NotifyGlyphMetricsChange(nsISVGGlyphFragmentNode* caller);
|
|
|
|
NS_IMETHOD_(void) NotifyGlyphFragmentTreeChange(nsISVGGlyphFragmentNode* caller);
|
|
|
|
NS_IMETHOD_(PRBool) IsMetricsSuspended();
|
|
|
|
NS_IMETHOD_(PRBool) IsGlyphFragmentTreeSuspended();
|
|
|
|
|
|
|
|
// nsISVGTextContainerFrame interface:
|
|
|
|
NS_IMETHOD_(nsISVGTextFrame *) GetTextFrame();
|
|
|
|
NS_IMETHOD_(PRBool) GetAbsolutePositionAdjustmentX(float &x, PRUint32 charNum);
|
|
|
|
NS_IMETHOD_(PRBool) GetAbsolutePositionAdjustmentY(float &y, PRUint32 charNum);
|
|
|
|
NS_IMETHOD_(PRBool) GetRelativePositionAdjustmentX(float &dx, PRUint32 charNum);
|
|
|
|
NS_IMETHOD_(PRBool) GetRelativePositionAdjustmentY(float &dy, PRUint32 charNum);
|
2005-03-07 04:02:02 +00:00
|
|
|
NS_IMETHOD_(already_AddRefed<nsIDOMSVGLengthList>) GetX();
|
|
|
|
NS_IMETHOD_(already_AddRefed<nsIDOMSVGLengthList>) GetY();
|
|
|
|
NS_IMETHOD_(already_AddRefed<nsIDOMSVGLengthList>) GetDx();
|
|
|
|
NS_IMETHOD_(already_AddRefed<nsIDOMSVGLengthList>) GetDy();
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void EnsureFragmentTreeUpToDate();
|
|
|
|
void UpdateFragmentTree();
|
|
|
|
void UpdateGlyphPositioning();
|
|
|
|
already_AddRefed<nsIDOMSVGAnimatedTransformList> GetTransform();
|
|
|
|
nsISVGGlyphFragmentNode *GetFirstGlyphFragmentChildNode();
|
|
|
|
nsISVGGlyphFragmentNode *GetNextGlyphFragmentChildNode(nsISVGGlyphFragmentNode*node);
|
|
|
|
|
|
|
|
enum UpdateState{
|
|
|
|
unsuspended,
|
|
|
|
suspended,
|
|
|
|
updating};
|
|
|
|
UpdateState mFragmentTreeState;
|
2005-03-07 04:02:02 +00:00
|
|
|
UpdateState mMetricsState;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
PRBool mFragmentTreeDirty;
|
2005-03-07 04:02:02 +00:00
|
|
|
PRBool mPositioningDirty;
|
2004-08-05 09:01:13 +00:00
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMSVGMatrix> mCanvasTM;
|
2005-09-06 22:30:40 +00:00
|
|
|
nsCOMPtr<nsIDOMSVGMatrix> mOverrideCTM;
|
2004-12-24 16:26:10 +00:00
|
|
|
PRBool mPropagateTransform;
|
2005-09-06 22:30:40 +00:00
|
|
|
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> mFilterRegion;
|
|
|
|
nsISVGFilterFrame *mFilter;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
2005-11-11 02:36:29 +00:00
|
|
|
nsIFrame*
|
|
|
|
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTextElement> text_elem = do_QueryInterface(aContent);
|
|
|
|
if (!text_elem) {
|
|
|
|
#ifdef DEBUG
|
|
|
|
printf("warning: trying to construct an SVGTextFrame for a "
|
|
|
|
"content element that doesn't support the right interfaces\n");
|
|
|
|
#endif
|
2005-11-11 02:36:29 +00:00
|
|
|
return nsnull;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
|
2005-11-11 02:36:29 +00:00
|
|
|
return new (aPresShell) nsSVGTextFrame;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsSVGTextFrame::nsSVGTextFrame()
|
|
|
|
: mFragmentTreeState(suspended), mMetricsState(suspended),
|
2004-12-24 16:26:10 +00:00
|
|
|
mFragmentTreeDirty(PR_FALSE), mPositioningDirty(PR_FALSE),
|
2005-09-06 22:30:40 +00:00
|
|
|
mPropagateTransform(PR_TRUE), mFilter(nsnull)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsSVGTextFrame::~nsSVGTextFrame()
|
|
|
|
{
|
|
|
|
// clean up our listener refs:
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetX();
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetY();
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetDx();
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetDy();
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(mContent);
|
|
|
|
NS_ASSERTION(transformable, "wrong content element");
|
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedTransformList> transforms;
|
|
|
|
transformable->GetTransform(getter_AddRefs(transforms));
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(transforms);
|
|
|
|
}
|
2005-09-06 22:30:40 +00:00
|
|
|
|
|
|
|
if (mFilter) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mFilter);
|
|
|
|
}
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult nsSVGTextFrame::Init()
|
|
|
|
{
|
|
|
|
// set us up as a listener for various <text>-properties:
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetX();
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetY();
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetDx();
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> lengthList = GetDy();
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(lengthList);
|
|
|
|
}
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedTransformList> transforms = GetTransform();
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(transforms);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods
|
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsSVGTextFrame)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGTextFrame)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGTextContainerFrame)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGContainerFrame)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGChildFrame)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGTextContentMetrics)
|
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsSVGTextFrameBase)
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIFrame methods
|
|
|
|
NS_IMETHODIMP
|
2004-12-31 01:13:27 +00:00
|
|
|
nsSVGTextFrame::Init(nsPresContext* aPresContext,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsStyleContext* aContext,
|
|
|
|
nsIFrame* aPrevInFlow)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
rv = nsSVGTextFrameBase::Init(aPresContext, aContent, aParent,
|
|
|
|
aContext, aPrevInFlow);
|
|
|
|
|
|
|
|
Init();
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-09-07 16:49:21 +00:00
|
|
|
nsSVGTextFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIAtom* aAttribute,
|
2005-04-19 03:48:10 +00:00
|
|
|
PRInt32 aModType)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
// we don't use this notification mechanism
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
printf("** nsSVGTextFrame::AttributeChanged(");
|
|
|
|
nsAutoString str;
|
|
|
|
aAttribute->ToString(str);
|
2004-07-25 12:18:04 +00:00
|
|
|
printf(NS_ConvertUTF16toUTF8(str).get());
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
printf(")\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2004-07-31 23:15:21 +00:00
|
|
|
nsSVGTextFrame::DidSetStyleContext(nsPresContext* aPresContext)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
printf("** nsSVGTextFrame::DidSetStyleContext\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-04-01 19:56:08 +00:00
|
|
|
nsIAtom *
|
|
|
|
nsSVGTextFrame::GetType() const
|
|
|
|
{
|
|
|
|
return nsLayoutAtoms::svgTextFrame;
|
|
|
|
}
|
|
|
|
|
2006-01-25 21:16:12 +00:00
|
|
|
PRBool
|
|
|
|
nsSVGTextFrame::IsFrameOfType(PRUint32 aFlags) const
|
|
|
|
{
|
|
|
|
return !(aFlags & ~nsIFrame::eSVG);
|
|
|
|
}
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
NS_IMETHODIMP
|
2005-02-07 01:58:25 +00:00
|
|
|
nsSVGTextFrame::AppendFrames(nsIAtom* aListName,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* aFrameList)
|
|
|
|
{
|
|
|
|
// append == insert at end:
|
2005-02-07 01:58:25 +00:00
|
|
|
return InsertFrames(aListName, mFrames.LastChild(), aFrameList);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-02-07 01:58:25 +00:00
|
|
|
nsSVGTextFrame::InsertFrames(nsIAtom* aListName,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList)
|
|
|
|
{
|
|
|
|
// memorize last new frame
|
|
|
|
nsIFrame* lastNewFrame = nsnull;
|
|
|
|
{
|
|
|
|
nsFrameList tmpList(aFrameList);
|
|
|
|
lastNewFrame = tmpList.LastChild();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Insert the new frames
|
|
|
|
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
|
|
|
|
|
|
|
|
// call InitialUpdate() on all new frames:
|
|
|
|
nsIFrame* kid = aFrameList;
|
|
|
|
nsIFrame* end = nsnull;
|
|
|
|
if (lastNewFrame)
|
|
|
|
end = lastNewFrame->GetNextSibling();
|
|
|
|
|
|
|
|
while (kid != end) {
|
|
|
|
nsISVGChildFrame* SVGFrame=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame) {
|
|
|
|
SVGFrame->InitialUpdate();
|
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-02-07 01:58:25 +00:00
|
|
|
nsSVGTextFrame::RemoveFrame(nsIAtom* aListName,
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> dirty_region;
|
|
|
|
|
|
|
|
nsISVGChildFrame* SVGFrame=nsnull;
|
|
|
|
aOldFrame->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
|
|
|
|
if (SVGFrame)
|
|
|
|
dirty_region = SVGFrame->GetCoveredRegion();
|
|
|
|
|
2005-02-07 01:58:25 +00:00
|
|
|
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2006-02-13 21:22:41 +00:00
|
|
|
nsISVGOuterSVGFrame* outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
NS_ASSERTION(outerSVGFrame, "no outer svg frame");
|
|
|
|
|
|
|
|
if (SVGFrame && outerSVGFrame) {
|
|
|
|
// XXX We need to rebuild the fragment tree starting from the
|
|
|
|
// removed frame. Let's just rebuild the whole tree for now
|
|
|
|
outerSVGFrame->SuspendRedraw();
|
|
|
|
mFragmentTreeDirty = PR_TRUE;
|
|
|
|
|
|
|
|
if (dirty_region) {
|
|
|
|
outerSVGFrame->InvalidateRegion(dirty_region, PR_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
outerSVGFrame->UnsuspendRedraw();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_ASSERTION(result, "didn't find frame to delete");
|
|
|
|
return result ? NS_OK : NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGValueObserver methods:
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-01-16 01:44:52 +00:00
|
|
|
nsSVGTextFrame::WillModifySVGObservable(nsISVGValue* observable,
|
|
|
|
nsISVGValue::modificationType aModType)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
2005-09-06 22:30:40 +00:00
|
|
|
nsISVGFilterFrame *filter;
|
|
|
|
CallQueryInterface(observable, &filter);
|
|
|
|
|
|
|
|
// need to handle filters because we might be the topmost filtered frame and
|
|
|
|
// the filter region could be changing.
|
|
|
|
if (filter && mFilterRegion) {
|
2006-02-13 21:22:41 +00:00
|
|
|
nsISVGOuterSVGFrame *outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
|
2005-09-06 22:30:40 +00:00
|
|
|
if (!outerSVGFrame)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> region;
|
|
|
|
nsSVGUtils::FindFilterInvalidation(this, getter_AddRefs(region));
|
|
|
|
outerSVGFrame->InvalidateRegion(region, PR_TRUE);
|
|
|
|
}
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-01-16 01:44:52 +00:00
|
|
|
nsSVGTextFrame::DidModifySVGObservable (nsISVGValue* observable,
|
|
|
|
nsISVGValue::modificationType aModType)
|
2004-08-05 09:01:13 +00:00
|
|
|
{
|
2005-09-06 22:30:40 +00:00
|
|
|
nsISVGFilterFrame *filter;
|
|
|
|
CallQueryInterface(observable, &filter);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedTransformList> transforms = GetTransform();
|
2005-09-06 22:30:40 +00:00
|
|
|
|
|
|
|
if (filter) {
|
|
|
|
if (aModType == nsISVGValue::mod_die) {
|
|
|
|
mFilter = nsnull;
|
|
|
|
mFilterRegion = nsnull;
|
|
|
|
}
|
|
|
|
|
2006-02-13 21:22:41 +00:00
|
|
|
nsISVGOuterSVGFrame *outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
|
2005-09-06 22:30:40 +00:00
|
|
|
if (!outerSVGFrame)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
if (mFilter)
|
|
|
|
mFilter->GetInvalidationRegion(this, getter_AddRefs(mFilterRegion));
|
|
|
|
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> region;
|
|
|
|
nsSVGUtils::FindFilterInvalidation(this, getter_AddRefs(region));
|
|
|
|
|
|
|
|
if (region)
|
|
|
|
outerSVGFrame->InvalidateRegion(region, PR_TRUE);
|
|
|
|
} else if (SameCOMIdentity(observable, transforms)) {
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
// transform has changed
|
2004-08-05 09:01:13 +00:00
|
|
|
|
|
|
|
// make sure our cached transform matrix gets (lazily) updated
|
|
|
|
mCanvasTM = nsnull;
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=0;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame)
|
2005-09-06 22:30:40 +00:00
|
|
|
SVGFrame->NotifyCanvasTMChanged(PR_FALSE);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// x, y have changed
|
|
|
|
mPositioningDirty = PR_TRUE;
|
|
|
|
if (mMetricsState == unsuspended) {
|
|
|
|
UpdateGlyphPositioning();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGTextContentMetrics
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGTextFrame::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval)
|
|
|
|
{
|
|
|
|
EnsureFragmentTreeUpToDate();
|
|
|
|
|
2005-12-02 23:57:47 +00:00
|
|
|
nsISVGGlyphFragmentNode* node = GetFirstGlyphFragmentChildNode();
|
|
|
|
if (!node) return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
|
|
|
return nsSVGUtils::GetExtentOfChar(node, charnum, _retval);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGChildFrame methods
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-09-06 22:30:40 +00:00
|
|
|
nsSVGTextFrame::PaintSVG(nsISVGRendererCanvas* canvas,
|
|
|
|
const nsRect& dirtyRectTwips,
|
|
|
|
PRBool ignoreFilter)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
// printf("nsSVGTextFrame(%p)::Paint\n", this);
|
|
|
|
#endif
|
|
|
|
|
2006-01-20 17:00:43 +00:00
|
|
|
const nsStyleDisplay *display = mStyleContext->GetStyleDisplay();
|
|
|
|
if (display->mOpacity == 0.0)
|
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
nsIURI *aURI;
|
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
/* check for filter */
|
|
|
|
|
|
|
|
if (!ignoreFilter) {
|
|
|
|
if (!mFilter) {
|
2006-01-20 17:00:43 +00:00
|
|
|
aURI = GetStyleSVGReset()->mFilter;
|
2005-09-06 22:30:40 +00:00
|
|
|
if (aURI)
|
|
|
|
NS_GetSVGFilterFrame(&mFilter, aURI, mContent);
|
|
|
|
if (mFilter)
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(mFilter);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mFilter) {
|
|
|
|
if (!mFilterRegion)
|
|
|
|
mFilter->GetInvalidationRegion(this, getter_AddRefs(mFilterRegion));
|
|
|
|
mFilter->FilterPaint(canvas, this);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-13 21:22:41 +00:00
|
|
|
nsISVGOuterSVGFrame* outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
|
2006-01-20 17:00:43 +00:00
|
|
|
|
|
|
|
/* check for a clip path */
|
|
|
|
|
|
|
|
PRBool trivialClip = PR_TRUE;
|
|
|
|
nsISVGClipPathFrame *clip = NULL;
|
|
|
|
nsCOMPtr<nsISVGRendererSurface> clipMaskSurface;
|
|
|
|
|
|
|
|
aURI = GetStyleSVGReset()->mClipPath;
|
|
|
|
if (aURI) {
|
|
|
|
NS_GetSVGClipPathFrame(&clip, aURI, mContent);
|
|
|
|
|
|
|
|
if (clip) {
|
|
|
|
clip->IsTrivial(&trivialClip);
|
|
|
|
|
|
|
|
if (trivialClip) {
|
|
|
|
canvas->PushClip();
|
|
|
|
} else {
|
2006-01-30 17:53:26 +00:00
|
|
|
nsSVGUtils::GetSurface(outerSVGFrame, canvas,
|
|
|
|
getter_AddRefs(clipMaskSurface));
|
2006-01-20 17:00:43 +00:00
|
|
|
if (!clipMaskSurface)
|
|
|
|
clip = nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clip) {
|
|
|
|
nsCOMPtr<nsIDOMSVGMatrix> matrix = GetCanvasTM();
|
|
|
|
clip->ClipPaint(canvas, clipMaskSurface, this, matrix);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check for mask */
|
|
|
|
|
|
|
|
nsISVGMaskFrame *mask = nsnull;
|
|
|
|
nsCOMPtr<nsISVGRendererSurface> maskSurface, maskedSurface;
|
|
|
|
|
|
|
|
aURI = GetStyleSVGReset()->mMask;
|
|
|
|
if (aURI) {
|
|
|
|
NS_GetSVGMaskFrame(&mask, aURI, mContent);
|
|
|
|
|
|
|
|
if (mask) {
|
2006-01-30 17:53:26 +00:00
|
|
|
nsSVGUtils::GetSurface(outerSVGFrame, canvas,
|
|
|
|
getter_AddRefs(maskSurface));
|
2006-01-20 17:00:43 +00:00
|
|
|
|
|
|
|
if (maskSurface) {
|
|
|
|
nsCOMPtr<nsIDOMSVGMatrix> matrix = GetCanvasTM();
|
|
|
|
if (NS_FAILED(mask->MaskPaint(canvas, maskSurface, this, matrix,
|
|
|
|
display->mOpacity)))
|
|
|
|
maskSurface = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (maskSurface || clipMaskSurface || display->mOpacity != 1.0) {
|
2006-01-30 17:53:26 +00:00
|
|
|
nsSVGUtils::GetSurface(outerSVGFrame, canvas,
|
|
|
|
getter_AddRefs(maskedSurface));
|
2006-01-20 17:00:43 +00:00
|
|
|
if (maskedSurface) {
|
|
|
|
canvas->PushSurface(maskedSurface);
|
|
|
|
} else
|
|
|
|
maskSurface = nsnull;
|
|
|
|
}
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=0;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame)
|
2005-09-06 22:30:40 +00:00
|
|
|
SVGFrame->PaintSVG(canvas, dirtyRectTwips, PR_FALSE);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
2006-01-20 17:00:43 +00:00
|
|
|
if (maskedSurface)
|
|
|
|
canvas->PopSurface();
|
|
|
|
|
|
|
|
if (clipMaskSurface) {
|
|
|
|
if (!maskSurface && display->mOpacity == 1.0) {
|
|
|
|
maskSurface = clipMaskSurface;
|
|
|
|
} else {
|
|
|
|
nsCOMPtr<nsISVGRendererSurface> clipped;
|
2006-01-30 17:53:26 +00:00
|
|
|
nsSVGUtils::GetSurface(outerSVGFrame, canvas,
|
|
|
|
getter_AddRefs(clipped));
|
2006-01-20 17:00:43 +00:00
|
|
|
|
|
|
|
canvas->PushSurface(clipped);
|
|
|
|
canvas->CompositeSurfaceWithMask(maskedSurface, 0, 0, clipMaskSurface);
|
|
|
|
canvas->PopSurface();
|
|
|
|
maskedSurface = clipped;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (maskSurface)
|
|
|
|
canvas->CompositeSurfaceWithMask(maskedSurface, 0, 0, maskSurface);
|
|
|
|
else if (display->mOpacity != 1.0)
|
|
|
|
canvas->CompositeSurface(maskedSurface, 0, 0, display->mOpacity);
|
|
|
|
|
|
|
|
if (clip && trivialClip)
|
|
|
|
canvas->PopClip();
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-04-19 03:48:10 +00:00
|
|
|
nsSVGTextFrame::GetFrameForPointSVG(float x, float y, nsIFrame** hit)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
// printf("nsSVGTextFrame(%p)::GetFrameForPoint\n", this);
|
|
|
|
#endif
|
|
|
|
*hit = nsnull;
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=0;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame) {
|
|
|
|
nsIFrame* temp=nsnull;
|
2005-04-19 03:48:10 +00:00
|
|
|
nsresult rv = SVGFrame->GetFrameForPointSVG(x, y, &temp);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
if (NS_SUCCEEDED(rv) && temp) {
|
|
|
|
*hit = temp;
|
|
|
|
// return NS_OK; can't return. we need reverse order but only
|
|
|
|
// have a singly linked list...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
return *hit ? NS_OK : NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(already_AddRefed<nsISVGRendererRegion>)
|
|
|
|
nsSVGTextFrame::GetCoveredRegion()
|
|
|
|
{
|
|
|
|
nsISVGRendererRegion *accu_region=nsnull;
|
|
|
|
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=0;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame) {
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> dirty_region = SVGFrame->GetCoveredRegion();
|
|
|
|
if (dirty_region) {
|
|
|
|
if (accu_region) {
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> temp = dont_AddRef(accu_region);
|
|
|
|
dirty_region->Combine(temp, &accu_region);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
accu_region = dirty_region;
|
|
|
|
NS_IF_ADDREF(accu_region);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
return accu_region;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGTextFrame::InitialUpdate()
|
|
|
|
{
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=0;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame) {
|
|
|
|
SVGFrame->InitialUpdate();
|
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
2006-02-13 21:22:41 +00:00
|
|
|
nsISVGOuterSVGFrame *outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
if (!outerSVGFrame) {
|
|
|
|
NS_ERROR("null outerSVGFrame");
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool suspended;
|
|
|
|
outerSVGFrame->IsRedrawSuspended(&suspended);
|
|
|
|
if (!suspended) NS_ERROR("initialupdate while redraw not suspended! need to update fragment tree");
|
|
|
|
//XXX
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-09-06 22:30:40 +00:00
|
|
|
nsSVGTextFrame::NotifyCanvasTMChanged(PRBool suppressInvalidation)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
2004-08-05 09:01:13 +00:00
|
|
|
// make sure our cached transform matrix gets (lazily) updated
|
|
|
|
mCanvasTM = nsnull;
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=0;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame) {
|
2005-09-06 22:30:40 +00:00
|
|
|
SVGFrame->NotifyCanvasTMChanged(suppressInvalidation);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGTextFrame::NotifyRedrawSuspended()
|
|
|
|
{
|
|
|
|
mMetricsState = suspended;
|
|
|
|
mFragmentTreeState = suspended;
|
|
|
|
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame) {
|
|
|
|
SVGFrame->NotifyRedrawSuspended();
|
|
|
|
}
|
|
|
|
nsISVGGlyphFragmentNode* fragmentNode=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode), (void**)&fragmentNode);
|
|
|
|
if (fragmentNode) {
|
|
|
|
fragmentNode->NotifyMetricsSuspended();
|
|
|
|
fragmentNode->NotifyGlyphFragmentTreeSuspended();
|
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGTextFrame::NotifyRedrawUnsuspended()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mMetricsState == suspended, "metrics state not suspended during redraw");
|
|
|
|
NS_ASSERTION(mFragmentTreeState == suspended, "fragment tree not suspended during redraw");
|
|
|
|
|
|
|
|
// 3 passes:
|
|
|
|
mFragmentTreeState = updating;
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGGlyphFragmentNode* node=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode), (void**)&node);
|
|
|
|
if (node)
|
|
|
|
node->NotifyGlyphFragmentTreeUnsuspended();
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
mFragmentTreeState = unsuspended;
|
|
|
|
if (mFragmentTreeDirty)
|
|
|
|
UpdateFragmentTree();
|
|
|
|
|
|
|
|
mMetricsState = updating;
|
|
|
|
kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGGlyphFragmentNode* node=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode), (void**)&node);
|
|
|
|
if (node)
|
|
|
|
node->NotifyMetricsUnsuspended();
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
mMetricsState = unsuspended;
|
|
|
|
if (mPositioningDirty)
|
|
|
|
UpdateGlyphPositioning();
|
|
|
|
|
|
|
|
kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* SVGFrame=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);
|
|
|
|
if (SVGFrame) {
|
|
|
|
SVGFrame->NotifyRedrawUnsuspended();
|
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2004-12-24 16:26:10 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGTextFrame::SetMatrixPropagation(PRBool aPropagate)
|
|
|
|
{
|
|
|
|
mPropagateTransform = aPropagate;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGTextFrame::SetOverrideCTM(nsIDOMSVGMatrix *aCTM)
|
|
|
|
{
|
|
|
|
mOverrideCTM = aCTM;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGTextFrame::GetBBox(nsIDOMSVGRect **_retval)
|
|
|
|
{
|
|
|
|
EnsureFragmentTreeUpToDate();
|
2005-08-26 02:49:52 +00:00
|
|
|
return nsSVGUtils::GetBBox(&mFrames, _retval);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGContainerFrame methods:
|
|
|
|
|
2004-08-05 09:01:13 +00:00
|
|
|
already_AddRefed<nsIDOMSVGMatrix>
|
|
|
|
nsSVGTextFrame::GetCanvasTM()
|
|
|
|
{
|
2005-09-06 22:30:40 +00:00
|
|
|
if (!mPropagateTransform) {
|
|
|
|
nsIDOMSVGMatrix *retval;
|
|
|
|
if (mOverrideCTM) {
|
|
|
|
retval = mOverrideCTM;
|
|
|
|
NS_ADDREF(retval);
|
|
|
|
} else {
|
2004-12-24 16:26:10 +00:00
|
|
|
NS_NewSVGMatrix(&retval);
|
|
|
|
}
|
2005-09-06 22:30:40 +00:00
|
|
|
return retval;
|
|
|
|
}
|
2004-12-24 16:26:10 +00:00
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
if (!mCanvasTM) {
|
2004-08-05 09:01:13 +00:00
|
|
|
// get our parent's tm and append local transforms (if any):
|
|
|
|
NS_ASSERTION(mParent, "null parent");
|
|
|
|
nsISVGContainerFrame *containerFrame;
|
|
|
|
mParent->QueryInterface(NS_GET_IID(nsISVGContainerFrame), (void**)&containerFrame);
|
|
|
|
if (!containerFrame) {
|
|
|
|
NS_ERROR("invalid parent");
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
nsCOMPtr<nsIDOMSVGMatrix> parentTM = containerFrame->GetCanvasTM();
|
|
|
|
NS_ASSERTION(parentTM, "null TM");
|
|
|
|
|
|
|
|
// got the parent tm, now check for local tm:
|
|
|
|
nsCOMPtr<nsIDOMSVGMatrix> localTM;
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(mContent);
|
|
|
|
NS_ASSERTION(transformable, "wrong content element");
|
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedTransformList> atl;
|
|
|
|
transformable->GetTransform(getter_AddRefs(atl));
|
|
|
|
NS_ASSERTION(atl, "null animated transform list");
|
|
|
|
nsCOMPtr<nsIDOMSVGTransformList> transforms;
|
|
|
|
atl->GetAnimVal(getter_AddRefs(transforms));
|
|
|
|
NS_ASSERTION(transforms, "null transform list");
|
|
|
|
PRUint32 numberOfItems;
|
|
|
|
transforms->GetNumberOfItems(&numberOfItems);
|
|
|
|
if (numberOfItems>0)
|
2004-08-09 14:44:54 +00:00
|
|
|
transforms->GetConsolidationMatrix(getter_AddRefs(localTM));
|
2004-08-05 09:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (localTM)
|
|
|
|
parentTM->Multiply(localTM, getter_AddRefs(mCanvasTM));
|
|
|
|
else
|
|
|
|
mCanvasTM = parentTM;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIDOMSVGMatrix* retval = mCanvasTM.get();
|
|
|
|
NS_IF_ADDREF(retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<nsSVGCoordCtxProvider>
|
|
|
|
nsSVGTextFrame::GetCoordContextProvider()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mParent, "null parent");
|
|
|
|
|
|
|
|
nsISVGContainerFrame *containerFrame;
|
|
|
|
mParent->QueryInterface(NS_GET_IID(nsISVGContainerFrame), (void**)&containerFrame);
|
|
|
|
if (!containerFrame) {
|
|
|
|
NS_ERROR("invalid container");
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
return containerFrame->GetCoordContextProvider();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGTextFrame methods
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(void)
|
|
|
|
nsSVGTextFrame::NotifyGlyphMetricsChange(nsISVGGlyphFragmentNode* caller)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mMetricsState!=suspended, "notification during suspension");
|
|
|
|
mPositioningDirty = PR_TRUE;
|
|
|
|
if (mMetricsState == unsuspended) {
|
|
|
|
UpdateGlyphPositioning();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(void)
|
|
|
|
nsSVGTextFrame::NotifyGlyphFragmentTreeChange(nsISVGGlyphFragmentNode* caller)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mFragmentTreeState!=suspended, "notification during suspension");
|
|
|
|
mFragmentTreeDirty = PR_TRUE;
|
|
|
|
if (mFragmentTreeState == unsuspended) {
|
|
|
|
UpdateFragmentTree();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(PRBool)
|
|
|
|
nsSVGTextFrame::IsMetricsSuspended()
|
|
|
|
{
|
|
|
|
return (mMetricsState != unsuspended);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(PRBool)
|
|
|
|
nsSVGTextFrame::IsGlyphFragmentTreeSuspended()
|
|
|
|
{
|
|
|
|
return (mFragmentTreeState != unsuspended);
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGTextContainerFrame methods:
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(nsISVGTextFrame *)
|
|
|
|
nsSVGTextFrame::GetTextFrame()
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(PRBool)
|
|
|
|
nsSVGTextFrame::GetAbsolutePositionAdjustmentX(float &x, PRUint32 charNum)
|
|
|
|
{
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(PRBool)
|
|
|
|
nsSVGTextFrame::GetAbsolutePositionAdjustmentY(float &y, PRUint32 charNum)
|
|
|
|
{
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(PRBool)
|
|
|
|
nsSVGTextFrame::GetRelativePositionAdjustmentX(float &dx, PRUint32 charNum)
|
|
|
|
{
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(PRBool)
|
|
|
|
nsSVGTextFrame::GetRelativePositionAdjustmentY(float &dy, PRUint32 charNum)
|
|
|
|
{
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
|
|
|
|
// ensure that the tree and positioning of the nodes is up-to-date
|
|
|
|
void
|
|
|
|
nsSVGTextFrame::EnsureFragmentTreeUpToDate()
|
|
|
|
{
|
|
|
|
PRBool resuspend_fragmenttree = PR_FALSE;
|
|
|
|
PRBool resuspend_metrics = PR_FALSE;
|
|
|
|
|
|
|
|
// give children a chance to flush their change notifications:
|
|
|
|
|
|
|
|
if (mFragmentTreeState == suspended) {
|
|
|
|
resuspend_fragmenttree = PR_TRUE;
|
|
|
|
mFragmentTreeState = updating;
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGGlyphFragmentNode* node=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode), (void**)&node);
|
|
|
|
if (node)
|
|
|
|
node->NotifyGlyphFragmentTreeUnsuspended();
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
mFragmentTreeState = unsuspended;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mFragmentTreeDirty)
|
|
|
|
UpdateFragmentTree();
|
|
|
|
|
|
|
|
if (mMetricsState == suspended) {
|
|
|
|
resuspend_metrics = PR_TRUE;
|
|
|
|
mMetricsState = updating;
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGGlyphFragmentNode* node=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode), (void**)&node);
|
|
|
|
if (node)
|
|
|
|
node->NotifyMetricsUnsuspended();
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
mMetricsState = unsuspended;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mPositioningDirty)
|
|
|
|
UpdateGlyphPositioning();
|
|
|
|
|
|
|
|
if (resuspend_fragmenttree || resuspend_metrics) {
|
|
|
|
mMetricsState = suspended;
|
|
|
|
mFragmentTreeState = suspended;
|
|
|
|
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGGlyphFragmentNode* fragmentNode=nsnull;
|
|
|
|
kid->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode), (void**)&fragmentNode);
|
|
|
|
if (fragmentNode) {
|
|
|
|
fragmentNode->NotifyMetricsSuspended();
|
|
|
|
fragmentNode->NotifyGlyphFragmentTreeSuspended();
|
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsSVGTextFrame::UpdateFragmentTree()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mFragmentTreeState == unsuspended, "updating during suspension!");
|
|
|
|
|
|
|
|
PRUint32 charNum = 0;
|
|
|
|
|
|
|
|
nsISVGGlyphFragmentNode* node = GetFirstGlyphFragmentChildNode();
|
|
|
|
nsISVGGlyphFragmentNode* next;
|
|
|
|
while (node) {
|
|
|
|
next = GetNextGlyphFragmentChildNode(node);
|
|
|
|
charNum = node->BuildGlyphFragmentTree(charNum, !next);
|
|
|
|
node = next;
|
|
|
|
}
|
|
|
|
|
|
|
|
mFragmentTreeDirty = PR_FALSE;
|
|
|
|
|
|
|
|
mPositioningDirty = PR_TRUE;
|
|
|
|
if (mMetricsState == unsuspended)
|
|
|
|
UpdateGlyphPositioning();
|
|
|
|
}
|
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
static void
|
2005-08-26 02:49:52 +00:00
|
|
|
GetSingleValue(nsISVGGlyphFragmentLeaf *fragment,
|
|
|
|
nsIDOMSVGLengthList *list, float *val)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
{
|
2005-03-07 04:02:02 +00:00
|
|
|
if (!list)
|
|
|
|
return;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
PRUint32 count = 0;
|
|
|
|
list->GetNumberOfItems(&count);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
#ifdef DEBUG
|
2005-03-07 04:02:02 +00:00
|
|
|
if (count > 1)
|
|
|
|
NS_WARNING("multiple lengths for x/y attributes on <text> elements not implemented yet!");
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
#endif
|
2005-03-07 04:02:02 +00:00
|
|
|
if (count) {
|
|
|
|
nsCOMPtr<nsIDOMSVGLength> length;
|
|
|
|
list->GetItem(0, getter_AddRefs(length));
|
|
|
|
length->GetValue(val);
|
2005-08-26 02:49:52 +00:00
|
|
|
|
|
|
|
/* check for % sizing of textpath */
|
|
|
|
PRUint16 type;
|
|
|
|
length->GetUnitType(&type);
|
|
|
|
if (type == nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE) {
|
|
|
|
nsIFrame *glyph;
|
|
|
|
CallQueryInterface(fragment, &glyph);
|
|
|
|
|
|
|
|
nsISVGPathFlatten *textPath = nsnull;
|
|
|
|
/* check if we're the child of a textPath */
|
|
|
|
for (nsIFrame *frame = glyph; frame != nsnull; frame = frame->GetParent())
|
|
|
|
if (frame->GetType() == nsLayoutAtoms::svgTextPathFrame) {
|
|
|
|
frame->QueryInterface(NS_GET_IID(nsISVGPathFlatten),
|
|
|
|
(void **)&textPath);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (textPath) {
|
|
|
|
nsSVGPathData *data;
|
|
|
|
textPath->GetFlattenedPath(&data, nsnull);
|
|
|
|
|
|
|
|
if (!data)
|
|
|
|
return;
|
|
|
|
|
|
|
|
float percent;
|
|
|
|
length->GetValueInSpecifiedUnits(&percent);
|
|
|
|
|
|
|
|
*val = data->Length()*percent/100.0f;
|
|
|
|
delete data;
|
|
|
|
}
|
|
|
|
}
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
2005-03-07 04:02:02 +00:00
|
|
|
}
|
2005-02-18 16:30:12 +00:00
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
void
|
|
|
|
nsSVGTextFrame::UpdateGlyphPositioning()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mMetricsState == unsuspended, "updating during suspension");
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
nsISVGGlyphFragmentNode *node = GetFirstGlyphFragmentChildNode();
|
|
|
|
if (!node) return;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
|
|
|
// we'll align every fragment in this chunk on the dominant-baseline:
|
|
|
|
// XXX should actually inspect 'alignment-baseline' for each fragment
|
|
|
|
|
|
|
|
PRUint8 baseline;
|
2004-12-04 06:31:02 +00:00
|
|
|
switch(GetStyleSVGReset()->mDominantBaseline) {
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
case NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_TEXT_BEFORE_EDGE;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_TEXT_AFTER_EDGE;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_MIDDLE:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_MIDDLE;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_CENTRAL:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_CENTRAL;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_MATHEMATICAL;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_IDEOGRAPHC;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_HANGING:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_HANGING;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_AUTO:
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT:
|
|
|
|
case NS_STYLE_DOMINANT_BASELINE_ALPHABETIC:
|
|
|
|
default:
|
|
|
|
baseline = nsISVGRendererGlyphMetrics::BASELINE_ALPHABETIC;
|
|
|
|
break;
|
|
|
|
}
|
2005-03-07 04:02:02 +00:00
|
|
|
|
|
|
|
nsISVGGlyphFragmentLeaf *fragment, *firstFragment;
|
|
|
|
|
|
|
|
firstFragment = node->GetFirstGlyphFragment();
|
|
|
|
|
2006-02-17 16:30:23 +00:00
|
|
|
float x = 0, y = 0;
|
2005-10-03 01:21:00 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> list = GetX();
|
|
|
|
GetSingleValue(firstFragment, list, &x);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> list = GetY();
|
|
|
|
GetSingleValue(firstFragment, list, &y);
|
|
|
|
}
|
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
// loop over chunks
|
|
|
|
while (firstFragment) {
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> list = firstFragment->GetX();
|
2005-08-26 02:49:52 +00:00
|
|
|
GetSingleValue(firstFragment, list, &x);
|
2005-03-07 04:02:02 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> list = firstFragment->GetY();
|
2005-08-26 02:49:52 +00:00
|
|
|
GetSingleValue(firstFragment, list, &y);
|
2005-03-07 04:02:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// determine x offset based on text_anchor:
|
|
|
|
|
|
|
|
PRUint8 anchor = firstFragment->GetTextAnchor();
|
|
|
|
|
|
|
|
float chunkLength = 0.0f;
|
|
|
|
if (anchor != NS_STYLE_TEXT_ANCHOR_START) {
|
|
|
|
// need to get the total chunk length
|
|
|
|
|
|
|
|
fragment = firstFragment;
|
|
|
|
while (fragment) {
|
|
|
|
nsCOMPtr<nsISVGRendererGlyphMetrics> metrics;
|
|
|
|
fragment->GetGlyphMetrics(getter_AddRefs(metrics));
|
|
|
|
if (!metrics) continue;
|
|
|
|
|
2005-10-03 01:21:00 +00:00
|
|
|
float advance, dx = 0.0f;
|
2005-03-07 04:02:02 +00:00
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> list = fragment->GetDx();
|
2005-08-26 02:49:52 +00:00
|
|
|
GetSingleValue(fragment, list, &dx);
|
2005-03-07 04:02:02 +00:00
|
|
|
metrics->GetAdvance(&advance);
|
|
|
|
chunkLength += advance + dx;
|
|
|
|
fragment = fragment->GetNextGlyphFragment();
|
|
|
|
if (fragment && fragment->IsAbsolutelyPositioned())
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (anchor == NS_STYLE_TEXT_ANCHOR_MIDDLE)
|
|
|
|
x -= chunkLength/2.0f;
|
|
|
|
else if (anchor == NS_STYLE_TEXT_ANCHOR_END)
|
|
|
|
x -= chunkLength;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
// set position of each fragment in this chunk:
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
fragment = firstFragment;
|
|
|
|
while (fragment) {
|
|
|
|
nsCOMPtr<nsISVGRendererGlyphMetrics> metrics;
|
|
|
|
fragment->GetGlyphMetrics(getter_AddRefs(metrics));
|
|
|
|
if (!metrics) continue;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-10-03 01:21:00 +00:00
|
|
|
float baseline_offset, dx = 0.0f, dy = 0.0f;
|
2005-03-07 04:02:02 +00:00
|
|
|
metrics->GetBaselineOffset(baseline, &baseline_offset);
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> list = fragment->GetDx();
|
2005-08-26 02:49:52 +00:00
|
|
|
GetSingleValue(fragment, list, &dx);
|
2005-03-07 04:02:02 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGLengthList> list = fragment->GetDy();
|
2005-08-26 02:49:52 +00:00
|
|
|
GetSingleValue(fragment, list, &dy);
|
2005-03-07 04:02:02 +00:00
|
|
|
}
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
fragment->SetGlyphPosition(x + dx, y + dy - baseline_offset);
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
float advance;
|
|
|
|
metrics->GetAdvance(&advance);
|
|
|
|
x += dx + advance;
|
|
|
|
y += dy;
|
|
|
|
fragment = fragment->GetNextGlyphFragment();
|
|
|
|
if (fragment && fragment->IsAbsolutelyPositioned())
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
firstFragment = fragment;
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mPositioningDirty = PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
NS_IMETHODIMP_(already_AddRefed<nsIDOMSVGLengthList>)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsSVGTextFrame::GetX()
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTextPositioningElement> tpElement = do_QueryInterface(mContent);
|
|
|
|
NS_ASSERTION(tpElement, "wrong content element");
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedLengthList> animLengthList;
|
|
|
|
tpElement->GetX(getter_AddRefs(animLengthList));
|
|
|
|
nsIDOMSVGLengthList *retval;
|
|
|
|
animLengthList->GetAnimVal(&retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
NS_IMETHODIMP_(already_AddRefed<nsIDOMSVGLengthList>)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
nsSVGTextFrame::GetY()
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTextPositioningElement> tpElement = do_QueryInterface(mContent);
|
|
|
|
NS_ASSERTION(tpElement, "wrong content element");
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedLengthList> animLengthList;
|
|
|
|
tpElement->GetY(getter_AddRefs(animLengthList));
|
|
|
|
nsIDOMSVGLengthList *retval;
|
|
|
|
animLengthList->GetAnimVal(&retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2005-03-07 04:02:02 +00:00
|
|
|
NS_IMETHODIMP_(already_AddRefed<nsIDOMSVGLengthList>)
|
|
|
|
nsSVGTextFrame::GetDx()
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTextPositioningElement> tpElement = do_QueryInterface(mContent);
|
|
|
|
NS_ASSERTION(tpElement, "wrong content element");
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedLengthList> animLengthList;
|
|
|
|
tpElement->GetDx(getter_AddRefs(animLengthList));
|
|
|
|
nsIDOMSVGLengthList *retval;
|
|
|
|
animLengthList->GetAnimVal(&retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(already_AddRefed<nsIDOMSVGLengthList>)
|
|
|
|
nsSVGTextFrame::GetDy()
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTextPositioningElement> tpElement = do_QueryInterface(mContent);
|
|
|
|
NS_ASSERTION(tpElement, "wrong content element");
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMSVGAnimatedLengthList> animLengthList;
|
|
|
|
tpElement->GetDy(getter_AddRefs(animLengthList));
|
|
|
|
nsIDOMSVGLengthList *retval;
|
|
|
|
animLengthList->GetAnimVal(&retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00
|
|
|
already_AddRefed<nsIDOMSVGAnimatedTransformList>
|
|
|
|
nsSVGTextFrame::GetTransform()
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(mContent);
|
|
|
|
NS_ASSERTION(transformable, "wrong content element");
|
|
|
|
|
|
|
|
nsIDOMSVGAnimatedTransformList *retval;
|
|
|
|
transformable->GetTransform(&retval);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISVGGlyphFragmentNode *
|
|
|
|
nsSVGTextFrame::GetFirstGlyphFragmentChildNode()
|
|
|
|
{
|
|
|
|
nsISVGGlyphFragmentNode* retval = nsnull;
|
|
|
|
nsIFrame* frame = mFrames.FirstChild();
|
|
|
|
while (frame) {
|
|
|
|
frame->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode),(void**)&retval);
|
|
|
|
if (retval) break;
|
|
|
|
frame = frame->GetNextSibling();
|
|
|
|
}
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISVGGlyphFragmentNode *
|
|
|
|
nsSVGTextFrame::GetNextGlyphFragmentChildNode(nsISVGGlyphFragmentNode*node)
|
|
|
|
{
|
|
|
|
nsISVGGlyphFragmentNode* retval = nsnull;
|
|
|
|
nsIFrame* frame = nsnull;
|
|
|
|
node->QueryInterface(NS_GET_IID(nsIFrame), (void**)&frame);
|
|
|
|
NS_ASSERTION(frame, "interface not implemented");
|
|
|
|
frame = frame->GetNextSibling();
|
|
|
|
while (frame) {
|
|
|
|
frame->QueryInterface(NS_GET_IID(nsISVGGlyphFragmentNode),(void**)&retval);
|
|
|
|
if (retval) break;
|
|
|
|
frame = frame->GetNextSibling();
|
|
|
|
}
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|