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 "nsSVGPathGeometryFrame.h"
|
2004-10-14 23:02:53 +00:00
|
|
|
#include "nsIDOMSVGDocument.h"
|
|
|
|
#include "nsIDOMElement.h"
|
|
|
|
#include "nsIDocument.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 "nsISVGRenderer.h"
|
|
|
|
#include "nsISVGRendererRegion.h"
|
|
|
|
#include "nsISVGValueUtils.h"
|
2005-08-04 20:32:02 +00:00
|
|
|
#include "nsISVGGeometrySource.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 "nsIDOMSVGTransformable.h"
|
|
|
|
#include "nsIDOMSVGAnimTransformList.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 "nsReadableUtils.h"
|
2004-10-14 23:02:53 +00:00
|
|
|
#include "nsUnicharUtils.h"
|
|
|
|
#include "nsSVGAtoms.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 "nsCRT.h"
|
|
|
|
#include "prdtoa.h"
|
2004-12-09 03:16:15 +00:00
|
|
|
#include "nsSVGMarkerFrame.h"
|
|
|
|
#include "nsISVGMarkable.h"
|
|
|
|
#include "nsIViewManager.h"
|
2004-12-24 16:26:10 +00:00
|
|
|
#include "nsSVGMatrix.h"
|
2005-01-25 03:55:03 +00:00
|
|
|
#include "nsSVGClipPathFrame.h"
|
|
|
|
#include "nsISVGRendererCanvas.h"
|
|
|
|
#include "nsIViewManager.h"
|
2005-04-04 21:42:26 +00:00
|
|
|
#include "nsSVGUtils.h"
|
2005-09-06 22:30:40 +00:00
|
|
|
#include "nsSVGFilterFrame.h"
|
2006-01-20 17:00:43 +00:00
|
|
|
#include "nsSVGMaskFrame.h"
|
|
|
|
#include "nsISVGRendererSurface.h"
|
2006-03-02 20:22:19 +00:00
|
|
|
#include "nsINameSpaceManager.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
|
|
|
|
2006-04-06 13:02:53 +00:00
|
|
|
struct nsSVGMarkerProperty {
|
|
|
|
nsISVGMarkerFrame *mMarkerStart;
|
|
|
|
nsISVGMarkerFrame *mMarkerMid;
|
|
|
|
nsISVGMarkerFrame *mMarkerEnd;
|
|
|
|
|
|
|
|
nsSVGMarkerProperty()
|
|
|
|
: mMarkerStart(nsnull),
|
|
|
|
mMarkerMid(nsnull),
|
|
|
|
mMarkerEnd(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
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsSVGPathGeometryFrame
|
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsSVGPathGeometryFrame::nsSVGPathGeometryFrame(nsStyleContext* aContext)
|
|
|
|
: nsSVGPathGeometryFrameBase(aContext),
|
|
|
|
mUpdateFlags(0),
|
2006-03-21 21:16:10 +00:00
|
|
|
mFillGradient(nsnull), mStrokeGradient(nsnull),
|
|
|
|
mFillPattern(nsnull), mStrokePattern(nsnull),
|
|
|
|
mPropagateTransform(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
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
// printf("nsSVGPathGeometryFrame %p CTOR\n", this);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
nsSVGPathGeometryFrame::~nsSVGPathGeometryFrame()
|
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
// printf("~nsSVGPathGeometryFrame %p\n", this);
|
|
|
|
#endif
|
|
|
|
|
2005-03-09 19:24:18 +00:00
|
|
|
if (mFillGradient) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mFillGradient);
|
|
|
|
}
|
|
|
|
if (mStrokeGradient) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mStrokeGradient);
|
|
|
|
}
|
2005-09-13 22:38:36 +00:00
|
|
|
if (mFillPattern) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mFillPattern);
|
|
|
|
}
|
|
|
|
if (mStrokePattern) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mStrokePattern);
|
|
|
|
}
|
2006-04-06 13:02:53 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS) {
|
|
|
|
DeleteProperty(nsGkAtoms::marker);
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods
|
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsSVGPathGeometryFrame)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGGeometrySource)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGPathGeometrySource)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGChildFrame)
|
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsSVGPathGeometryFrameBase)
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIFrame methods
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2006-03-09 18:55:21 +00:00
|
|
|
nsSVGPathGeometryFrame::Init(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
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
|
|
|
{
|
|
|
|
mContent = aContent;
|
|
|
|
NS_IF_ADDREF(mContent);
|
|
|
|
mParent = aParent;
|
|
|
|
|
2005-03-25 04:25:30 +00:00
|
|
|
if (mContent) {
|
|
|
|
mContent->SetMayHaveFrame(PR_TRUE);
|
|
|
|
}
|
|
|
|
|
2005-04-19 03:48:10 +00:00
|
|
|
InitSVG();
|
2006-03-26 21:30:36 +00:00
|
|
|
DidSetStyleContext();
|
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-09-07 16:49:21 +00:00
|
|
|
nsSVGPathGeometryFrame::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
|
|
|
{
|
2006-03-02 20:22:19 +00:00
|
|
|
if (aNameSpaceID == kNameSpaceID_None &&
|
|
|
|
aAttribute == nsGkAtoms::transform)
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_CANVAS_TM);
|
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
|
2006-03-09 18:55:21 +00:00
|
|
|
nsSVGPathGeometryFrame::DidSetStyleContext()
|
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-09 19:24:18 +00:00
|
|
|
// One of the styles that might have been changed are the urls that
|
|
|
|
// point to gradients, etc. Drop our cached values to those
|
|
|
|
if (mFillGradient) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mFillGradient);
|
|
|
|
mFillGradient = nsnull;
|
|
|
|
}
|
|
|
|
if (mStrokeGradient) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mStrokeGradient);
|
|
|
|
mStrokeGradient = nsnull;
|
|
|
|
}
|
2005-09-13 22:38:36 +00:00
|
|
|
if (mFillPattern) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mFillPattern);
|
|
|
|
mFillPattern = nsnull;
|
|
|
|
}
|
|
|
|
if (mStrokePattern) {
|
|
|
|
NS_REMOVE_SVGVALUE_OBSERVER(mStrokePattern);
|
|
|
|
mStrokePattern = nsnull;
|
|
|
|
}
|
2006-03-21 15:49:20 +00:00
|
|
|
nsSVGUtils::StyleEffects(this);
|
2005-03-09 19:24:18 +00:00
|
|
|
|
2006-04-06 13:02:53 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS) {
|
|
|
|
DeleteProperty(nsGkAtoms::marker);
|
|
|
|
RemoveStateBits(NS_STATE_SVG_HAS_MARKERS);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
// XXX: we'd like to use the style_hint mechanism and the
|
|
|
|
// ContentStateChanged/AttributeChanged functions for style changes
|
|
|
|
// to get slightly finer granularity, but unfortunately the
|
|
|
|
// style_hints don't map very well onto svg. Here seems to be the
|
|
|
|
// best place to deal with style changes:
|
|
|
|
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_ALL);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-04-01 19:56:08 +00:00
|
|
|
nsIAtom *
|
|
|
|
nsSVGPathGeometryFrame::GetType() const
|
|
|
|
{
|
|
|
|
return nsLayoutAtoms::svgPathGeometryFrame;
|
|
|
|
}
|
|
|
|
|
2006-01-25 21:16:12 +00:00
|
|
|
PRBool
|
|
|
|
nsSVGPathGeometryFrame::IsFrameOfType(PRUint32 aFlags) const
|
|
|
|
{
|
|
|
|
return !(aFlags & ~nsIFrame::eSVG);
|
|
|
|
}
|
|
|
|
|
2004-12-09 03:16:15 +00:00
|
|
|
// marker helper
|
2006-04-06 13:02:53 +00:00
|
|
|
static void
|
|
|
|
RemoveMarkerObserver(nsSVGMarkerProperty *property,
|
|
|
|
nsIFrame *aFrame,
|
|
|
|
nsISVGMarkerFrame *marker)
|
|
|
|
{
|
|
|
|
if (!marker) return;
|
|
|
|
if (property->mMarkerStart == marker)
|
|
|
|
property->mMarkerStart = nsnull;
|
|
|
|
if (property->mMarkerMid == marker)
|
|
|
|
property->mMarkerMid = nsnull;
|
|
|
|
if (property->mMarkerEnd == marker)
|
|
|
|
property->mMarkerEnd = nsnull;
|
|
|
|
nsSVGUtils::RemoveObserver(aFrame, marker);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
MarkerPropertyDtor(void *aObject, nsIAtom *aPropertyName,
|
|
|
|
void *aPropertyValue, void *aData)
|
|
|
|
{
|
|
|
|
nsSVGMarkerProperty *property = NS_STATIC_CAST(nsSVGMarkerProperty *,
|
|
|
|
aPropertyValue);
|
|
|
|
nsIFrame *frame = NS_STATIC_CAST(nsIFrame *, aObject);
|
|
|
|
RemoveMarkerObserver(property, frame, property->mMarkerStart);
|
|
|
|
RemoveMarkerObserver(property, frame, property->mMarkerMid);
|
|
|
|
RemoveMarkerObserver(property, frame, property->mMarkerEnd);
|
|
|
|
delete property;
|
|
|
|
}
|
|
|
|
|
2004-12-09 03:16:15 +00:00
|
|
|
void
|
2006-01-20 16:21:37 +00:00
|
|
|
nsSVGPathGeometryFrame::GetMarkerFrames(nsISVGMarkerFrame **markerStart,
|
|
|
|
nsISVGMarkerFrame **markerMid,
|
|
|
|
nsISVGMarkerFrame **markerEnd)
|
2004-12-09 03:16:15 +00:00
|
|
|
{
|
2006-04-06 13:02:53 +00:00
|
|
|
*markerStart = *markerMid = *markerEnd = nsnull;
|
2004-12-09 03:16:15 +00:00
|
|
|
|
2006-04-06 13:02:53 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS) {
|
|
|
|
nsSVGMarkerProperty *property;
|
|
|
|
property = NS_STATIC_CAST(nsSVGMarkerProperty *,
|
|
|
|
GetProperty(nsGkAtoms::marker));
|
|
|
|
|
|
|
|
if (property) {
|
|
|
|
*markerStart = property->mMarkerStart;
|
|
|
|
*markerMid = property->mMarkerMid;
|
|
|
|
*markerEnd = property->mMarkerEnd;
|
|
|
|
}
|
|
|
|
}
|
2004-12-09 03:16:15 +00:00
|
|
|
}
|
|
|
|
|
2006-04-06 13:02:53 +00:00
|
|
|
void
|
|
|
|
nsSVGPathGeometryFrame::GetMarkerFromStyle(nsISVGMarkerFrame **aResult,
|
|
|
|
nsSVGMarkerProperty *property,
|
|
|
|
nsIURI *aURI)
|
|
|
|
{
|
|
|
|
if (aURI && !*aResult) {
|
|
|
|
nsISVGMarkerFrame *marker;
|
|
|
|
NS_GetSVGMarkerFrame(&marker, aURI, GetContent());
|
|
|
|
if (marker) {
|
|
|
|
if (property->mMarkerStart != marker &&
|
|
|
|
property->mMarkerMid != marker &&
|
|
|
|
property->mMarkerEnd != marker)
|
|
|
|
nsSVGUtils::AddObserver(NS_STATIC_CAST(nsIFrame *, this), marker);
|
|
|
|
*aResult = marker;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsSVGPathGeometryFrame::UpdateMarkerProperty()
|
|
|
|
{
|
|
|
|
const nsStyleSVG *style = GetStyleSVG();
|
|
|
|
|
|
|
|
if (style->mMarkerStart || style->mMarkerMid || style->mMarkerEnd) {
|
|
|
|
|
|
|
|
nsSVGMarkerProperty *property;
|
|
|
|
if (GetStateBits() & NS_STATE_SVG_HAS_MARKERS) {
|
|
|
|
property = NS_STATIC_CAST(nsSVGMarkerProperty *,
|
|
|
|
GetProperty(nsGkAtoms::marker));
|
|
|
|
} else {
|
|
|
|
property = new nsSVGMarkerProperty;
|
|
|
|
if (!property) {
|
|
|
|
NS_ERROR("Could not create marker property");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
SetProperty(nsGkAtoms::marker, property, MarkerPropertyDtor);
|
|
|
|
AddStateBits(NS_STATE_SVG_HAS_MARKERS);
|
|
|
|
}
|
|
|
|
GetMarkerFromStyle(&property->mMarkerStart, property, style->mMarkerStart);
|
|
|
|
GetMarkerFromStyle(&property->mMarkerMid, property, style->mMarkerMid);
|
|
|
|
GetMarkerFromStyle(&property->mMarkerEnd, property, style->mMarkerEnd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGChildFrame methods
|
|
|
|
|
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
|
2006-03-21 15:49:20 +00:00
|
|
|
nsSVGPathGeometryFrame::PaintSVG(nsISVGRendererCanvas* canvas)
|
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-10-04 18:56:53 +00:00
|
|
|
if (!GetStyleVisibility()->IsVisible())
|
|
|
|
return NS_OK;
|
|
|
|
|
2005-01-25 03:55:03 +00:00
|
|
|
/* render */
|
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
|
|
|
GetGeometry()->Render(canvas);
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2004-12-09 03:16:15 +00:00
|
|
|
nsISVGMarkable *markable;
|
|
|
|
CallQueryInterface(this, &markable);
|
|
|
|
|
|
|
|
if (markable) {
|
2006-04-06 13:02:53 +00:00
|
|
|
// Marker Property is added lazily and may have been removed by a restyle
|
|
|
|
UpdateMarkerProperty();
|
2006-01-20 16:21:37 +00:00
|
|
|
nsISVGMarkerFrame *markerEnd, *markerMid, *markerStart;
|
2004-12-09 03:16:15 +00:00
|
|
|
GetMarkerFrames(&markerStart, &markerMid, &markerEnd);
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2005-04-06 19:02:13 +00:00
|
|
|
if (markerEnd || markerMid || markerStart) {
|
2005-09-27 17:06:11 +00:00
|
|
|
// need to set this up with the first draw
|
|
|
|
if (!mMarkerRegion)
|
|
|
|
mMarkerRegion = GetCoveredRegion();
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2005-04-06 19:02:13 +00:00
|
|
|
float strokeWidth;
|
|
|
|
GetStrokeWidth(&strokeWidth);
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2005-04-06 19:02:13 +00:00
|
|
|
nsVoidArray marks;
|
|
|
|
markable->GetMarkPoints(&marks);
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2005-04-06 19:02:13 +00:00
|
|
|
PRUint32 num = marks.Count();
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2005-07-01 01:34:34 +00:00
|
|
|
if (num && markerStart)
|
2005-04-06 19:02:13 +00:00
|
|
|
markerStart->PaintMark(canvas, this, (nsSVGMark *)marks[0], strokeWidth);
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2005-07-01 01:34:34 +00:00
|
|
|
if (num && markerMid)
|
2005-04-06 19:02:13 +00:00
|
|
|
for (PRUint32 i = 1; i < num - 1; i++)
|
|
|
|
markerMid->PaintMark(canvas, this, (nsSVGMark *)marks[i], strokeWidth);
|
2006-03-21 15:49:20 +00:00
|
|
|
|
2005-07-01 01:34:34 +00:00
|
|
|
if (num && markerEnd)
|
2005-04-06 19:02:13 +00:00
|
|
|
markerEnd->PaintMark(canvas, this, (nsSVGMark *)marks[num-1], strokeWidth);
|
|
|
|
}
|
2004-12-09 03:16:15 +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
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-04-19 03:48:10 +00:00
|
|
|
nsSVGPathGeometryFrame::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("nsSVGPathGeometryFrame(%p)::GetFrameForPoint\n", this);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// test for hit:
|
|
|
|
*hit = nsnull;
|
|
|
|
PRBool isHit;
|
|
|
|
GetGeometry()->ContainsPoint(x, y, &isHit);
|
2005-01-25 03:55:03 +00:00
|
|
|
|
2006-03-21 15:49:20 +00:00
|
|
|
if (isHit && nsSVGUtils::HitTestClip(this, x, y))
|
|
|
|
*hit = 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
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(already_AddRefed<nsISVGRendererRegion>)
|
|
|
|
nsSVGPathGeometryFrame::GetCoveredRegion()
|
|
|
|
{
|
|
|
|
nsISVGRendererRegion *region = nsnull;
|
2005-05-13 18:27:28 +00:00
|
|
|
if (!GetGeometry())
|
|
|
|
return region;
|
|
|
|
|
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
|
|
|
GetGeometry()->GetCoveredRegion(®ion);
|
2004-12-09 03:16:15 +00:00
|
|
|
|
|
|
|
nsISVGMarkable *markable;
|
|
|
|
CallQueryInterface(this, &markable);
|
|
|
|
|
|
|
|
if (markable) {
|
2006-01-20 16:21:37 +00:00
|
|
|
nsISVGMarkerFrame *markerEnd, *markerMid, *markerStart;
|
2004-12-09 03:16:15 +00:00
|
|
|
GetMarkerFrames(&markerStart, &markerMid, &markerEnd);
|
|
|
|
|
|
|
|
if (!markerEnd && !markerMid && !markerStart)
|
|
|
|
return region;
|
|
|
|
|
|
|
|
float strokeWidth;
|
|
|
|
GetStrokeWidth(&strokeWidth);
|
|
|
|
|
|
|
|
nsVoidArray marks;
|
|
|
|
markable->GetMarkPoints(&marks);
|
|
|
|
|
|
|
|
PRUint32 num = marks.Count();
|
|
|
|
|
2005-12-03 00:00:49 +00:00
|
|
|
if (num && markerStart) {
|
2004-12-09 03:16:15 +00:00
|
|
|
nsCOMPtr<nsISVGRendererRegion> mark;
|
|
|
|
mark = markerStart->RegionMark(this, (nsSVGMark *)marks[0], strokeWidth);
|
|
|
|
|
2005-09-16 21:58:47 +00:00
|
|
|
if (mark) {
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> tmp = dont_AddRef(region);
|
|
|
|
mark->Combine(tmp, ®ion);
|
|
|
|
}
|
2004-12-09 03:16:15 +00:00
|
|
|
}
|
|
|
|
|
2005-12-03 00:00:49 +00:00
|
|
|
if (num && markerMid)
|
2004-12-09 03:16:15 +00:00
|
|
|
for (PRUint32 i = 1; i < num - 1; i++) {
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> mark;
|
|
|
|
mark = markerMid->RegionMark(this, (nsSVGMark *)marks[i], strokeWidth);
|
|
|
|
|
2005-09-16 21:58:47 +00:00
|
|
|
if (mark) {
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> tmp = dont_AddRef(region);
|
|
|
|
mark->Combine(tmp, ®ion);
|
|
|
|
}
|
2004-12-09 03:16:15 +00:00
|
|
|
}
|
|
|
|
|
2005-12-03 00:00:49 +00:00
|
|
|
if (num && markerEnd) {
|
2004-12-09 03:16:15 +00:00
|
|
|
nsCOMPtr<nsISVGRendererRegion> mark;
|
|
|
|
mark = markerEnd->RegionMark(this, (nsSVGMark *)marks[num-1], strokeWidth);
|
|
|
|
|
2005-09-16 21:58:47 +00:00
|
|
|
if (mark) {
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> tmp = dont_AddRef(region);
|
|
|
|
mark->Combine(tmp, ®ion);
|
|
|
|
}
|
2004-12-09 03:16:15 +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
|
|
|
return region;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::InitialUpdate()
|
|
|
|
{
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_ALL);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-09-06 22:30:40 +00:00
|
|
|
nsSVGPathGeometryFrame::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
|
|
|
{
|
2005-09-06 22:30:40 +00:00
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_CANVAS_TM,
|
|
|
|
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
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::NotifyRedrawSuspended()
|
|
|
|
{
|
|
|
|
// XXX should we cache the fact that redraw is suspended?
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::NotifyRedrawUnsuspended()
|
|
|
|
{
|
2005-10-13 19:21:46 +00:00
|
|
|
if (mUpdateFlags != 0)
|
2006-04-06 13:02:53 +00:00
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_NOTHING);
|
2005-10-13 19:21:46 +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
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2004-12-24 16:26:10 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::SetMatrixPropagation(PRBool aPropagate)
|
|
|
|
{
|
|
|
|
mPropagateTransform = aPropagate;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::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
|
|
|
|
nsSVGPathGeometryFrame::GetBBox(nsIDOMSVGRect **_retval)
|
|
|
|
{
|
2005-02-18 16:30:12 +00:00
|
|
|
if (GetGeometry())
|
|
|
|
return GetGeometry()->GetBoundingBox(_retval);
|
|
|
|
return NS_ERROR_FAILURE;
|
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 methods:
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-01-16 01:44:52 +00:00
|
|
|
nsSVGPathGeometryFrame::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
|
|
|
{
|
2006-03-21 15:49:20 +00:00
|
|
|
nsSVGUtils::WillModifyEffects(this, observable, aModType);
|
2005-09-06 22:30:40 +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
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-01-16 01:44:52 +00:00
|
|
|
nsSVGPathGeometryFrame::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
|
|
|
{
|
2006-03-21 15:49:20 +00:00
|
|
|
nsSVGUtils::DidModifyEffects(this, observable, aModType);
|
|
|
|
|
2006-03-21 21:16:10 +00:00
|
|
|
nsISVGGradient *gradient;
|
|
|
|
CallQueryInterface(observable, &gradient);
|
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
if (gradient) {
|
2005-03-09 19:24:18 +00:00
|
|
|
// Yes, we need to handle this differently
|
2006-03-21 21:16:10 +00:00
|
|
|
if (mFillGradient == gradient) {
|
2005-03-09 19:24:18 +00:00
|
|
|
if (aModType == nsISVGValue::mod_die) {
|
|
|
|
mFillGradient = nsnull;
|
|
|
|
}
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_FILL_PAINT);
|
|
|
|
} else {
|
|
|
|
// No real harm in assuming a stroke gradient at this point
|
|
|
|
if (aModType == nsISVGValue::mod_die) {
|
|
|
|
mStrokeGradient = nsnull;
|
|
|
|
}
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_STROKE_PAINT);
|
|
|
|
}
|
2006-03-21 21:16:10 +00:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISVGFilterFrame *filter;
|
|
|
|
CallQueryInterface(observable, &filter);
|
|
|
|
|
|
|
|
if (filter) {
|
2005-09-06 22:30:40 +00:00
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_STROKE_PAINT |
|
|
|
|
nsISVGGeometrySource::UPDATEMASK_FILL_PAINT);
|
2006-03-21 21:16:10 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISVGPattern *pval;
|
|
|
|
CallQueryInterface(observable, &pval);
|
|
|
|
|
|
|
|
if (pval) {
|
2005-09-13 22:38:36 +00:00
|
|
|
// Handle Patterns
|
2006-03-21 21:16:10 +00:00
|
|
|
if (mFillPattern == pval) {
|
2005-09-13 22:38:36 +00:00
|
|
|
if (aModType == nsISVGValue::mod_die) {
|
|
|
|
mFillPattern = nsnull;
|
|
|
|
}
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_FILL_PAINT);
|
|
|
|
} else {
|
|
|
|
// Assume stroke pattern
|
|
|
|
if (aModType == nsISVGValue::mod_die) {
|
|
|
|
mStrokePattern = nsnull;
|
|
|
|
}
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_STROKE_PAINT);
|
|
|
|
}
|
2006-04-06 13:02:53 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISVGMarkerFrame *marker;
|
|
|
|
CallQueryInterface(observable, &marker);
|
|
|
|
|
|
|
|
if (marker) {
|
|
|
|
if (aModType == nsISVGValue::mod_die)
|
|
|
|
RemoveMarkerObserver(NS_STATIC_CAST(nsSVGMarkerProperty *,
|
|
|
|
GetProperty(nsGkAtoms::marker)),
|
|
|
|
this,
|
|
|
|
marker);
|
|
|
|
UpdateGraphic(nsISVGGeometrySource::UPDATEMASK_NOTHING);
|
|
|
|
return NS_OK;
|
2005-03-09 19:24:18 +00:00
|
|
|
}
|
2006-03-02 20:22:19 +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
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGGeometrySource methods:
|
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
/* [noscript] readonly attribute nsPresContext presContext; */
|
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
|
2004-07-31 23:15:21 +00:00
|
|
|
nsSVGPathGeometryFrame::GetPresContext(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
|
|
|
{
|
|
|
|
// XXX gcc 3.2.2 requires the explicit 'nsSVGPathGeometryFrameBase::' qualification
|
|
|
|
*aPresContext = nsSVGPathGeometryFrameBase::GetPresContext();
|
|
|
|
NS_ADDREF(*aPresContext);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2004-08-05 09:01:13 +00:00
|
|
|
/* readonly attribute nsIDOMSVGMatrix canvasTM; */
|
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
|
2004-08-05 09:01:13 +00:00
|
|
|
nsSVGPathGeometryFrame::GetCanvasTM(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
|
|
|
{
|
|
|
|
*aCTM = nsnull;
|
2004-08-05 09:01:13 +00:00
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
if (!mPropagateTransform) {
|
|
|
|
if (mOverrideCTM) {
|
|
|
|
*aCTM = mOverrideCTM;
|
|
|
|
NS_ADDREF(*aCTM);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2004-12-24 16:26:10 +00:00
|
|
|
return NS_NewSVGMatrix(aCTM);
|
2005-09-06 22:30:40 +00:00
|
|
|
}
|
2004-12-24 16:26:10 +00:00
|
|
|
|
2004-08-05 09:01:13 +00:00
|
|
|
nsISVGContainerFrame *containerFrame;
|
|
|
|
mParent->QueryInterface(NS_GET_IID(nsISVGContainerFrame), (void**)&containerFrame);
|
|
|
|
if (!containerFrame) {
|
|
|
|
NS_ERROR("invalid container");
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMSVGMatrix> parentTM = containerFrame->GetCanvasTM();
|
|
|
|
NS_ASSERTION(parentTM, "null TM");
|
|
|
|
|
|
|
|
// append our local transformations if we have any:
|
|
|
|
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) {
|
|
|
|
return parentTM->Multiply(localTM, aCTM);
|
|
|
|
}
|
|
|
|
*aCTM = parentTM;
|
|
|
|
NS_ADDREF(*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
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute float strokeOpacity; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeOpacity(float *aStrokeOpacity)
|
|
|
|
{
|
2006-03-21 15:49:20 +00:00
|
|
|
*aStrokeOpacity = GetStyleSVG()->mStrokeOpacity;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute float strokeWidth; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeWidth(float *aStrokeWidth)
|
|
|
|
{
|
2005-04-04 21:42:26 +00:00
|
|
|
*aStrokeWidth =
|
|
|
|
nsSVGUtils::CoordToFloat(nsSVGPathGeometryFrameBase::GetPresContext(),
|
|
|
|
mContent, GetStyleSVG()->mStrokeWidth);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* void getStrokeDashArray ([array, size_is (count)] out float arr, out unsigned long count); */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeDashArray(float **arr, PRUint32 *count)
|
|
|
|
{
|
2005-04-04 21:42:26 +00:00
|
|
|
const nsStyleCoord *dasharray = GetStyleSVG()->mStrokeDasharray;
|
|
|
|
nsPresContext *presContext = nsSVGPathGeometryFrameBase::GetPresContext();
|
2005-10-02 19:26:51 +00:00
|
|
|
float totalLength = 0.0f;
|
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-04 21:42:26 +00:00
|
|
|
*count = GetStyleSVG()->mStrokeDasharrayLength;
|
2005-10-02 19:26:51 +00:00
|
|
|
*arr = 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
|
|
|
|
2004-11-09 18:19:28 +00:00
|
|
|
if (*count) {
|
|
|
|
*arr = (float *) nsMemory::Alloc(*count * sizeof(float));
|
2005-04-04 21:42:26 +00:00
|
|
|
if (*arr) {
|
2005-10-02 19:26:51 +00:00
|
|
|
for (PRUint32 i = 0; i < *count; i++) {
|
2005-04-04 21:42:26 +00:00
|
|
|
(*arr)[i] = nsSVGUtils::CoordToFloat(presContext, mContent, dasharray[i]);
|
2005-10-02 19:26:51 +00:00
|
|
|
if ((*arr)[i] < 0.0f) {
|
|
|
|
nsMemory::Free(*arr);
|
|
|
|
*count = 0;
|
|
|
|
*arr = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
totalLength += (*arr)[i];
|
|
|
|
}
|
2005-04-04 21:42:26 +00:00
|
|
|
} else {
|
2004-11-09 18:19:28 +00:00
|
|
|
*count = 0;
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
2005-10-02 19:26:51 +00:00
|
|
|
|
|
|
|
if (totalLength == 0.0f) {
|
|
|
|
nsMemory::Free(*arr);
|
|
|
|
*count = 0;
|
|
|
|
*arr = 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
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute float strokeDashoffset; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeDashoffset(float *aStrokeDashoffset)
|
|
|
|
{
|
2005-04-04 21:42:26 +00:00
|
|
|
*aStrokeDashoffset =
|
|
|
|
nsSVGUtils::CoordToFloat(nsSVGPathGeometryFrameBase::GetPresContext(),
|
|
|
|
mContent, GetStyleSVG()->mStrokeDashoffset);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute unsigned short strokeLinecap; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeLinecap(PRUint16 *aStrokeLinecap)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aStrokeLinecap = GetStyleSVG()->mStrokeLinecap;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute unsigned short strokeLinejoin; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeLinejoin(PRUint16 *aStrokeLinejoin)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aStrokeLinejoin = GetStyleSVG()->mStrokeLinejoin;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute float strokeMiterlimit; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeMiterlimit(float *aStrokeMiterlimit)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aStrokeMiterlimit = GetStyleSVG()->mStrokeMiterlimit;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute float fillOpacity; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetFillOpacity(float *aFillOpacity)
|
|
|
|
{
|
2006-03-21 15:49:20 +00:00
|
|
|
*aFillOpacity = GetStyleSVG()->mFillOpacity;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute unsigned short fillRule; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetFillRule(PRUint16 *aFillRule)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aFillRule = GetStyleSVG()->mFillRule;
|
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;
|
|
|
|
}
|
|
|
|
|
2005-01-25 03:55:03 +00:00
|
|
|
/* readonly attribute unsigned short clipRule; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetClipRule(PRUint16 *aClipRule)
|
|
|
|
{
|
|
|
|
*aClipRule = GetStyleSVG()->mClipRule;
|
|
|
|
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
|
|
|
/* readonly attribute unsigned short strokePaintType; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokePaintType(PRUint16 *aStrokePaintType)
|
|
|
|
{
|
2005-10-03 01:45:18 +00:00
|
|
|
float strokeWidth;
|
|
|
|
GetStrokeWidth(&strokeWidth);
|
|
|
|
|
|
|
|
// cairo will stop rendering if stroke-width is less than or equal to zero
|
|
|
|
*aStrokePaintType = strokeWidth <= 0 ?
|
|
|
|
nsISVGGeometrySource::PAINT_TYPE_NONE :
|
|
|
|
GetStyleSVG()->mStroke.mType;
|
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;
|
|
|
|
}
|
|
|
|
|
2005-08-04 20:32:02 +00:00
|
|
|
/* readonly attribute unsigned short strokePaintServerType; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokePaintServerType(PRUint16 *aStrokePaintServerType) {
|
|
|
|
return nsSVGUtils::GetPaintType(aStrokePaintServerType, GetStyleSVG()->mStroke, mContent,
|
|
|
|
nsSVGPathGeometryFrameBase::GetPresContext()->PresShell());
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* [noscript] readonly attribute nscolor strokePaint; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokePaint(nscolor *aStrokePaint)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aStrokePaint = GetStyleSVG()->mStroke.mPaint.mColor;
|
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;
|
|
|
|
}
|
|
|
|
|
2004-10-14 23:02:53 +00:00
|
|
|
/* [noscript] void GetStrokeGradient(nsISVGGradient **aGrad); */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokeGradient(nsISVGGradient **aGrad)
|
|
|
|
{
|
2005-03-09 19:24:18 +00:00
|
|
|
nsresult rv = NS_OK;
|
2005-09-13 22:38:36 +00:00
|
|
|
*aGrad = nsnull;
|
2005-03-09 19:24:18 +00:00
|
|
|
if (!mStrokeGradient) {
|
|
|
|
nsIURI *aServer;
|
|
|
|
aServer = GetStyleSVG()->mStroke.mPaint.mPaintServer;
|
|
|
|
if (aServer == nsnull)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
// Now have the URI. Get the gradient
|
2006-03-21 21:16:10 +00:00
|
|
|
rv = NS_GetSVGGradient(&mStrokeGradient, aServer, mContent,
|
2005-03-09 19:24:18 +00:00
|
|
|
nsSVGPathGeometryFrameBase::GetPresContext()->PresShell());
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(mStrokeGradient);
|
|
|
|
}
|
|
|
|
*aGrad = mStrokeGradient;
|
|
|
|
return rv;
|
2004-10-14 23:02:53 +00:00
|
|
|
}
|
|
|
|
|
2005-09-13 22:38:36 +00:00
|
|
|
/* [noscript] void GetStrokePattern(nsISVGPattern **aPat); */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetStrokePattern(nsISVGPattern **aPat)
|
|
|
|
{
|
|
|
|
nsresult rv = NS_OK;
|
|
|
|
*aPat = nsnull;
|
|
|
|
if (!mStrokePattern) {
|
|
|
|
nsIURI *aServer;
|
|
|
|
aServer = GetStyleSVG()->mStroke.mPaint.mPaintServer;
|
|
|
|
if (aServer == nsnull)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
// Now have the URI. Get the gradient
|
2006-03-21 21:16:10 +00:00
|
|
|
rv = NS_GetSVGPattern(&mStrokePattern, aServer, mContent,
|
2005-09-13 22:38:36 +00:00
|
|
|
nsSVGPathGeometryFrameBase::GetPresContext()->PresShell());
|
2006-02-09 18:15:03 +00:00
|
|
|
if (mStrokePattern)
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(mStrokePattern);
|
2005-09-13 22:38:36 +00:00
|
|
|
}
|
|
|
|
*aPat = mStrokePattern;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* readonly attribute unsigned short fillPaintType; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetFillPaintType(PRUint16 *aFillPaintType)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aFillPaintType = GetStyleSVG()->mFill.mType;
|
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;
|
|
|
|
}
|
|
|
|
|
2005-08-04 20:32:02 +00:00
|
|
|
/* readonly attribute unsigned short fillPaintServerType; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetFillPaintServerType(PRUint16 *aFillPaintServerType)
|
|
|
|
{
|
|
|
|
return nsSVGUtils::GetPaintType(aFillPaintServerType, GetStyleSVG()->mFill, mContent,
|
|
|
|
nsSVGPathGeometryFrameBase::GetPresContext()->PresShell());
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* [noscript] readonly attribute nscolor fillPaint; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetFillPaint(nscolor *aFillPaint)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aFillPaint = GetStyleSVG()->mFill.mPaint.mColor;
|
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;
|
|
|
|
}
|
|
|
|
|
2004-10-14 23:02:53 +00:00
|
|
|
/* [noscript] void GetFillGradient(nsISVGGradient **aGrad); */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetFillGradient(nsISVGGradient **aGrad)
|
|
|
|
{
|
2005-03-09 19:24:18 +00:00
|
|
|
nsresult rv = NS_OK;
|
2005-09-13 22:38:36 +00:00
|
|
|
*aGrad = nsnull;
|
2005-03-09 19:24:18 +00:00
|
|
|
if (!mFillGradient) {
|
|
|
|
nsIURI *aServer;
|
|
|
|
aServer = GetStyleSVG()->mFill.mPaint.mPaintServer;
|
|
|
|
if (aServer == nsnull)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
// Now have the URI. Get the gradient
|
2006-03-21 21:16:10 +00:00
|
|
|
rv = NS_GetSVGGradient(&mFillGradient, aServer, mContent,
|
2005-03-09 19:24:18 +00:00
|
|
|
nsSVGPathGeometryFrameBase::GetPresContext()->PresShell());
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(mFillGradient);
|
|
|
|
}
|
|
|
|
*aGrad = mFillGradient;
|
|
|
|
return rv;
|
2004-10-14 23:02:53 +00:00
|
|
|
}
|
|
|
|
|
2005-09-13 22:38:36 +00:00
|
|
|
/* [noscript] void GetFillPattern(nsISVGPattern **aPat); */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetFillPattern(nsISVGPattern **aPat)
|
|
|
|
{
|
|
|
|
nsresult rv = NS_OK;
|
|
|
|
*aPat = nsnull;
|
|
|
|
if (!mFillPattern) {
|
|
|
|
nsIURI *aServer;
|
|
|
|
aServer = GetStyleSVG()->mFill.mPaint.mPaintServer;
|
|
|
|
if (aServer == nsnull)
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
// Now have the URI. Get the pattern
|
2006-03-21 21:16:10 +00:00
|
|
|
rv = NS_GetSVGPattern(&mFillPattern, aServer, mContent,
|
2005-09-13 22:38:36 +00:00
|
|
|
nsSVGPathGeometryFrameBase::GetPresContext()->PresShell());
|
2006-02-09 18:15:03 +00:00
|
|
|
if (mFillPattern)
|
|
|
|
NS_ADD_SVGVALUE_OBSERVER(mFillPattern);
|
2005-09-13 22:38:36 +00:00
|
|
|
}
|
|
|
|
*aPat = mFillPattern;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2005-01-25 03:55:03 +00:00
|
|
|
/* [noscript] boolean isClipChild; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::IsClipChild(PRBool *_retval)
|
|
|
|
{
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
nsCOMPtr<nsIContent> node(mContent);
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (node->Tag() == nsSVGAtoms::clipPath) {
|
|
|
|
*_retval = PR_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
node = node->GetParent();
|
|
|
|
} while (node);
|
|
|
|
|
|
|
|
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
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGPathGeometrySource methods:
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetHittestMask(PRUint16 *aHittestMask)
|
|
|
|
{
|
|
|
|
*aHittestMask=0;
|
|
|
|
|
2004-12-04 06:31:02 +00:00
|
|
|
switch(GetStyleSVG()->mPointerEvents) {
|
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_POINTER_EVENTS_NONE:
|
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED:
|
2004-10-04 18:56:53 +00:00
|
|
|
if (GetStyleVisibility()->IsVisible()) {
|
2004-12-04 06:31:02 +00:00
|
|
|
if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None)
|
2004-10-04 18:56:53 +00:00
|
|
|
*aHittestMask |= HITTEST_MASK_FILL;
|
2004-12-04 06:31:02 +00:00
|
|
|
if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None)
|
2004-10-04 18:56:53 +00:00
|
|
|
*aHittestMask |= HITTEST_MASK_STROKE;
|
|
|
|
}
|
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
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_VISIBLEFILL:
|
2004-10-04 18:56:53 +00:00
|
|
|
if (GetStyleVisibility()->IsVisible()) {
|
|
|
|
*aHittestMask |= HITTEST_MASK_FILL;
|
|
|
|
}
|
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
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE:
|
2004-10-04 18:56:53 +00:00
|
|
|
if (GetStyleVisibility()->IsVisible()) {
|
|
|
|
*aHittestMask |= HITTEST_MASK_STROKE;
|
|
|
|
}
|
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
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_VISIBLE:
|
2004-10-04 18:56:53 +00:00
|
|
|
if (GetStyleVisibility()->IsVisible()) {
|
|
|
|
*aHittestMask |= HITTEST_MASK_FILL;
|
|
|
|
*aHittestMask |= HITTEST_MASK_STROKE;
|
|
|
|
}
|
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
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_PAINTED:
|
2004-12-04 06:31:02 +00:00
|
|
|
if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None)
|
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
|
|
|
*aHittestMask |= HITTEST_MASK_FILL;
|
2004-12-04 06:31:02 +00:00
|
|
|
if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None)
|
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
|
|
|
*aHittestMask |= HITTEST_MASK_STROKE;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_FILL:
|
|
|
|
*aHittestMask |= HITTEST_MASK_FILL;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_STROKE:
|
|
|
|
*aHittestMask |= HITTEST_MASK_STROKE;
|
|
|
|
break;
|
|
|
|
case NS_STYLE_POINTER_EVENTS_ALL:
|
|
|
|
*aHittestMask |= HITTEST_MASK_FILL;
|
|
|
|
*aHittestMask |= HITTEST_MASK_STROKE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
NS_ERROR("not reached");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* readonly attribute unsigned short shapeRendering; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::GetShapeRendering(PRUint16 *aShapeRendering)
|
|
|
|
{
|
2004-12-04 06:31:02 +00:00
|
|
|
*aShapeRendering = GetStyleSVG()->mShapeRendering;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2005-04-19 03:48:10 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGPathGeometryFrame::InitSVG()
|
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
|
|
|
{
|
|
|
|
// construct a pathgeometry object:
|
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;
|
|
|
|
}
|
|
|
|
nsCOMPtr<nsISVGRenderer> renderer;
|
|
|
|
outerSVGFrame->GetRenderer(getter_AddRefs(renderer));
|
2005-02-18 16:30:12 +00:00
|
|
|
if (!renderer) return NS_ERROR_FAILURE;
|
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
|
|
|
|
|
|
|
renderer->CreatePathGeometry(this, getter_AddRefs(mGeometry));
|
|
|
|
|
|
|
|
if (!mGeometry) return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISVGRendererPathGeometry *
|
|
|
|
nsSVGPathGeometryFrame::GetGeometry()
|
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_ASSERTION(mGeometry, "invalid geometry object");
|
|
|
|
#endif
|
|
|
|
return mGeometry;
|
|
|
|
}
|
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
void nsSVGPathGeometryFrame::UpdateGraphic(PRUint32 flags,
|
|
|
|
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
|
|
|
{
|
|
|
|
mUpdateFlags |= flags;
|
2006-02-09 18:15:03 +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
|
|
|
if (!outerSVGFrame) {
|
|
|
|
NS_ERROR("null outerSVGFrame");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool suspended;
|
|
|
|
outerSVGFrame->IsRedrawSuspended(&suspended);
|
|
|
|
if (!suspended) {
|
|
|
|
nsCOMPtr<nsISVGRendererRegion> dirty_region;
|
2005-02-18 16:30:12 +00:00
|
|
|
if (GetGeometry())
|
|
|
|
GetGeometry()->Update(mUpdateFlags, getter_AddRefs(dirty_region));
|
2004-12-09 03:16:15 +00:00
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
mUpdateFlags = 0;
|
|
|
|
|
|
|
|
if (suppressInvalidation)
|
|
|
|
return;
|
2004-12-09 03:16:15 +00:00
|
|
|
|
2005-09-06 22:30:40 +00:00
|
|
|
nsCOMPtr<nsISVGRendererRegion> filter_region;
|
|
|
|
nsSVGUtils::FindFilterInvalidation(this,
|
|
|
|
getter_AddRefs(filter_region));
|
|
|
|
if (filter_region) {
|
|
|
|
outerSVGFrame->InvalidateRegion(filter_region, PR_TRUE);
|
|
|
|
} else {
|
2005-09-27 17:06:11 +00:00
|
|
|
if (mMarkerRegion) {
|
|
|
|
outerSVGFrame->InvalidateRegion(mMarkerRegion, PR_TRUE);
|
|
|
|
mMarkerRegion = nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISVGMarkable *markable;
|
|
|
|
CallQueryInterface(this, &markable);
|
|
|
|
|
|
|
|
if (markable) {
|
2006-01-20 16:21:37 +00:00
|
|
|
nsISVGMarkerFrame *markerEnd, *markerMid, *markerStart;
|
2005-09-27 17:06:11 +00:00
|
|
|
GetMarkerFrames(&markerStart, &markerMid, &markerEnd);
|
|
|
|
|
|
|
|
if (markerEnd || markerMid || markerStart) {
|
|
|
|
mMarkerRegion = GetCoveredRegion();
|
|
|
|
if (mMarkerRegion)
|
|
|
|
outerSVGFrame->InvalidateRegion(mMarkerRegion, PR_TRUE);
|
2005-09-28 23:42:57 +00:00
|
|
|
return;
|
2005-09-27 17:06:11 +00:00
|
|
|
}
|
|
|
|
}
|
2005-09-28 23:42:57 +00:00
|
|
|
|
|
|
|
if (dirty_region)
|
|
|
|
outerSVGFrame->InvalidateRegion(dirty_region, PR_TRUE);
|
2004-12-09 03:16:15 +00:00
|
|
|
}
|
2005-09-06 22:30:40 +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
|
|
|
}
|
|
|
|
|
|
|
|
|