mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 940193 - rename nsSVGTextFrame2 to SVGTextFrame. r=dholbert
--HG-- rename : layout/svg/nsSVGTextFrame2.cpp => layout/svg/SVGTextFrame.cpp rename : layout/svg/nsSVGTextFrame2.h => layout/svg/SVGTextFrame.h
This commit is contained in:
parent
a50a38a1d7
commit
2b4ee5d7ba
@ -1876,7 +1876,7 @@ GK_ATOM(svgPatternFrame, "SVGPatternFrame")
|
||||
GK_ATOM(svgRadialGradientFrame, "SVGRadialGradientFrame")
|
||||
GK_ATOM(svgStopFrame, "SVGStopFrame")
|
||||
GK_ATOM(svgSwitchFrame, "SVGSwitchFrame")
|
||||
GK_ATOM(svgTextFrame2, "SVGTextFrame2")
|
||||
GK_ATOM(svgTextFrame, "SVGTextFrame")
|
||||
GK_ATOM(svgUseFrame, "SVGUseFrame")
|
||||
GK_ATOM(svgViewFrame, "SVGViewFrame")
|
||||
GK_ATOM(HTMLVideoFrame, "VideoFrame")
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "mozilla/dom/SVGTextContentElement.h"
|
||||
#include "nsISVGPoint.h"
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "SVGTextFrame.h"
|
||||
#include "mozilla/dom/SVGIRect.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -27,12 +27,12 @@ nsSVGElement::LengthInfo SVGTextContentElement::sLengthInfo[1] =
|
||||
{ &nsGkAtoms::textLength, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::XY }
|
||||
};
|
||||
|
||||
nsSVGTextFrame2*
|
||||
SVGTextFrame*
|
||||
SVGTextContentElement::GetSVGTextFrame()
|
||||
{
|
||||
nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
|
||||
while (frame) {
|
||||
nsSVGTextFrame2* textFrame = do_QueryFrame(frame);
|
||||
SVGTextFrame* textFrame = do_QueryFrame(frame);
|
||||
if (textFrame) {
|
||||
return textFrame;
|
||||
}
|
||||
@ -58,21 +58,21 @@ SVGTextContentElement::LengthAdjust()
|
||||
int32_t
|
||||
SVGTextContentElement::GetNumberOfChars()
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
return textFrame ? textFrame->GetNumberOfChars(this) : 0;
|
||||
}
|
||||
|
||||
float
|
||||
SVGTextContentElement::GetComputedTextLength()
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
return textFrame ? textFrame->GetComputedTextLength(this) : 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
SVGTextContentElement::SelectSubString(uint32_t charnum, uint32_t nchars, ErrorResult& rv)
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
if (!textFrame)
|
||||
return;
|
||||
|
||||
@ -82,7 +82,7 @@ SVGTextContentElement::SelectSubString(uint32_t charnum, uint32_t nchars, ErrorR
|
||||
float
|
||||
SVGTextContentElement::GetSubStringLength(uint32_t charnum, uint32_t nchars, ErrorResult& rv)
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
if (!textFrame)
|
||||
return 0.0f;
|
||||
|
||||
@ -94,7 +94,7 @@ SVGTextContentElement::GetSubStringLength(uint32_t charnum, uint32_t nchars, Err
|
||||
already_AddRefed<nsISVGPoint>
|
||||
SVGTextContentElement::GetStartPositionOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
if (!textFrame) {
|
||||
rv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
@ -108,7 +108,7 @@ SVGTextContentElement::GetStartPositionOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
already_AddRefed<nsISVGPoint>
|
||||
SVGTextContentElement::GetEndPositionOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
if (!textFrame) {
|
||||
rv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
@ -122,7 +122,7 @@ SVGTextContentElement::GetEndPositionOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
already_AddRefed<SVGIRect>
|
||||
SVGTextContentElement::GetExtentOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
|
||||
if (!textFrame) {
|
||||
rv.Throw(NS_ERROR_FAILURE);
|
||||
@ -137,7 +137,7 @@ SVGTextContentElement::GetExtentOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
float
|
||||
SVGTextContentElement::GetRotationOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
|
||||
if (!textFrame) {
|
||||
rv.Throw(NS_ERROR_FAILURE);
|
||||
@ -152,7 +152,7 @@ SVGTextContentElement::GetRotationOfChar(uint32_t charnum, ErrorResult& rv)
|
||||
int32_t
|
||||
SVGTextContentElement::GetCharNumAtPosition(nsISVGPoint& aPoint)
|
||||
{
|
||||
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
|
||||
SVGTextFrame* textFrame = GetSVGTextFrame();
|
||||
return textFrame ? textFrame->GetCharNumAtPosition(this, &aPoint) : -1;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ static const unsigned short SVG_LENGTHADJUST_UNKNOWN = 0;
|
||||
static const unsigned short SVG_LENGTHADJUST_SPACING = 1;
|
||||
static const unsigned short SVG_LENGTHADJUST_SPACINGANDGLYPHS = 2;
|
||||
|
||||
class nsSVGTextFrame2;
|
||||
class SVGTextFrame;
|
||||
|
||||
namespace mozilla {
|
||||
class nsISVGPoint;
|
||||
@ -50,7 +50,7 @@ protected:
|
||||
: SVGTextContentElementBase(aNodeInfo)
|
||||
{}
|
||||
|
||||
nsSVGTextFrame2* GetSVGTextFrame();
|
||||
SVGTextFrame* GetSVGTextFrame();
|
||||
|
||||
enum { LENGTHADJUST };
|
||||
virtual nsSVGEnum* EnumAttributes() = 0;
|
||||
|
@ -34,7 +34,7 @@ typedef SVGTextContentElement SVGTextPathElementBase;
|
||||
|
||||
class SVGTextPathElement MOZ_FINAL : public SVGTextPathElementBase
|
||||
{
|
||||
friend class ::nsSVGTextFrame2;
|
||||
friend class ::SVGTextFrame;
|
||||
|
||||
protected:
|
||||
friend nsresult (::NS_NewSVGTextPathElement(nsIContent **aResult,
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsViewportFrame.h"
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "SVGTextFrame.h"
|
||||
#include "StickyScrollContainer.h"
|
||||
#include "nsIRootBox.h"
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
@ -204,14 +204,14 @@ DoApplyRenderingChangeToTree(nsIFrame* aFrame,
|
||||
}
|
||||
if (aChange & nsChangeHint_UpdateTextPath) {
|
||||
if (aFrame->IsSVGText()) {
|
||||
// Invalidate and reflow the entire nsSVGTextFrame2:
|
||||
// Invalidate and reflow the entire SVGTextFrame:
|
||||
NS_ASSERTION(aFrame->GetContent()->IsSVG(nsGkAtoms::textPath),
|
||||
"expected frame for a <textPath> element");
|
||||
nsIFrame* text = nsLayoutUtils::GetClosestFrameOfType(
|
||||
aFrame,
|
||||
nsGkAtoms::svgTextFrame2);
|
||||
NS_ASSERTION(text, "expected to find an ancestor nsSVGTextFrame2");
|
||||
static_cast<nsSVGTextFrame2*>(text)->NotifyGlyphMetricsChange();
|
||||
nsGkAtoms::svgTextFrame);
|
||||
NS_ASSERTION(text, "expected to find an ancestor SVGTextFrame");
|
||||
static_cast<SVGTextFrame*>(text)->NotifyGlyphMetricsChange();
|
||||
} else {
|
||||
NS_ABORT_IF_FALSE(false, "unexpected frame got "
|
||||
"nsChangeHint_UpdateTextPath");
|
||||
|
@ -123,7 +123,7 @@ NS_NewSVGAFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
nsIFrame*
|
||||
NS_NewSVGSwitchFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
nsIFrame*
|
||||
NS_NewSVGTextFrame2(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
nsIFrame*
|
||||
NS_NewSVGContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
nsIFrame*
|
||||
@ -4951,7 +4951,7 @@ nsCSSFrameConstructor::FindSVGData(Element* aElement,
|
||||
static const FrameConstructionData sTextData =
|
||||
FCDATA_WITH_WRAPPING_BLOCK(FCDATA_DISALLOW_OUT_OF_FLOW |
|
||||
FCDATA_ALLOW_BLOCK_STYLES,
|
||||
NS_NewSVGTextFrame2,
|
||||
NS_NewSVGTextFrame,
|
||||
nsCSSAnonBoxes::mozSVGText);
|
||||
return &sTextData;
|
||||
} else if (aTag == nsGkAtoms::tspan ||
|
||||
@ -5132,7 +5132,7 @@ nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState& aState
|
||||
}
|
||||
if (aParentFrame->GetType() == nsGkAtoms::blockFrame &&
|
||||
aParentFrame->GetParent() &&
|
||||
aParentFrame->GetParent()->GetType() == nsGkAtoms::svgTextFrame2) {
|
||||
aParentFrame->GetParent()->GetType() == nsGkAtoms::svgTextFrame) {
|
||||
flags |= ITEM_ALLOWS_TEXT_PATH_CHILD;
|
||||
}
|
||||
AddFrameConstructionItemsInternal(aState, aContent, aParentFrame,
|
||||
|
@ -64,7 +64,7 @@
|
||||
#include "nsFontFaceList.h"
|
||||
#include "nsFontInflationData.h"
|
||||
#include "nsSVGUtils.h"
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "SVGTextFrame.h"
|
||||
#include "nsStyleStructInlines.h"
|
||||
#include "nsStyleTransformMatrix.h"
|
||||
#include "nsIFrameInlines.h"
|
||||
@ -1853,16 +1853,16 @@ TransformGfxRectToAncestor(nsIFrame *aFrame,
|
||||
return ctm.TransformBounds(aRect);
|
||||
}
|
||||
|
||||
static nsSVGTextFrame2*
|
||||
static SVGTextFrame*
|
||||
GetContainingSVGTextFrame(nsIFrame* aFrame)
|
||||
{
|
||||
if (!aFrame->IsSVGText()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return static_cast<nsSVGTextFrame2*>
|
||||
return static_cast<SVGTextFrame*>
|
||||
(nsLayoutUtils::GetClosestFrameOfType(aFrame->GetParent(),
|
||||
nsGkAtoms::svgTextFrame2));
|
||||
nsGkAtoms::svgTextFrame));
|
||||
}
|
||||
|
||||
nsPoint
|
||||
@ -1870,7 +1870,7 @@ nsLayoutUtils::TransformAncestorPointToFrame(nsIFrame* aFrame,
|
||||
const nsPoint& aPoint,
|
||||
nsIFrame* aAncestor)
|
||||
{
|
||||
nsSVGTextFrame2* text = GetContainingSVGTextFrame(aFrame);
|
||||
SVGTextFrame* text = GetContainingSVGTextFrame(aFrame);
|
||||
|
||||
float factor = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
gfxPoint result(NSAppUnitsToFloatPixels(aPoint.x, factor),
|
||||
@ -1892,7 +1892,7 @@ nsLayoutUtils::TransformAncestorRectToFrame(nsIFrame* aFrame,
|
||||
const nsRect &aRect,
|
||||
const nsIFrame* aAncestor)
|
||||
{
|
||||
nsSVGTextFrame2* text = GetContainingSVGTextFrame(aFrame);
|
||||
SVGTextFrame* text = GetContainingSVGTextFrame(aFrame);
|
||||
|
||||
float srcAppUnitsPerDevPixel = aAncestor->PresContext()->AppUnitsPerDevPixel();
|
||||
gfxRect result(NSAppUnitsToFloatPixels(aRect.x, srcAppUnitsPerDevPixel),
|
||||
@ -1920,7 +1920,7 @@ nsLayoutUtils::TransformFrameRectToAncestor(nsIFrame* aFrame,
|
||||
const nsIFrame* aAncestor,
|
||||
bool* aPreservesAxisAlignedRectangles /* = nullptr */)
|
||||
{
|
||||
nsSVGTextFrame2* text = GetContainingSVGTextFrame(aFrame);
|
||||
SVGTextFrame* text = GetContainingSVGTextFrame(aFrame);
|
||||
|
||||
float srcAppUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
gfxRect result;
|
||||
@ -5622,12 +5622,12 @@ nsLayoutUtils::FontSizeInflationFor(const nsIFrame *aFrame)
|
||||
{
|
||||
if (aFrame->IsSVGText()) {
|
||||
const nsIFrame* container = aFrame;
|
||||
while (container->GetType() != nsGkAtoms::svgTextFrame2) {
|
||||
while (container->GetType() != nsGkAtoms::svgTextFrame) {
|
||||
container = container->GetParent();
|
||||
}
|
||||
NS_ASSERTION(container, "expected to find an ancestor nsSVGTextFrame2");
|
||||
NS_ASSERTION(container, "expected to find an ancestor SVGTextFrame");
|
||||
return
|
||||
static_cast<const nsSVGTextFrame2*>(container)->GetFontSizeScaleFactor();
|
||||
static_cast<const SVGTextFrame*>(container)->GetFontSizeScaleFactor();
|
||||
}
|
||||
|
||||
if (!FontSizeInflationEnabled(aFrame->PresContext())) {
|
||||
|
@ -408,7 +408,7 @@ void
|
||||
nsBlockFrame::InvalidateFrame(uint32_t aDisplayItemKey)
|
||||
{
|
||||
if (IsSVGText()) {
|
||||
NS_ASSERTION(GetParent()->GetType() == nsGkAtoms::svgTextFrame2,
|
||||
NS_ASSERTION(GetParent()->GetType() == nsGkAtoms::svgTextFrame,
|
||||
"unexpected block frame in SVG text");
|
||||
GetParent()->InvalidateFrame();
|
||||
return;
|
||||
@ -420,7 +420,7 @@ void
|
||||
nsBlockFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
|
||||
{
|
||||
if (IsSVGText()) {
|
||||
NS_ASSERTION(GetParent()->GetType() == nsGkAtoms::svgTextFrame2,
|
||||
NS_ASSERTION(GetParent()->GetType() == nsGkAtoms::svgTextFrame,
|
||||
"unexpected block frame in SVG text");
|
||||
GetParent()->InvalidateFrame();
|
||||
return;
|
||||
|
@ -67,7 +67,7 @@
|
||||
#include "nsChangeHint.h"
|
||||
#include "nsDeckFrame.h"
|
||||
#include "nsSubDocumentFrame.h"
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "SVGTextFrame.h"
|
||||
|
||||
#include "gfxContext.h"
|
||||
#include "nsRenderingContext.h"
|
||||
@ -710,14 +710,14 @@ nsFrame::GetOffsets(int32_t &aStart, int32_t &aEnd) const
|
||||
nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
{
|
||||
if (IsSVGText()) {
|
||||
nsSVGTextFrame2* svgTextFrame = static_cast<nsSVGTextFrame2*>(
|
||||
nsLayoutUtils::GetClosestFrameOfType(this, nsGkAtoms::svgTextFrame2));
|
||||
SVGTextFrame* svgTextFrame = static_cast<SVGTextFrame*>(
|
||||
nsLayoutUtils::GetClosestFrameOfType(this, nsGkAtoms::svgTextFrame));
|
||||
nsIFrame* anonBlock = svgTextFrame->GetFirstPrincipalChild();
|
||||
// Just as in nsSVGTextFrame2::DidSetStyleContext, we need to ensure that
|
||||
// any non-display nsSVGTextFrame2s get reflowed when a child text frame
|
||||
// Just as in SVGTextFrame::DidSetStyleContext, we need to ensure that
|
||||
// any non-display SVGTextFrames get reflowed when a child text frame
|
||||
// gets new style.
|
||||
//
|
||||
// Note that we must check NS_FRAME_FIRST_REFLOW on our nsSVGTextFrame2's
|
||||
// Note that we must check NS_FRAME_FIRST_REFLOW on our SVGTextFrame's
|
||||
// anonymous block frame rather than our self, since NS_FRAME_FIRST_REFLOW
|
||||
// may be set on us if we're a new frame that has been inserted after the
|
||||
// document's first reflow. (In which case this DidSetStyleContext call may
|
||||
@ -7377,7 +7377,7 @@ nsIFrame::VerticalAlignEnum() const
|
||||
for (const nsIFrame* frame = this; frame; frame = frame->GetParent()) {
|
||||
dominantBaseline = frame->StyleSVGReset()->mDominantBaseline;
|
||||
if (dominantBaseline != NS_STYLE_DOMINANT_BASELINE_AUTO ||
|
||||
frame->GetType() == nsGkAtoms::svgTextFrame2) {
|
||||
frame->GetType() == nsGkAtoms::svgTextFrame) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ FRAME_ID(nsSVGPatternFrame)
|
||||
FRAME_ID(nsSVGRadialGradientFrame)
|
||||
FRAME_ID(nsSVGStopFrame)
|
||||
FRAME_ID(nsSVGSwitchFrame)
|
||||
FRAME_ID(nsSVGTextFrame2)
|
||||
FRAME_ID(SVGTextFrame)
|
||||
FRAME_ID(nsSVGUseFrame)
|
||||
FRAME_ID(SVGViewFrame)
|
||||
FRAME_ID(nsTableCaptionFrame)
|
||||
|
@ -302,7 +302,7 @@ typedef uint64_t nsFrameState;
|
||||
// the frames for future reference.
|
||||
#define NS_FRAME_NO_COMPONENT_ALPHA NS_FRAME_STATE_BIT(45)
|
||||
|
||||
// The frame is a descendant of nsSVGTextFrame2 and is thus used for SVG
|
||||
// The frame is a descendant of SVGTextFrame and is thus used for SVG
|
||||
// text layout.
|
||||
#define NS_FRAME_IS_SVG_TEXT NS_FRAME_STATE_BIT(47)
|
||||
|
||||
@ -2933,7 +2933,7 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
|
||||
* distance beats a closer y distance.
|
||||
*
|
||||
* Normally, this function will only check the distance between this
|
||||
* frame's rectangle and the specified point. nsSVGTextFrame2 overrides
|
||||
* frame's rectangle and the specified point. SVGTextFrame overrides
|
||||
* this so that it can manage all of its descendant frames and take
|
||||
* into account any SVG text layout.
|
||||
*
|
||||
|
@ -63,7 +63,7 @@ nsInlineFrame::InvalidateFrame(uint32_t aDisplayItemKey)
|
||||
if (IsSVGText()) {
|
||||
nsIFrame* svgTextFrame =
|
||||
nsLayoutUtils::GetClosestFrameOfType(GetParent(),
|
||||
nsGkAtoms::svgTextFrame2);
|
||||
nsGkAtoms::svgTextFrame);
|
||||
svgTextFrame->InvalidateFrame();
|
||||
return;
|
||||
}
|
||||
@ -76,7 +76,7 @@ nsInlineFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayIte
|
||||
if (IsSVGText()) {
|
||||
nsIFrame* svgTextFrame =
|
||||
nsLayoutUtils::GetClosestFrameOfType(GetParent(),
|
||||
nsGkAtoms::svgTextFrame2);
|
||||
nsGkAtoms::svgTextFrame);
|
||||
svgTextFrame->InvalidateFrame();
|
||||
return;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsStyleStruct.h"
|
||||
#include "nsStyleStructInlines.h"
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "SVGTextFrame.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
@ -4251,7 +4251,7 @@ nsTextFrame::InvalidateFrame(uint32_t aDisplayItemKey)
|
||||
if (IsSVGText()) {
|
||||
nsIFrame* svgTextFrame =
|
||||
nsLayoutUtils::GetClosestFrameOfType(GetParent(),
|
||||
nsGkAtoms::svgTextFrame2);
|
||||
nsGkAtoms::svgTextFrame);
|
||||
svgTextFrame->InvalidateFrame();
|
||||
return;
|
||||
}
|
||||
@ -4264,7 +4264,7 @@ nsTextFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemK
|
||||
if (IsSVGText()) {
|
||||
nsIFrame* svgTextFrame =
|
||||
nsLayoutUtils::GetClosestFrameOfType(GetParent(),
|
||||
nsGkAtoms::svgTextFrame2);
|
||||
nsGkAtoms::svgTextFrame);
|
||||
svgTextFrame->InvalidateFrame();
|
||||
return;
|
||||
}
|
||||
@ -4769,12 +4769,12 @@ GetInflationForTextDecorations(nsIFrame* aFrame, nscoord aInflationMinFontSize)
|
||||
{
|
||||
if (aFrame->IsSVGText()) {
|
||||
const nsIFrame* container = aFrame;
|
||||
while (container->GetType() != nsGkAtoms::svgTextFrame2) {
|
||||
while (container->GetType() != nsGkAtoms::svgTextFrame) {
|
||||
container = container->GetParent();
|
||||
}
|
||||
NS_ASSERTION(container, "expected to find an ancestor nsSVGTextFrame2");
|
||||
NS_ASSERTION(container, "expected to find an ancestor SVGTextFrame");
|
||||
return
|
||||
static_cast<const nsSVGTextFrame2*>(container)->GetFontSizeScaleFactor();
|
||||
static_cast<const SVGTextFrame*>(container)->GetFontSizeScaleFactor();
|
||||
}
|
||||
return nsLayoutUtils::FontSizeInflationInner(aFrame, aInflationMinFontSize);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Main header first:
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "SVGTextFrame.h"
|
||||
|
||||
// Keep others in (case-insensitive) order:
|
||||
#include "DOMSVGPoint.h"
|
||||
@ -410,7 +410,7 @@ TruncateTo(nsTArray<T>& aArrayToTruncate, const nsTArray<U>& aReferenceArray)
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the anonymous block child of the nsSVGTextFrame2 has been
|
||||
* Asserts that the anonymous block child of the SVGTextFrame has been
|
||||
* reflowed (or does not exist). Returns null if the child has not been
|
||||
* reflowed, and the frame otherwise.
|
||||
*
|
||||
@ -419,8 +419,8 @@ TruncateTo(nsTArray<T>& aArrayToTruncate, const nsTArray<U>& aReferenceArray)
|
||||
* kid has been reflowed but before we have cleared the dirty bits on the
|
||||
* frame itself.
|
||||
*/
|
||||
static nsSVGTextFrame2*
|
||||
FrameIfAnonymousChildReflowed(nsSVGTextFrame2* aFrame)
|
||||
static SVGTextFrame*
|
||||
FrameIfAnonymousChildReflowed(SVGTextFrame* aFrame)
|
||||
{
|
||||
NS_PRECONDITION(aFrame, "aFrame must not be null");
|
||||
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
|
||||
@ -462,7 +462,7 @@ namespace mozilla {
|
||||
* - The glyphs correspond to content within the one nsTextFrame
|
||||
*
|
||||
* A TextRenderedRunIterator produces TextRenderedRuns required for painting a
|
||||
* whole nsSVGTextFrame2.
|
||||
* whole SVGTextFrame.
|
||||
*/
|
||||
struct TextRenderedRun
|
||||
{
|
||||
@ -538,7 +538,7 @@ struct TextRenderedRun
|
||||
* Assume now that we are painting the third TextRenderedRun. It will have
|
||||
* a left clip edge that is the sum of the advances of "abc", and it will
|
||||
* have a right clip edge that is the advance of "f". In
|
||||
* nsSVGTextFrame2::PaintSVG(), we pass in nsPoint() (i.e., the origin)
|
||||
* SVGTextFrame::PaintSVG(), we pass in nsPoint() (i.e., the origin)
|
||||
* as the point at which to paint the text frame, and we pass in the
|
||||
* clip edge values. The nsTextFrame will paint the substring of its
|
||||
* text such that the top-left corner of the "d"'s glyph cell will be at
|
||||
@ -1283,7 +1283,7 @@ GetUndisplayedCharactersBeforeFrame(nsTextFrame* aFrame)
|
||||
}
|
||||
|
||||
/**
|
||||
* Traverses the nsTextFrames for an nsSVGTextFrame2 and records a
|
||||
* Traverses the nsTextFrames for an SVGTextFrame and records a
|
||||
* TextNodeCorrespondenceProperty on each for the number of undisplayed DOM
|
||||
* characters between each frame. This is done by iterating simultaenously
|
||||
* over the nsTextNodes and nsTextFrames and noting when nsTextNodes (or
|
||||
@ -1295,17 +1295,17 @@ public:
|
||||
/**
|
||||
* Entry point for the TextNodeCorrespondenceProperty recording.
|
||||
*/
|
||||
static void RecordCorrespondence(nsSVGTextFrame2* aRoot);
|
||||
static void RecordCorrespondence(SVGTextFrame* aRoot);
|
||||
|
||||
private:
|
||||
TextNodeCorrespondenceRecorder(nsSVGTextFrame2* aRoot)
|
||||
TextNodeCorrespondenceRecorder(SVGTextFrame* aRoot)
|
||||
: mNodeIterator(aRoot->GetContent()),
|
||||
mPreviousNode(nullptr),
|
||||
mNodeCharIndex(0)
|
||||
{
|
||||
}
|
||||
|
||||
void Record(nsSVGTextFrame2* aRoot);
|
||||
void Record(SVGTextFrame* aRoot);
|
||||
void TraverseAndRecord(nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
@ -1331,14 +1331,14 @@ private:
|
||||
};
|
||||
|
||||
/* static */ void
|
||||
TextNodeCorrespondenceRecorder::RecordCorrespondence(nsSVGTextFrame2* aRoot)
|
||||
TextNodeCorrespondenceRecorder::RecordCorrespondence(SVGTextFrame* aRoot)
|
||||
{
|
||||
TextNodeCorrespondenceRecorder recorder(aRoot);
|
||||
recorder.Record(aRoot);
|
||||
}
|
||||
|
||||
void
|
||||
TextNodeCorrespondenceRecorder::Record(nsSVGTextFrame2* aRoot)
|
||||
TextNodeCorrespondenceRecorder::Record(SVGTextFrame* aRoot)
|
||||
{
|
||||
if (!mNodeIterator.Current()) {
|
||||
// If there are no nsTextNodes then there is nothing to do.
|
||||
@ -1369,7 +1369,7 @@ TextNodeCorrespondenceRecorder::Record(nsSVGTextFrame2* aRoot)
|
||||
}
|
||||
|
||||
// Record the trailing number of undisplayed characters on the
|
||||
// nsSVGTextFrame2.
|
||||
// SVGTextFrame.
|
||||
aRoot->mTrailingUndisplayedCharacters = undisplayed;
|
||||
}
|
||||
|
||||
@ -1474,7 +1474,7 @@ TextNodeCorrespondenceRecorder::TraverseAndRecord(nsIFrame* aFrame)
|
||||
|
||||
/**
|
||||
* An iterator class for nsTextFrames that are descendants of an
|
||||
* nsSVGTextFrame2. The iterator can optionally track whether the
|
||||
* SVGTextFrame. The iterator can optionally track whether the
|
||||
* current nsTextFrame is for a descendant of, or past, a given subtree
|
||||
* content node or frame. (This functionality is used for example by the SVG
|
||||
* DOM text methods to get only the nsTextFrames for a particular <tspan>.)
|
||||
@ -1483,7 +1483,7 @@ TextNodeCorrespondenceRecorder::TraverseAndRecord(nsIFrame* aFrame)
|
||||
* current nsTextFrame:
|
||||
*
|
||||
* * how many undisplayed characters came just before it
|
||||
* * its position (in app units) relative to the nsSVGTextFrame2's anonymous
|
||||
* * its position (in app units) relative to the SVGTextFrame's anonymous
|
||||
* block frame
|
||||
* * what nsInlineFrame corresponding to a <textPath> element it is a
|
||||
* descendant of
|
||||
@ -1496,10 +1496,10 @@ class TextFrameIterator
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructs a TextFrameIterator for the specified nsSVGTextFrame2
|
||||
* Constructs a TextFrameIterator for the specified SVGTextFrame
|
||||
* with an optional frame subtree to restrict iterated text frames to.
|
||||
*/
|
||||
TextFrameIterator(nsSVGTextFrame2* aRoot, nsIFrame* aSubtree = nullptr)
|
||||
TextFrameIterator(SVGTextFrame* aRoot, nsIFrame* aSubtree = nullptr)
|
||||
: mRootFrame(aRoot),
|
||||
mSubtree(aSubtree),
|
||||
mCurrentFrame(aRoot),
|
||||
@ -1510,10 +1510,10 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a TextFrameIterator for the specified nsSVGTextFrame2
|
||||
* Constructs a TextFrameIterator for the specified SVGTextFrame
|
||||
* with an optional frame content subtree to restrict iterated text frames to.
|
||||
*/
|
||||
TextFrameIterator(nsSVGTextFrame2* aRoot, nsIContent* aSubtree)
|
||||
TextFrameIterator(SVGTextFrame* aRoot, nsIContent* aSubtree)
|
||||
: mRootFrame(aRoot),
|
||||
mSubtree(aRoot && aSubtree && aSubtree != aRoot->GetContent() ?
|
||||
aSubtree->GetPrimaryFrame() :
|
||||
@ -1526,9 +1526,9 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the root nsSVGTextFrame2 this TextFrameIterator is iterating over.
|
||||
* Returns the root SVGTextFrame this TextFrameIterator is iterating over.
|
||||
*/
|
||||
nsSVGTextFrame2* Root() const
|
||||
SVGTextFrame* Root() const
|
||||
{
|
||||
return mRootFrame;
|
||||
}
|
||||
@ -1549,7 +1549,7 @@ public:
|
||||
|
||||
/**
|
||||
* Returns the current frame's position, in app units, relative to the
|
||||
* root nsSVGTextFrame2's anonymous block frame.
|
||||
* root SVGTextFrame's anonymous block frame.
|
||||
*/
|
||||
nsPoint Position() const
|
||||
{
|
||||
@ -1633,7 +1633,7 @@ private:
|
||||
/**
|
||||
* The root frame we are iterating through.
|
||||
*/
|
||||
nsSVGTextFrame2* mRootFrame;
|
||||
SVGTextFrame* mRootFrame;
|
||||
|
||||
/**
|
||||
* The frame for the subtree we are also interested in tracking.
|
||||
@ -1782,7 +1782,7 @@ TextFrameIterator::PopBaseline()
|
||||
// TextRenderedRunIterator
|
||||
|
||||
/**
|
||||
* Iterator for TextRenderedRun objects for the nsSVGTextFrame2.
|
||||
* Iterator for TextRenderedRun objects for the SVGTextFrame.
|
||||
*/
|
||||
class TextRenderedRunIterator
|
||||
{
|
||||
@ -1803,14 +1803,14 @@ public:
|
||||
* Constructs a TextRenderedRunIterator with an optional frame subtree to
|
||||
* restrict iterated rendered runs to.
|
||||
*
|
||||
* @param aSVGTextFrame The nsSVGTextFrame2 whose rendered runs to iterate
|
||||
* @param aSVGTextFrame The SVGTextFrame whose rendered runs to iterate
|
||||
* through.
|
||||
* @param aFilter Indicates whether to iterate rendered runs for non-visible
|
||||
* nsTextFrames.
|
||||
* @param aSubtree An optional frame subtree to restrict iterated rendered
|
||||
* runs to.
|
||||
*/
|
||||
TextRenderedRunIterator(nsSVGTextFrame2* aSVGTextFrame,
|
||||
TextRenderedRunIterator(SVGTextFrame* aSVGTextFrame,
|
||||
RenderedRunFilter aFilter = eAllFrames,
|
||||
nsIFrame* aSubtree = nullptr)
|
||||
: mFrameIterator(FrameIfAnonymousChildReflowed(aSVGTextFrame), aSubtree),
|
||||
@ -1826,13 +1826,13 @@ public:
|
||||
* Constructs a TextRenderedRunIterator with a content subtree to restrict
|
||||
* iterated rendered runs to.
|
||||
*
|
||||
* @param aSVGTextFrame The nsSVGTextFrame2 whose rendered runs to iterate
|
||||
* @param aSVGTextFrame The SVGTextFrame whose rendered runs to iterate
|
||||
* through.
|
||||
* @param aFilter Indicates whether to iterate rendered runs for non-visible
|
||||
* nsTextFrames.
|
||||
* @param aSubtree A content subtree to restrict iterated rendered runs to.
|
||||
*/
|
||||
TextRenderedRunIterator(nsSVGTextFrame2* aSVGTextFrame,
|
||||
TextRenderedRunIterator(SVGTextFrame* aSVGTextFrame,
|
||||
RenderedRunFilter aFilter,
|
||||
nsIContent* aSubtree)
|
||||
: mFrameIterator(FrameIfAnonymousChildReflowed(aSVGTextFrame), aSubtree),
|
||||
@ -1859,9 +1859,9 @@ public:
|
||||
|
||||
private:
|
||||
/**
|
||||
* Returns the root nsSVGTextFrame2 this iterator is for.
|
||||
* Returns the root SVGTextFrame this iterator is for.
|
||||
*/
|
||||
nsSVGTextFrame2* Root() const
|
||||
SVGTextFrame* Root() const
|
||||
{
|
||||
return mFrameIterator.Root();
|
||||
}
|
||||
@ -1937,7 +1937,7 @@ TextRenderedRunIterator::Next()
|
||||
charIndex = mTextElementCharIndex;
|
||||
|
||||
// Find the end of the rendered run, by looking through the
|
||||
// nsSVGTextFrame2's positions array until we find one that is recorded
|
||||
// SVGTextFrame's positions array until we find one that is recorded
|
||||
// as a run boundary.
|
||||
uint32_t runStart, runEnd; // XXX Replace runStart with mTextElementCharIndex.
|
||||
runStart = mTextElementCharIndex;
|
||||
@ -1954,7 +1954,7 @@ TextRenderedRunIterator::Next()
|
||||
length = runEnd - runStart;
|
||||
|
||||
// If the end of the frame's content comes before the run boundary we found
|
||||
// in nsSVGTextFrame2's position array, we need to shorten the rendered run.
|
||||
// in SVGTextFrame's position array, we need to shorten the rendered run.
|
||||
uint32_t contentEnd = frame->GetContentEnd();
|
||||
if (offset + length > contentEnd) {
|
||||
length = contentEnd - offset;
|
||||
@ -2048,7 +2048,7 @@ TextRenderedRunIterator::First()
|
||||
// CharIterator
|
||||
|
||||
/**
|
||||
* Iterator for characters within an nsSVGTextFrame2.
|
||||
* Iterator for characters within an SVGTextFrame.
|
||||
*/
|
||||
class CharIterator
|
||||
{
|
||||
@ -2076,13 +2076,13 @@ public:
|
||||
/**
|
||||
* Constructs a CharIterator.
|
||||
*
|
||||
* @param aSVGTextFrame The nsSVGTextFrame2 whose characters to iterate
|
||||
* @param aSVGTextFrame The SVGTextFrame whose characters to iterate
|
||||
* through.
|
||||
* @param aFilter Indicates which characters to iterate over.
|
||||
* @param aSubtree A content subtree to track whether the current character
|
||||
* is within.
|
||||
*/
|
||||
CharIterator(nsSVGTextFrame2* aSVGTextFrame,
|
||||
CharIterator(SVGTextFrame* aSVGTextFrame,
|
||||
CharacterFilter aFilter,
|
||||
nsIContent* aSubtree = nullptr);
|
||||
|
||||
@ -2360,7 +2360,7 @@ private:
|
||||
float mLengthAdjustScaleFactor;
|
||||
};
|
||||
|
||||
CharIterator::CharIterator(nsSVGTextFrame2* aSVGTextFrame,
|
||||
CharIterator::CharIterator(SVGTextFrame* aSVGTextFrame,
|
||||
CharIterator::CharacterFilter aFilter,
|
||||
nsIContent* aSubtree)
|
||||
: mFilter(aFilter),
|
||||
@ -3049,7 +3049,7 @@ SVGTextContextPaint::Paint::GetPattern(float aOpacity,
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// nsSVGTextFrame2
|
||||
// SVGTextFrame
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Display list item
|
||||
@ -3057,7 +3057,7 @@ SVGTextContextPaint::Paint::GetPattern(float aOpacity,
|
||||
class nsDisplaySVGText : public nsDisplayItem {
|
||||
public:
|
||||
nsDisplaySVGText(nsDisplayListBuilder* aBuilder,
|
||||
nsSVGTextFrame2* aFrame)
|
||||
SVGTextFrame* aFrame)
|
||||
: nsDisplayItem(aBuilder, aFrame)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplaySVGText);
|
||||
@ -3081,7 +3081,7 @@ void
|
||||
nsDisplaySVGText::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
||||
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames)
|
||||
{
|
||||
nsSVGTextFrame2 *frame = static_cast<nsSVGTextFrame2*>(mFrame);
|
||||
SVGTextFrame *frame = static_cast<SVGTextFrame*>(mFrame);
|
||||
nsPoint pointRelativeToReferenceFrame = aRect.Center();
|
||||
// ToReferenceFrame() includes frame->GetPosition(), our user space position.
|
||||
nsPoint userSpacePt = pointRelativeToReferenceFrame -
|
||||
@ -3104,39 +3104,39 @@ nsDisplaySVGText::Paint(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
aCtx->PushState();
|
||||
aCtx->Translate(offset);
|
||||
static_cast<nsSVGTextFrame2*>(mFrame)->PaintSVG(aCtx, nullptr);
|
||||
static_cast<SVGTextFrame*>(mFrame)->PaintSVG(aCtx, nullptr);
|
||||
aCtx->PopState();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// nsQueryFrame methods
|
||||
|
||||
NS_QUERYFRAME_HEAD(nsSVGTextFrame2)
|
||||
NS_QUERYFRAME_ENTRY(nsSVGTextFrame2)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(nsSVGTextFrame2Base)
|
||||
NS_QUERYFRAME_HEAD(SVGTextFrame)
|
||||
NS_QUERYFRAME_ENTRY(SVGTextFrame)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(SVGTextFrameBase)
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
nsIFrame*
|
||||
NS_NewSVGTextFrame2(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||
{
|
||||
return new (aPresShell) nsSVGTextFrame2(aContext);
|
||||
return new (aPresShell) SVGTextFrame(aContext);
|
||||
}
|
||||
|
||||
NS_IMPL_FRAMEARENA_HELPERS(nsSVGTextFrame2)
|
||||
NS_IMPL_FRAMEARENA_HELPERS(SVGTextFrame)
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// nsIFrame methods
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
SVGTextFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
NS_ASSERTION(aContent->IsSVG(nsGkAtoms::text), "Content is not an SVG text");
|
||||
|
||||
nsSVGTextFrame2Base::Init(aContent, aParent, aPrevInFlow);
|
||||
SVGTextFrameBase::Init(aContent, aParent, aPrevInFlow);
|
||||
AddStateBits((aParent->GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD) |
|
||||
NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_SVG_TEXT);
|
||||
|
||||
@ -3144,9 +3144,9 @@ nsSVGTextFrame2::Init(nsIContent* aContent,
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists)
|
||||
SVGTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
if (NS_SUBTREE_DIRTY(this)) {
|
||||
// We can sometimes be asked to paint before reflow happens and we
|
||||
@ -3159,9 +3159,9 @@ nsSVGTextFrame2::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextFrame2::AttributeChanged(int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
int32_t aModType)
|
||||
SVGTextFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
int32_t aModType)
|
||||
{
|
||||
if (aNameSpaceID != kNameSpaceID_None)
|
||||
return NS_OK;
|
||||
@ -3188,13 +3188,13 @@ nsSVGTextFrame2::AttributeChanged(int32_t aNameSpaceID,
|
||||
}
|
||||
|
||||
nsIAtom *
|
||||
nsSVGTextFrame2::GetType() const
|
||||
SVGTextFrame::GetType() const
|
||||
{
|
||||
return nsGkAtoms::svgTextFrame2;
|
||||
return nsGkAtoms::svgTextFrame;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
SVGTextFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
{
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
// We need this DidSetStyleContext override to handle cases like this:
|
||||
@ -3222,7 +3222,7 @@ nsSVGTextFrame2::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::ReflowSVGNonDisplayText()
|
||||
SVGTextFrame::ReflowSVGNonDisplayText()
|
||||
{
|
||||
MOZ_ASSERT(nsSVGUtils::AnyOuterSVGIsCallingReflowSVG(this),
|
||||
"only call ReflowSVGNonDisplayText when an outer SVG frame is "
|
||||
@ -3237,7 +3237,7 @@ nsSVGTextFrame2::ReflowSVGNonDisplayText()
|
||||
|
||||
// We also need to call InvalidateRenderingObservers, so that if the <text>
|
||||
// element is within a <mask>, say, the element referencing the <mask> will
|
||||
// be updated, which will then cause this nsSVGTextFrame2 to be painted and
|
||||
// be updated, which will then cause this SVGTextFrame to be painted and
|
||||
// in doing so cause the anonymous block frame to be reflowed.
|
||||
nsSVGEffects::InvalidateRenderingObservers(this);
|
||||
|
||||
@ -3249,7 +3249,7 @@ nsSVGTextFrame2::ReflowSVGNonDisplayText()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::ScheduleReflowSVGNonDisplayText()
|
||||
SVGTextFrame::ScheduleReflowSVGNonDisplayText()
|
||||
{
|
||||
MOZ_ASSERT(!nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"do not call ScheduleReflowSVGNonDisplayText when the outer SVG "
|
||||
@ -3291,19 +3291,19 @@ nsSVGTextFrame2::ScheduleReflowSVGNonDisplayText()
|
||||
f, nsIPresShell::eResize, NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsSVGTextFrame2::MutationObserver, nsIMutationObserver)
|
||||
NS_IMPL_ISUPPORTS1(SVGTextFrame::MutationObserver, nsIMutationObserver)
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::MutationObserver::ContentAppended(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aFirstNewContent,
|
||||
int32_t aNewIndexInContainer)
|
||||
SVGTextFrame::MutationObserver::ContentAppended(nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aFirstNewContent,
|
||||
int32_t aNewIndexInContainer)
|
||||
{
|
||||
mFrame->NotifyGlyphMetricsChange();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::MutationObserver::ContentInserted(
|
||||
SVGTextFrame::MutationObserver::ContentInserted(
|
||||
nsIDocument* aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
@ -3313,7 +3313,7 @@ nsSVGTextFrame2::MutationObserver::ContentInserted(
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::MutationObserver::ContentRemoved(
|
||||
SVGTextFrame::MutationObserver::ContentRemoved(
|
||||
nsIDocument *aDocument,
|
||||
nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
@ -3324,7 +3324,7 @@ nsSVGTextFrame2::MutationObserver::ContentRemoved(
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::MutationObserver::CharacterDataChanged(
|
||||
SVGTextFrame::MutationObserver::CharacterDataChanged(
|
||||
nsIDocument* aDocument,
|
||||
nsIContent* aContent,
|
||||
CharacterDataChangeInfo* aInfo)
|
||||
@ -3333,7 +3333,7 @@ nsSVGTextFrame2::MutationObserver::CharacterDataChanged(
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::MutationObserver::AttributeChanged(
|
||||
SVGTextFrame::MutationObserver::AttributeChanged(
|
||||
nsIDocument* aDocument,
|
||||
mozilla::dom::Element* aElement,
|
||||
int32_t aNameSpaceID,
|
||||
@ -3345,7 +3345,7 @@ nsSVGTextFrame2::MutationObserver::AttributeChanged(
|
||||
}
|
||||
|
||||
// Attribute changes on this element are handled in
|
||||
// nsSVGTextFrame2::AttributeChanged.
|
||||
// SVGTextFrame::AttributeChanged.
|
||||
if (aElement == mFrame->GetContent()) {
|
||||
return;
|
||||
}
|
||||
@ -3373,7 +3373,7 @@ nsSVGTextFrame2::MutationObserver::AttributeChanged(
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::FindCloserFrameForSelection(
|
||||
SVGTextFrame::FindCloserFrameForSelection(
|
||||
nsPoint aPoint,
|
||||
nsIFrame::FrameWithDistance* aCurrentBestFrame)
|
||||
{
|
||||
@ -3410,7 +3410,7 @@ nsSVGTextFrame2::FindCloserFrameForSelection(
|
||||
// nsISVGChildFrame methods
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::NotifySVGChanged(uint32_t aFlags)
|
||||
SVGTextFrame::NotifySVGChanged(uint32_t aFlags)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED),
|
||||
"Invalidation logic may need adjusting");
|
||||
@ -3521,9 +3521,9 @@ ShouldPaintCaret(const TextRenderedRun& aThisRun, nsCaret* aCaret)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
|
||||
const nsIntRect *aDirtyRect,
|
||||
nsIFrame* aTransformRoot)
|
||||
SVGTextFrame::PaintSVG(nsRenderingContext* aContext,
|
||||
const nsIntRect *aDirtyRect,
|
||||
nsIFrame* aTransformRoot)
|
||||
{
|
||||
nsIFrame* kid = GetFirstPrincipalChild();
|
||||
if (!kid)
|
||||
@ -3656,7 +3656,7 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsIFrame*)
|
||||
nsSVGTextFrame2::GetFrameForPoint(const nsPoint& aPoint)
|
||||
SVGTextFrame::GetFrameForPoint(const nsPoint& aPoint)
|
||||
{
|
||||
NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
|
||||
|
||||
@ -3700,14 +3700,14 @@ nsSVGTextFrame2::GetFrameForPoint(const nsPoint& aPoint)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsRect)
|
||||
nsSVGTextFrame2::GetCoveredRegion()
|
||||
SVGTextFrame::GetCoveredRegion()
|
||||
{
|
||||
return nsSVGUtils::TransformFrameRectToOuterSVG(
|
||||
mRect, GetCanvasTM(FOR_OUTERSVG_TM), PresContext());
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::ReflowSVG()
|
||||
SVGTextFrame::ReflowSVG()
|
||||
{
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probaby a wasteful mistake");
|
||||
@ -3775,7 +3775,7 @@ nsSVGTextFrame2::ReflowSVG()
|
||||
// XXX nsSVGContainerFrame::ReflowSVG only looks at its nsISVGChildFrame
|
||||
// children, and calls ConsiderChildOverflow on them. Does it matter
|
||||
// that ConsiderChildOverflow won't be called on our children?
|
||||
nsSVGTextFrame2Base::ReflowSVG();
|
||||
SVGTextFrameBase::ReflowSVG();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3801,8 +3801,8 @@ TextRenderedRunFlagsForBBoxContribution(const TextRenderedRun& aRun,
|
||||
}
|
||||
|
||||
SVGBBox
|
||||
nsSVGTextFrame2::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
uint32_t aFlags)
|
||||
SVGTextFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
|
||||
|
||||
@ -3826,7 +3826,7 @@ nsSVGTextFrame2::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
// nsSVGContainerFrame methods
|
||||
|
||||
gfxMatrix
|
||||
nsSVGTextFrame2::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot)
|
||||
SVGTextFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot)
|
||||
{
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY) &&
|
||||
!aTransformRoot) {
|
||||
@ -3855,7 +3855,7 @@ nsSVGTextFrame2::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGTextFrame2 SVG DOM methods
|
||||
// SVGTextFrame SVG DOM methods
|
||||
|
||||
/**
|
||||
* Returns whether the specified node has any non-empty nsTextNodes
|
||||
@ -3892,7 +3892,7 @@ GetTextContentLength(nsIContent* aContent)
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsSVGTextFrame2::ConvertTextElementCharIndexToAddressableIndex(
|
||||
SVGTextFrame::ConvertTextElementCharIndexToAddressableIndex(
|
||||
int32_t aIndex,
|
||||
nsIContent* aContent)
|
||||
{
|
||||
@ -3924,7 +3924,7 @@ nsSVGTextFrame2::ConvertTextElementCharIndexToAddressableIndex(
|
||||
* text content element.
|
||||
*/
|
||||
uint32_t
|
||||
nsSVGTextFrame2::GetNumberOfChars(nsIContent* aContent)
|
||||
SVGTextFrame::GetNumberOfChars(nsIContent* aContent)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -3944,7 +3944,7 @@ nsSVGTextFrame2::GetNumberOfChars(nsIContent* aContent)
|
||||
* text child element.
|
||||
*/
|
||||
float
|
||||
nsSVGTextFrame2::GetComputedTextLength(nsIContent* aContent)
|
||||
SVGTextFrame::GetComputedTextLength(nsIContent* aContent)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -3967,8 +3967,8 @@ nsSVGTextFrame2::GetComputedTextLength(nsIContent* aContent)
|
||||
* text content element.
|
||||
*/
|
||||
nsresult
|
||||
nsSVGTextFrame2::SelectSubString(nsIContent* aContent,
|
||||
uint32_t charnum, uint32_t nchars)
|
||||
SVGTextFrame::SelectSubString(nsIContent* aContent,
|
||||
uint32_t charnum, uint32_t nchars)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -3999,9 +3999,9 @@ nsSVGTextFrame2::SelectSubString(nsIContent* aContent,
|
||||
* text content element.
|
||||
*/
|
||||
nsresult
|
||||
nsSVGTextFrame2::GetSubStringLength(nsIContent* aContent,
|
||||
uint32_t charnum, uint32_t nchars,
|
||||
float* aResult)
|
||||
SVGTextFrame::GetSubStringLength(nsIContent* aContent,
|
||||
uint32_t charnum, uint32_t nchars,
|
||||
float* aResult)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -4073,8 +4073,8 @@ nsSVGTextFrame2::GetSubStringLength(nsIContent* aContent,
|
||||
* text content element.
|
||||
*/
|
||||
int32_t
|
||||
nsSVGTextFrame2::GetCharNumAtPosition(nsIContent* aContent,
|
||||
mozilla::nsISVGPoint* aPoint)
|
||||
SVGTextFrame::GetCharNumAtPosition(nsIContent* aContent,
|
||||
mozilla::nsISVGPoint* aPoint)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -4105,9 +4105,9 @@ nsSVGTextFrame2::GetCharNumAtPosition(nsIContent* aContent,
|
||||
* text content element.
|
||||
*/
|
||||
nsresult
|
||||
nsSVGTextFrame2::GetStartPositionOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
mozilla::nsISVGPoint** aResult)
|
||||
SVGTextFrame::GetStartPositionOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
mozilla::nsISVGPoint** aResult)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -4129,9 +4129,9 @@ nsSVGTextFrame2::GetStartPositionOfChar(nsIContent* aContent,
|
||||
* text content element.
|
||||
*/
|
||||
nsresult
|
||||
nsSVGTextFrame2::GetEndPositionOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
mozilla::nsISVGPoint** aResult)
|
||||
SVGTextFrame::GetEndPositionOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
mozilla::nsISVGPoint** aResult)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -4166,9 +4166,9 @@ nsSVGTextFrame2::GetEndPositionOfChar(nsIContent* aContent,
|
||||
* text content element.
|
||||
*/
|
||||
nsresult
|
||||
nsSVGTextFrame2::GetExtentOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
dom::SVGIRect** aResult)
|
||||
SVGTextFrame::GetExtentOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
dom::SVGIRect** aResult)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -4217,9 +4217,9 @@ nsSVGTextFrame2::GetExtentOfChar(nsIContent* aContent,
|
||||
* text content element.
|
||||
*/
|
||||
nsresult
|
||||
nsSVGTextFrame2::GetRotationOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
float* aResult)
|
||||
SVGTextFrame::GetRotationOfChar(nsIContent* aContent,
|
||||
uint32_t aCharNum,
|
||||
float* aResult)
|
||||
{
|
||||
UpdateGlyphPositioning();
|
||||
|
||||
@ -4234,7 +4234,7 @@ nsSVGTextFrame2::GetRotationOfChar(nsIContent* aContent,
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGTextFrame2 text layout methods
|
||||
// SVGTextFrame text layout methods
|
||||
|
||||
/**
|
||||
* Given the character position array before values have been filled in
|
||||
@ -4284,11 +4284,11 @@ ShouldStartRunAtIndex(const nsTArray<CharPosition>& aPositions,
|
||||
}
|
||||
|
||||
uint32_t
|
||||
nsSVGTextFrame2::ResolvePositions(nsIContent* aContent,
|
||||
uint32_t aIndex,
|
||||
bool aInTextPath,
|
||||
bool& aForceStartOfChunk,
|
||||
nsTArray<gfxPoint>& aDeltas)
|
||||
SVGTextFrame::ResolvePositions(nsIContent* aContent,
|
||||
uint32_t aIndex,
|
||||
bool aInTextPath,
|
||||
bool& aForceStartOfChunk,
|
||||
nsTArray<gfxPoint>& aDeltas)
|
||||
{
|
||||
if (aContent->IsNodeOfType(nsINode::eTEXT)) {
|
||||
// We found a text node.
|
||||
@ -4435,8 +4435,8 @@ nsSVGTextFrame2::ResolvePositions(nsIContent* aContent,
|
||||
}
|
||||
|
||||
bool
|
||||
nsSVGTextFrame2::ResolvePositions(nsTArray<gfxPoint>& aDeltas,
|
||||
bool aRunPerGlyph)
|
||||
SVGTextFrame::ResolvePositions(nsTArray<gfxPoint>& aDeltas,
|
||||
bool aRunPerGlyph)
|
||||
{
|
||||
NS_ASSERTION(mPositions.IsEmpty(), "expected mPositions to be empty");
|
||||
RemoveStateBits(NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES);
|
||||
@ -4472,7 +4472,7 @@ nsSVGTextFrame2::ResolvePositions(nsTArray<gfxPoint>& aDeltas,
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::DetermineCharPositions(nsTArray<nsPoint>& aPositions)
|
||||
SVGTextFrame::DetermineCharPositions(nsTArray<nsPoint>& aPositions)
|
||||
{
|
||||
NS_ASSERTION(aPositions.IsEmpty(), "expected aPositions to be empty");
|
||||
|
||||
@ -4610,7 +4610,7 @@ ShiftAnchoredChunk(nsTArray<mozilla::CharPosition>& aCharPositions,
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::AdjustChunksForLineBreaks()
|
||||
SVGTextFrame::AdjustChunksForLineBreaks()
|
||||
{
|
||||
nsBlockFrame* block = nsLayoutUtils::GetAsBlock(GetFirstPrincipalChild());
|
||||
NS_ASSERTION(block, "expected block frame");
|
||||
@ -4628,7 +4628,7 @@ nsSVGTextFrame2::AdjustChunksForLineBreaks()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::AdjustPositionsForClusters()
|
||||
SVGTextFrame::AdjustPositionsForClusters()
|
||||
{
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
@ -4686,7 +4686,7 @@ nsSVGTextFrame2::AdjustPositionsForClusters()
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsSVGTextFrame2::GetTextPathPathFrame(nsIFrame* aTextPathFrame)
|
||||
SVGTextFrame::GetTextPathPathFrame(nsIFrame* aTextPathFrame)
|
||||
{
|
||||
nsSVGTextPathProperty *property = static_cast<nsSVGTextPathProperty*>
|
||||
(aTextPathFrame->Properties().Get(nsSVGEffects::HrefProperty()));
|
||||
@ -4715,7 +4715,7 @@ nsSVGTextFrame2::GetTextPathPathFrame(nsIFrame* aTextPathFrame)
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
nsSVGTextFrame2::GetTextPath(nsIFrame* aTextPathFrame)
|
||||
SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame)
|
||||
{
|
||||
nsIFrame *pathFrame = GetTextPathPathFrame(aTextPathFrame);
|
||||
|
||||
@ -4742,7 +4742,7 @@ nsSVGTextFrame2::GetTextPath(nsIFrame* aTextPathFrame)
|
||||
}
|
||||
|
||||
gfxFloat
|
||||
nsSVGTextFrame2::GetOffsetScale(nsIFrame* aTextPathFrame)
|
||||
SVGTextFrame::GetOffsetScale(nsIFrame* aTextPathFrame)
|
||||
{
|
||||
nsIFrame *pathFrame = GetTextPathPathFrame(aTextPathFrame);
|
||||
if (!pathFrame)
|
||||
@ -4753,7 +4753,7 @@ nsSVGTextFrame2::GetOffsetScale(nsIFrame* aTextPathFrame)
|
||||
}
|
||||
|
||||
gfxFloat
|
||||
nsSVGTextFrame2::GetStartOffset(nsIFrame* aTextPathFrame)
|
||||
SVGTextFrame::GetStartOffset(nsIFrame* aTextPathFrame)
|
||||
{
|
||||
dom::SVGTextPathElement *tp =
|
||||
static_cast<dom::SVGTextPathElement*>(aTextPathFrame->GetContent());
|
||||
@ -4770,7 +4770,7 @@ nsSVGTextFrame2::GetStartOffset(nsIFrame* aTextPathFrame)
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::DoTextPathLayout()
|
||||
SVGTextFrame::DoTextPathLayout()
|
||||
{
|
||||
nsPresContext* context = PresContext();
|
||||
|
||||
@ -4835,7 +4835,7 @@ nsSVGTextFrame2::DoTextPathLayout()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::DoAnchoring()
|
||||
SVGTextFrame::DoAnchoring()
|
||||
{
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
||||
@ -4888,7 +4888,7 @@ nsSVGTextFrame2::DoAnchoring()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::DoGlyphPositioning()
|
||||
SVGTextFrame::DoGlyphPositioning()
|
||||
{
|
||||
mPositions.Clear();
|
||||
RemoveStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
|
||||
@ -5033,9 +5033,9 @@ nsSVGTextFrame2::DoGlyphPositioning()
|
||||
}
|
||||
|
||||
bool
|
||||
nsSVGTextFrame2::ShouldRenderAsPath(nsRenderingContext* aContext,
|
||||
nsTextFrame* aFrame,
|
||||
bool& aShouldPaintSVGGlyphs)
|
||||
SVGTextFrame::ShouldRenderAsPath(nsRenderingContext* aContext,
|
||||
nsTextFrame* aFrame,
|
||||
bool& aShouldPaintSVGGlyphs)
|
||||
{
|
||||
// Rendering to a clip path.
|
||||
if (SVGAutoRenderState::GetRenderMode(aContext) != SVGAutoRenderState::NORMAL) {
|
||||
@ -5067,7 +5067,7 @@ nsSVGTextFrame2::ShouldRenderAsPath(nsRenderingContext* aContext,
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::ScheduleReflowSVG()
|
||||
SVGTextFrame::ScheduleReflowSVG()
|
||||
{
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
ScheduleReflowSVGNonDisplayText();
|
||||
@ -5077,7 +5077,7 @@ nsSVGTextFrame2::ScheduleReflowSVG()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::NotifyGlyphMetricsChange()
|
||||
SVGTextFrame::NotifyGlyphMetricsChange()
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
|
||||
nsSVGEffects::InvalidateRenderingObservers(this);
|
||||
@ -5085,7 +5085,7 @@ nsSVGTextFrame2::NotifyGlyphMetricsChange()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::UpdateGlyphPositioning()
|
||||
SVGTextFrame::UpdateGlyphPositioning()
|
||||
{
|
||||
nsIFrame* kid = GetFirstPrincipalChild();
|
||||
if (!kid) {
|
||||
@ -5098,7 +5098,7 @@ nsSVGTextFrame2::UpdateGlyphPositioning()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::MaybeReflowAnonymousBlockChild()
|
||||
SVGTextFrame::MaybeReflowAnonymousBlockChild()
|
||||
{
|
||||
nsIFrame* kid = GetFirstPrincipalChild();
|
||||
if (!kid)
|
||||
@ -5123,7 +5123,7 @@ nsSVGTextFrame2::MaybeReflowAnonymousBlockChild()
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::DoReflow()
|
||||
SVGTextFrame::DoReflow()
|
||||
{
|
||||
// Since we are going to reflow the anonymous block frame, we will
|
||||
// need to update mPositions.
|
||||
@ -5132,7 +5132,7 @@ nsSVGTextFrame2::DoReflow()
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
// Normally, these dirty flags would be cleared in ReflowSVG(), but that
|
||||
// doesn't get called for non-display frames. We don't want to reflow our
|
||||
// descendants every time nsSVGTextFrame2::PaintSVG makes sure that we have
|
||||
// descendants every time SVGTextFrame::PaintSVG makes sure that we have
|
||||
// valid positions by calling UpdateGlyphPositioning(), so we need to clear
|
||||
// these dirty bits. Note that this also breaks an invalidation loop where
|
||||
// our descendants invalidate as they reflow, which invalidates rendering
|
||||
@ -5190,7 +5190,7 @@ nsSVGTextFrame2::DoReflow()
|
||||
#define PRECISE_SIZE 200.0
|
||||
|
||||
bool
|
||||
nsSVGTextFrame2::UpdateFontSizeScaleFactor()
|
||||
SVGTextFrame::UpdateFontSizeScaleFactor()
|
||||
{
|
||||
double oldFontSizeScaleFactor = mFontSizeScaleFactor;
|
||||
|
||||
@ -5280,7 +5280,7 @@ nsSVGTextFrame2::UpdateFontSizeScaleFactor()
|
||||
}
|
||||
|
||||
double
|
||||
nsSVGTextFrame2::GetFontSizeScaleFactor() const
|
||||
SVGTextFrame::GetFontSizeScaleFactor() const
|
||||
{
|
||||
return mFontSizeScaleFactor;
|
||||
}
|
||||
@ -5291,12 +5291,12 @@ nsSVGTextFrame2::GetFontSizeScaleFactor() const
|
||||
* which rendered run the point hits.
|
||||
*/
|
||||
gfxPoint
|
||||
nsSVGTextFrame2::TransformFramePointToTextChild(const gfxPoint& aPoint,
|
||||
nsIFrame* aChildFrame)
|
||||
SVGTextFrame::TransformFramePointToTextChild(const gfxPoint& aPoint,
|
||||
nsIFrame* aChildFrame)
|
||||
{
|
||||
NS_ASSERTION(aChildFrame &&
|
||||
nsLayoutUtils::GetClosestFrameOfType
|
||||
(aChildFrame->GetParent(), nsGkAtoms::svgTextFrame2) == this,
|
||||
(aChildFrame->GetParent(), nsGkAtoms::svgTextFrame) == this,
|
||||
"aChildFrame must be a descendant of this frame");
|
||||
|
||||
UpdateGlyphPositioning();
|
||||
@ -5368,12 +5368,12 @@ nsSVGTextFrame2::TransformFramePointToTextChild(const gfxPoint& aPoint,
|
||||
* and union them all together.
|
||||
*/
|
||||
gfxRect
|
||||
nsSVGTextFrame2::TransformFrameRectToTextChild(const gfxRect& aRect,
|
||||
nsIFrame* aChildFrame)
|
||||
SVGTextFrame::TransformFrameRectToTextChild(const gfxRect& aRect,
|
||||
nsIFrame* aChildFrame)
|
||||
{
|
||||
NS_ASSERTION(aChildFrame &&
|
||||
nsLayoutUtils::GetClosestFrameOfType
|
||||
(aChildFrame->GetParent(), nsGkAtoms::svgTextFrame2) == this,
|
||||
(aChildFrame->GetParent(), nsGkAtoms::svgTextFrame) == this,
|
||||
"aChildFrame must be a descendant of this frame");
|
||||
|
||||
UpdateGlyphPositioning();
|
||||
@ -5445,12 +5445,12 @@ nsSVGTextFrame2::TransformFrameRectToTextChild(const gfxRect& aRect,
|
||||
* The result is the union of all of these.
|
||||
*/
|
||||
gfxRect
|
||||
nsSVGTextFrame2::TransformFrameRectFromTextChild(const nsRect& aRect,
|
||||
nsIFrame* aChildFrame)
|
||||
SVGTextFrame::TransformFrameRectFromTextChild(const nsRect& aRect,
|
||||
nsIFrame* aChildFrame)
|
||||
{
|
||||
NS_ASSERTION(aChildFrame &&
|
||||
nsLayoutUtils::GetClosestFrameOfType
|
||||
(aChildFrame->GetParent(), nsGkAtoms::svgTextFrame2) == this,
|
||||
(aChildFrame->GetParent(), nsGkAtoms::svgTextFrame) == this,
|
||||
"aChildFrame must be a descendant of this frame");
|
||||
|
||||
UpdateGlyphPositioning();
|
||||
@ -5499,10 +5499,10 @@ nsSVGTextFrame2::TransformFrameRectFromTextChild(const nsRect& aRect,
|
||||
}
|
||||
|
||||
DrawMode
|
||||
nsSVGTextFrame2::SetupCairoState(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
gfxTextContextPaint** aThisContextPaint)
|
||||
SVGTextFrame::SetupCairoState(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
gfxTextContextPaint** aThisContextPaint)
|
||||
{
|
||||
DrawMode toDraw = DrawMode(0);
|
||||
SVGTextContextPaint *thisContextPaint = new SVGTextContextPaint();
|
||||
@ -5521,10 +5521,10 @@ nsSVGTextFrame2::SetupCairoState(gfxContext* aContext,
|
||||
}
|
||||
|
||||
bool
|
||||
nsSVGTextFrame2::SetupCairoStroke(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
SVGTextContextPaint* aThisContextPaint)
|
||||
SVGTextFrame::SetupCairoStroke(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
SVGTextContextPaint* aThisContextPaint)
|
||||
{
|
||||
const nsStyleSVG *style = aFrame->StyleSVG();
|
||||
if (style->mStroke.mType == eStyleSVGPaintType_None) {
|
||||
@ -5547,10 +5547,10 @@ nsSVGTextFrame2::SetupCairoStroke(gfxContext* aContext,
|
||||
}
|
||||
|
||||
bool
|
||||
nsSVGTextFrame2::SetupCairoFill(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
SVGTextContextPaint* aThisContextPaint)
|
||||
SVGTextFrame::SetupCairoFill(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
SVGTextContextPaint* aThisContextPaint)
|
||||
{
|
||||
const nsStyleSVG *style = aFrame->StyleSVG();
|
||||
if (style->mFill.mType == eStyleSVGPaintType_None) {
|
||||
@ -5572,13 +5572,13 @@ nsSVGTextFrame2::SetupCairoFill(gfxContext* aContext,
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTextFrame2::SetupInheritablePaint(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
float& aOpacity,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
SVGTextContextPaint::Paint& aTargetPaint,
|
||||
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
||||
const FramePropertyDescriptor* aProperty)
|
||||
SVGTextFrame::SetupInheritablePaint(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
float& aOpacity,
|
||||
gfxTextContextPaint* aOuterContextPaint,
|
||||
SVGTextContextPaint::Paint& aTargetPaint,
|
||||
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
||||
const FramePropertyDescriptor* aProperty)
|
||||
{
|
||||
const nsStyleSVG *style = aFrame->StyleSVG();
|
||||
nsSVGPaintServerFrame *ps =
|
||||
@ -5604,11 +5604,11 @@ nsSVGTextFrame2::SetupInheritablePaint(gfxContext* aContext,
|
||||
}
|
||||
|
||||
bool
|
||||
nsSVGTextFrame2::SetupContextPaint(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
||||
float& aOpacity,
|
||||
gfxTextContextPaint* aOuterContextPaint)
|
||||
SVGTextFrame::SetupContextPaint(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
||||
float& aOpacity,
|
||||
gfxTextContextPaint* aOuterContextPaint)
|
||||
{
|
||||
if (!aOuterContextPaint) {
|
||||
return false;
|
@ -3,8 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef NS_SVGTEXTFRAME2_H
|
||||
#define NS_SVGTEXTFRAME2_H
|
||||
#ifndef MOZILLA_SVGTEXTFRAME_H
|
||||
#define MOZILLA_SVGTEXTFRAME_H
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
@ -18,10 +18,10 @@
|
||||
|
||||
class nsDisplaySVGText;
|
||||
class nsRenderingContext;
|
||||
class nsSVGTextFrame2;
|
||||
class SVGTextFrame;
|
||||
class nsTextFrame;
|
||||
|
||||
typedef nsSVGDisplayContainerFrame nsSVGTextFrame2Base;
|
||||
typedef nsSVGDisplayContainerFrame SVGTextFrameBase;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -125,16 +125,16 @@ private:
|
||||
|
||||
/**
|
||||
* A runnable to mark glyph positions as needing to be recomputed
|
||||
* and to invalid the bounds of the nsSVGTextFrame2 frame.
|
||||
* and to invalid the bounds of the SVGTextFrame frame.
|
||||
*/
|
||||
class GlyphMetricsUpdater : public nsRunnable {
|
||||
public:
|
||||
NS_DECL_NSIRUNNABLE
|
||||
GlyphMetricsUpdater(nsSVGTextFrame2* aFrame) : mFrame(aFrame) { }
|
||||
static void Run(nsSVGTextFrame2* aFrame);
|
||||
GlyphMetricsUpdater(SVGTextFrame* aFrame) : mFrame(aFrame) { }
|
||||
static void Run(SVGTextFrame* aFrame);
|
||||
void Revoke() { mFrame = nullptr; }
|
||||
private:
|
||||
nsSVGTextFrame2* mFrame;
|
||||
SVGTextFrame* mFrame;
|
||||
};
|
||||
|
||||
// Slightly horrible callback for deferring application of opacity
|
||||
@ -208,10 +208,10 @@ struct SVGTextContextPaint : public gfxTextContextPaint {
|
||||
* Frame class for SVG <text> elements, used when the
|
||||
* layout.svg.css-text.enabled is true.
|
||||
*
|
||||
* An nsSVGTextFrame2 manages SVG text layout, painting and interaction for
|
||||
* An SVGTextFrame manages SVG text layout, painting and interaction for
|
||||
* all descendent text content elements. The frame tree will look like this:
|
||||
*
|
||||
* nsSVGTextFrame2 -- for <text>
|
||||
* SVGTextFrame -- for <text>
|
||||
* <anonymous block frame>
|
||||
* ns{Block,Inline,Text}Frames -- for text nodes, <tspan>s, <a>s, etc.
|
||||
*
|
||||
@ -238,10 +238,10 @@ struct SVGTextContextPaint : public gfxTextContextPaint {
|
||||
* itself do the painting. Otherwise, a DrawPathCallback is passed to
|
||||
* PaintText so that we can fill the text geometry with SVG paint servers.
|
||||
*/
|
||||
class nsSVGTextFrame2 : public nsSVGTextFrame2Base
|
||||
class SVGTextFrame : public SVGTextFrameBase
|
||||
{
|
||||
friend nsIFrame*
|
||||
NS_NewSVGTextFrame2(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
|
||||
friend class mozilla::CharIterator;
|
||||
friend class mozilla::GlyphMetricsUpdater;
|
||||
@ -256,8 +256,8 @@ class nsSVGTextFrame2 : public nsSVGTextFrame2Base
|
||||
typedef mozilla::SVGTextContextPaint SVGTextContextPaint;
|
||||
|
||||
protected:
|
||||
nsSVGTextFrame2(nsStyleContext* aContext)
|
||||
: nsSVGTextFrame2Base(aContext),
|
||||
SVGTextFrame(nsStyleContext* aContext)
|
||||
: SVGTextFrameBase(aContext),
|
||||
mFontSizeScaleFactor(1.0f),
|
||||
mLastContextScale(1.0f),
|
||||
mLengthAdjustScaleFactor(1.0f)
|
||||
@ -266,7 +266,7 @@ protected:
|
||||
}
|
||||
|
||||
public:
|
||||
NS_DECL_QUERYFRAME_TARGET(nsSVGTextFrame2)
|
||||
NS_DECL_QUERYFRAME_TARGET(SVGTextFrame)
|
||||
NS_DECL_QUERYFRAME
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
@ -291,14 +291,14 @@ public:
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
* @see nsGkAtoms::svgTextFrame2
|
||||
* @see nsGkAtoms::svgTextFrame
|
||||
*/
|
||||
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE
|
||||
{
|
||||
return MakeFrameName(NS_LITERAL_STRING("SVGText2"), aResult);
|
||||
return MakeFrameName(NS_LITERAL_STRING("SVGText"), aResult);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -344,7 +344,7 @@ public:
|
||||
nsresult GetRotationOfChar(nsIContent* aContent, uint32_t aCharNum,
|
||||
float* aResult);
|
||||
|
||||
// nsSVGTextFrame2 methods:
|
||||
// SVGTextFrame methods:
|
||||
|
||||
/**
|
||||
* Schedules mPositions to be recomputed and the covered region to be
|
||||
@ -359,14 +359,14 @@ public:
|
||||
void ScheduleReflowSVG();
|
||||
|
||||
/**
|
||||
* Reflows the anonymous block frame of this non-display nsSVGTextFrame2.
|
||||
* Reflows the anonymous block frame of this non-display SVGTextFrame.
|
||||
*
|
||||
* When we are under nsSVGDisplayContainerFrame::ReflowSVG, we need to
|
||||
* reflow any nsSVGTextFrame2 frames in the subtree in case they are
|
||||
* reflow any SVGTextFrame frames in the subtree in case they are
|
||||
* being observed (by being for example in a <mask>) and the change
|
||||
* that caused the reflow would not already have caused a reflow.
|
||||
*
|
||||
* Note that displayed nsSVGTextFrame2s are reflowed as needed, when PaintSVG
|
||||
* Note that displayed SVGTextFrames are reflowed as needed, when PaintSVG
|
||||
* is called or some SVG DOM method is called on the element.
|
||||
*/
|
||||
void ReflowSVGNonDisplayText();
|
||||
@ -382,7 +382,7 @@ public:
|
||||
*
|
||||
* The only case where we have to do this is in response to a style change on
|
||||
* a non-display <text>; the only caller of ScheduleReflowSVGNonDisplayText
|
||||
* currently is nsSVGTextFrame2::DidSetStyleContext.
|
||||
* currently is SVGTextFrame::DidSetStyleContext.
|
||||
*/
|
||||
void ScheduleReflowSVGNonDisplayText();
|
||||
|
||||
@ -434,7 +434,7 @@ private:
|
||||
{
|
||||
}
|
||||
|
||||
void StartObserving(nsSVGTextFrame2* aFrame)
|
||||
void StartObserving(SVGTextFrame* aFrame)
|
||||
{
|
||||
NS_ASSERTION(!mFrame, "should not be observing yet!");
|
||||
mFrame = aFrame;
|
||||
@ -459,12 +459,12 @@ private:
|
||||
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
||||
|
||||
private:
|
||||
nsSVGTextFrame2* mFrame;
|
||||
SVGTextFrame* mFrame;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reflows the anonymous block child if it is dirty or has dirty
|
||||
* children, or if the nsSVGTextFrame2 itself is dirty.
|
||||
* children, or if the SVGTextFrame itself is dirty.
|
||||
*/
|
||||
void MaybeReflowAnonymousBlockChild();
|
||||
|
||||
@ -688,7 +688,7 @@ private:
|
||||
* should be multiplied by to cause the text run font size to (a) be within a
|
||||
* "reasonable" range, and (b) be close to the actual size to be painted on
|
||||
* screen. (The "reasonable" range as determined by some #defines in
|
||||
* nsSVGTextFrame2.cpp is 8..200.)
|
||||
* SVGTextFrame.cpp is 8..200.)
|
||||
*/
|
||||
float mFontSizeScaleFactor;
|
||||
|
@ -36,13 +36,13 @@ UNIFIED_SOURCES += [
|
||||
'nsSVGPatternFrame.cpp',
|
||||
'nsSVGStopFrame.cpp',
|
||||
'nsSVGSwitchFrame.cpp',
|
||||
'nsSVGTextFrame2.cpp',
|
||||
'nsSVGUseFrame.cpp',
|
||||
'nsSVGUtils.cpp',
|
||||
'SVGFEContainerFrame.cpp',
|
||||
'SVGFEImageFrame.cpp',
|
||||
'SVGFELeafFrame.cpp',
|
||||
'SVGFEUnstyledLeafFrame.cpp',
|
||||
'SVGTextFrame.cpp',
|
||||
'SVGViewFrame.cpp',
|
||||
]
|
||||
|
||||
|
@ -260,14 +260,14 @@ nsSVGClipPathFrame::IsValid()
|
||||
nsIAtom *type = grandKid->GetType();
|
||||
|
||||
if (type != nsGkAtoms::svgPathGeometryFrame &&
|
||||
type != nsGkAtoms::svgTextFrame2) {
|
||||
type != nsGkAtoms::svgTextFrame) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (type != nsGkAtoms::svgPathGeometryFrame &&
|
||||
type != nsGkAtoms::svgTextFrame2) {
|
||||
type != nsGkAtoms::svgTextFrame) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "nsSVGElement.h"
|
||||
#include "nsSVGUtils.h"
|
||||
#include "nsSVGAnimatedTransformList.h"
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "SVGTextFrame.h"
|
||||
#include "RestyleManager.h"
|
||||
|
||||
using namespace mozilla;
|
||||
@ -84,25 +84,25 @@ nsSVGContainerFrame::UpdateOverflow()
|
||||
}
|
||||
|
||||
/**
|
||||
* Traverses a frame tree, marking any nsSVGTextFrame2 frames as dirty
|
||||
* Traverses a frame tree, marking any SVGTextFrame frames as dirty
|
||||
* and calling InvalidateRenderingObservers() on it.
|
||||
*
|
||||
* The reason that this helper exists is because nsSVGTextFrame2 is special.
|
||||
* The reason that this helper exists is because SVGTextFrame is special.
|
||||
* None of the other SVG frames ever need to be reflowed when they have the
|
||||
* NS_FRAME_IS_NONDISPLAY bit set on them because their PaintSVG methods
|
||||
* (and those of any containers that they can validly be contained within) do
|
||||
* not make use of mRect or overflow rects. "em" lengths, etc., are resolved
|
||||
* as those elements are painted.
|
||||
*
|
||||
* nsSVGTextFrame2 is different because its anonymous block and inline frames
|
||||
* SVGTextFrame is different because its anonymous block and inline frames
|
||||
* need to be reflowed in order to get the correct metrics when things like
|
||||
* inherited font-size of an ancestor changes, or a delayed webfont loads and
|
||||
* applies.
|
||||
*
|
||||
* We assume that any change that requires the anonymous kid of an
|
||||
* nsSVGTextFrame2 to reflow will result in an NS_FRAME_IS_DIRTY reflow. When
|
||||
* SVGTextFrame to reflow will result in an NS_FRAME_IS_DIRTY reflow. When
|
||||
* that reflow reaches an NS_FRAME_IS_NONDISPLAY frame it would normally
|
||||
* stop, but this helper looks for any nsSVGTextFrame2 descendants of such
|
||||
* stop, but this helper looks for any SVGTextFrame descendants of such
|
||||
* frames and marks them NS_FRAME_IS_DIRTY so that the next time that they are
|
||||
* painted their anonymous kid will first get the necessary reflow.
|
||||
*/
|
||||
@ -118,8 +118,8 @@ nsSVGContainerFrame::ReflowSVGNonDisplayText(nsIFrame* aContainer)
|
||||
for (nsIFrame* kid = aContainer->GetFirstPrincipalChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsIAtom* type = kid->GetType();
|
||||
if (type == nsGkAtoms::svgTextFrame2) {
|
||||
static_cast<nsSVGTextFrame2*>(kid)->ReflowSVGNonDisplayText();
|
||||
if (type == nsGkAtoms::svgTextFrame) {
|
||||
static_cast<SVGTextFrame*>(kid)->ReflowSVGNonDisplayText();
|
||||
} else {
|
||||
if (kid->IsFrameOfType(nsIFrame::eSVG | nsIFrame::eSVGContainer) ||
|
||||
type == nsGkAtoms::svgForeignObjectFrame ||
|
||||
@ -340,7 +340,7 @@ nsSVGDisplayContainerFrame::ReflowSVG()
|
||||
ConsiderChildOverflow(overflowRects, kid);
|
||||
} else {
|
||||
// Inside a non-display container frame, we might have some
|
||||
// nsSVGTextFrame2s. We need to cause those to get reflowed in
|
||||
// SVGTextFrames. We need to cause those to get reflowed in
|
||||
// case they are the target of a rendering observer.
|
||||
NS_ASSERTION(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY,
|
||||
"expected kid to be a NS_FRAME_IS_NONDISPLAY frame");
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Traverses a frame tree, marking any nsSVGTextFrame2 frames as dirty
|
||||
* Traverses a frame tree, marking any SVGTextFrame frames as dirty
|
||||
* and calling InvalidateRenderingObservers() on it.
|
||||
*/
|
||||
static void ReflowSVGNonDisplayText(nsIFrame* aContainer);
|
||||
|
@ -303,7 +303,7 @@ nsSVGTextPathProperty::DoUpdate()
|
||||
//
|
||||
// Note that we still have to post the restyle event when we
|
||||
// change from being valid to invalid, so that mPositions on the
|
||||
// nsSVGTextFrame2 gets updated, skipping the <textPath>, ensuring
|
||||
// SVGTextFrame gets updated, skipping the <textPath>, ensuring
|
||||
// that nothing gets painted for that element.
|
||||
bool nowValid = TargetIsValid();
|
||||
if (!mValid && !nowValid) {
|
||||
|
@ -1174,7 +1174,7 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
|
||||
if (aFrame->IsSVGText()) {
|
||||
nsIFrame* ancestor = GetFirstNonAAncestorFrame(aFrame);
|
||||
if (ancestor && ancestor->IsSVGText()) {
|
||||
while (ancestor->GetType() != nsGkAtoms::svgTextFrame2) {
|
||||
while (ancestor->GetType() != nsGkAtoms::svgTextFrame) {
|
||||
ancestor = ancestor->GetParent();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user