#491: M1443891 M1444231 M1443092 M1448774 M1452416
This commit is contained in:
parent
cf565fc150
commit
01881b1b07
|
@ -178,6 +178,12 @@ nsIContent::DoGetClasses() const
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
Element::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
Element::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||||
{
|
{
|
||||||
|
if (aIID.Equals(NS_GET_IID(Element))) {
|
||||||
|
NS_ADDREF_THIS();
|
||||||
|
*aInstancePtr = this;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_ASSERTION(aInstancePtr,
|
NS_ASSERTION(aInstancePtr,
|
||||||
"QueryInterface requires a non-NULL destination!");
|
"QueryInterface requires a non-NULL destination!");
|
||||||
nsresult rv = FragmentOrElement::QueryInterface(aIID, aInstancePtr);
|
nsresult rv = FragmentOrElement::QueryInterface(aIID, aInstancePtr);
|
||||||
|
|
|
@ -1935,7 +1935,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||||
NS_INTERFACE_MAP_BEGIN(FragmentOrElement)
|
NS_INTERFACE_MAP_BEGIN(FragmentOrElement)
|
||||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||||
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(FragmentOrElement)
|
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(FragmentOrElement)
|
||||||
NS_INTERFACE_MAP_ENTRY(Element)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIContent)
|
NS_INTERFACE_MAP_ENTRY(nsIContent)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsINode)
|
NS_INTERFACE_MAP_ENTRY(nsINode)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
|
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
|
||||||
|
|
|
@ -1497,6 +1497,10 @@ MediaStreamGraphImpl::RunInStableState(bool aSourceIsMSG)
|
||||||
RefPtr<GraphDriver> driver = CurrentDriver();
|
RefPtr<GraphDriver> driver = CurrentDriver();
|
||||||
MonitorAutoUnlock unlock(mMonitor);
|
MonitorAutoUnlock unlock(mMonitor);
|
||||||
driver->Start();
|
driver->Start();
|
||||||
|
// It's not safe to Shutdown() a thread from StableState, and
|
||||||
|
// releasing this may shutdown a SystemClockDriver thread.
|
||||||
|
// Proxy the release to outside of StableState.
|
||||||
|
NS_ReleaseOnMainThread(driver.forget(), true); // always proxy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,13 @@ SVGClipPathElement::GetEnumInfo()
|
||||||
ArrayLength(sEnumInfo));
|
ArrayLength(sEnumInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
SVGClipPathElement::IsUnitsObjectBoundingBox() const
|
||||||
|
{
|
||||||
|
return mEnumAttributes[CLIPPATHUNITS].GetAnimValue() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsIDOMNode methods
|
// nsIDOMNode methods
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ public:
|
||||||
// WebIDL
|
// WebIDL
|
||||||
already_AddRefed<SVGAnimatedEnumeration> ClipPathUnits();
|
already_AddRefed<SVGAnimatedEnumeration> ClipPathUnits();
|
||||||
|
|
||||||
|
// This is an internal method that does not flush style, and thus
|
||||||
|
// the answer may be out of date if there's a pending style flush.
|
||||||
|
bool IsUnitsObjectBoundingBox() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
enum { CLIPPATHUNITS };
|
enum { CLIPPATHUNITS };
|
||||||
|
|
|
@ -29,6 +29,7 @@ typedef SVGGraphicsElement SVGTextContentElementBase;
|
||||||
|
|
||||||
class SVGTextContentElement : public SVGTextContentElementBase
|
class SVGTextContentElement : public SVGTextContentElementBase
|
||||||
{
|
{
|
||||||
|
friend class ::SVGTextFrame;
|
||||||
public:
|
public:
|
||||||
using FragmentOrElement::TextLength;
|
using FragmentOrElement::TextLength;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "nsIUnicodeDecoder.h"
|
#include "nsIUnicodeDecoder.h"
|
||||||
#include "nsIUnicodeEncoder.h"
|
#include "nsIUnicodeEncoder.h"
|
||||||
#include "mozilla/dom/EncodingUtils.h"
|
#include "mozilla/dom/EncodingUtils.h"
|
||||||
|
#include "mozilla/CheckedInt.h"
|
||||||
|
|
||||||
using mozilla::dom::EncodingUtils;
|
using mozilla::dom::EncodingUtils;
|
||||||
|
|
||||||
|
@ -39,8 +40,13 @@ nsScriptableUnicodeConverter::ConvertFromUnicodeWithLength(const nsAString& aSrc
|
||||||
const nsAFlatString& flatSrc = PromiseFlatString(aSrc);
|
const nsAFlatString& flatSrc = PromiseFlatString(aSrc);
|
||||||
rv = mEncoder->GetMaxLength(flatSrc.get(), inLength, aOutLen);
|
rv = mEncoder->GetMaxLength(flatSrc.get(), inLength, aOutLen);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
*_retval = (char*)malloc(*aOutLen+1);
|
mozilla::CheckedInt<int32_t> needed(*aOutLen);
|
||||||
if (!*_retval)
|
needed += 1;
|
||||||
|
if (MOZ_UNLIKELY(!needed.isValid())) {
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
*_retval = (char*)malloc(needed.value());
|
||||||
|
if (MOZ_UNLIKELY(!*_retval))
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
rv = mEncoder->Convert(flatSrc.get(), &inLength, *_retval, aOutLen);
|
rv = mEncoder->Convert(flatSrc.get(), &inLength, *_retval, aOutLen);
|
||||||
|
@ -145,8 +151,14 @@ nsScriptableUnicodeConverter::ConvertFromByteArray(const uint8_t* aData,
|
||||||
inLength, &outLength);
|
inLength, &outLength);
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
{
|
{
|
||||||
char16_t* buf = (char16_t*)malloc((outLength+1) * sizeof(char16_t));
|
mozilla::CheckedInt<nsACString::size_type> needed(outLength);
|
||||||
if (!buf)
|
needed += 1;
|
||||||
|
needed *= sizeof(char16_t);
|
||||||
|
if (MOZ_UNLIKELY(!needed.isValid())) {
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
char16_t* buf = (char16_t*)malloc(needed.value());
|
||||||
|
if (MOZ_UNLIKELY(!buf))
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
rv = mDecoder->Convert(reinterpret_cast<const char*>(aData),
|
rv = mDecoder->Convert(reinterpret_cast<const char*>(aData),
|
||||||
|
|
|
@ -5202,8 +5202,8 @@ SVGTextFrame::DoGlyphPositioning()
|
||||||
float actualTextLength =
|
float actualTextLength =
|
||||||
static_cast<float>(presContext->AppUnitsToGfxUnits(frameLength) * factor);
|
static_cast<float>(presContext->AppUnitsToGfxUnits(frameLength) * factor);
|
||||||
|
|
||||||
RefPtr<SVGAnimatedEnumeration> lengthAdjustEnum = element->LengthAdjust();
|
uint16_t lengthAdjust =
|
||||||
uint16_t lengthAdjust = lengthAdjustEnum->AnimVal();
|
element->EnumAttributes()[SVGTextContentElement::LENGTHADJUST].GetAnimValue();
|
||||||
switch (lengthAdjust) {
|
switch (lengthAdjust) {
|
||||||
case SVG_LENGTHADJUST_SPACINGANDGLYPHS:
|
case SVG_LENGTHADJUST_SPACINGANDGLYPHS:
|
||||||
// Scale the glyphs and their positions.
|
// Scale the glyphs and their positions.
|
||||||
|
|
|
@ -1003,8 +1003,7 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
|
||||||
if (clipPathFrame && isOK) {
|
if (clipPathFrame && isOK) {
|
||||||
SVGClipPathElement *clipContent =
|
SVGClipPathElement *clipContent =
|
||||||
static_cast<SVGClipPathElement*>(clipPathFrame->GetContent());
|
static_cast<SVGClipPathElement*>(clipPathFrame->GetContent());
|
||||||
RefPtr<SVGAnimatedEnumeration> units = clipContent->ClipPathUnits();
|
if (clipContent->IsUnitsObjectBoundingBox()) {
|
||||||
if (units->AnimVal() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
|
|
||||||
matrix.Translate(gfxPoint(x, y));
|
matrix.Translate(gfxPoint(x, y));
|
||||||
matrix.Scale(width, height);
|
matrix.Scale(width, height);
|
||||||
} else if (aFrame->GetType() == nsGkAtoms::svgForeignObjectFrame) {
|
} else if (aFrame->GetType() == nsGkAtoms::svgForeignObjectFrame) {
|
||||||
|
|
Loading…
Reference in New Issue