Skip to content

Commit

Permalink
#566 and #651: update font blacklist, M1754724, M1758062, M1761026+ba…
Browse files Browse the repository at this point in the history
…ckbugs, M1755555, M1663508, M1719215
  • Loading branch information
classilla committed May 1, 2022
1 parent 0a9d355 commit 700da3e
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 38 deletions.
7 changes: 5 additions & 2 deletions dom/fetch/FetchDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,12 @@ FetchDriver::OnDataAvailable(nsIRequest* aRequest,
// NB: This can be called on any thread! But we're guaranteed that it is
// called between OnStartRequest and OnStopRequest, so we don't need to worry
// about races.
if (!mResponse) {
MOZ_ASSERT(false);
return NS_ERROR_UNEXPECTED;
}

uint32_t aRead;
MOZ_ASSERT(mResponse);
uint32_t aRead = 0;
MOZ_ASSERT(mPipeOutputStream);

nsresult rv = aInputStream->ReadSegments(NS_CopySegmentToStream,
Expand Down
30 changes: 15 additions & 15 deletions dom/xslt/xslt/txMozillaXSLTProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,18 @@ txToFragmentHandlerFactory::createHandlerWith(txOutputFormat* aFormat,
class txVariable : public txIGlobalParameter
{
public:
explicit txVariable(nsIVariant* aValue) : mValue(aValue)
explicit txVariable(nsIVariant* aValue, txAExprResult* aTxValue)
: mValue(aValue), mTxValue(aTxValue)
{
NS_ASSERTION(aValue, "missing value");
NS_ASSERTION(aValue && aTxValue, "missing value");
}
explicit txVariable(txAExprResult* aValue) : mTxValue(aValue)
{
NS_ASSERTION(aValue, "missing value");
}
nsresult getValue(txAExprResult** aValue)
{
NS_ASSERTION(mValue || mTxValue, "variablevalue is null");

if (!mTxValue) {
nsresult rv = Convert(mValue, getter_AddRefs(mTxValue));
NS_ENSURE_SUCCESS(rv, rv);
}
NS_ASSERTION(mTxValue, "variablevalue is null");

*aValue = mTxValue;
NS_ADDREF(*aValue);
Expand All @@ -269,11 +265,11 @@ class txVariable : public txIGlobalParameter
{
return mValue;
}
void setValue(nsIVariant* aValue)
void setValue(nsIVariant* aValue, txAExprResult* aTxValue)
{
NS_ASSERTION(aValue, "setting variablevalue to null");
NS_ASSERTION(aValue && aTxValue, "setting variablevalue to null");
mValue = aValue;
mTxValue = nullptr;
mTxValue = aTxValue;
}
void setValue(txAExprResult* aValue)
{
Expand All @@ -282,14 +278,14 @@ class txVariable : public txIGlobalParameter
mTxValue = aValue;
}

static nsresult Convert(nsIVariant* aValue, txAExprResult** aResult);

friend void ImplCycleCollectionUnlink(txVariable& aVariable);
friend void ImplCycleCollectionTraverse(
nsCycleCollectionTraversalCallback& aCallback, txVariable& aVariable,
const char* aName, uint32_t aFlags);

private:
static nsresult Convert(nsIVariant *aValue, txAExprResult** aResult);

nsCOMPtr<nsIVariant> mValue;
RefPtr<txAExprResult> mTxValue;
};
Expand Down Expand Up @@ -949,13 +945,17 @@ txMozillaXSLTProcessor::SetParameter(const nsAString & aNamespaceURI,
nsCOMPtr<nsIAtom> localName = do_GetAtom(aLocalName);
txExpandedName varName(nsId, localName);

RefPtr<txAExprResult> txValue;
rv = txVariable::Convert(value, getter_AddRefs(txValue));
NS_ENSURE_SUCCESS(rv, rv);

txVariable* var = static_cast<txVariable*>(mVariables.get(varName));
if (var) {
var->setValue(value);
var->setValue(value, txValue);
return NS_OK;
}

var = new txVariable(value);
var = new txVariable(value, txValue);
return mVariables.add(varName, var);
}

Expand Down
15 changes: 11 additions & 4 deletions gfx/2d/DrawTargetCairo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ cairo_surface_t* GetAsImageSurface(cairo_surface_t* aSurface)
return nullptr;
}

// We're creating a subimage from the parent image's data (in aData) without
// altering that data or its stride. This constrains the values in aRect, and
// how they're used. Callers must see to it that the parent fully contains the
// subimage. Here we ensure that no clipping is done in the X dimension at the
// beginning of any line. (To do otherwise would require creating a copy of
// aData from parts of every line in aData (from aRect.Y() to aRect.Height()),
// and setting the copy to a different stride.) A non-zero aRect.X() is used
// only to specify the subimage's location in its parent (via
// cairo_surface_set_device_offset()). This change resolves bug 1719215.
cairo_surface_t* CreateSubImageForData(unsigned char* aData,
const IntRect& aRect,
int aStride,
Expand All @@ -271,16 +280,14 @@ cairo_surface_t* CreateSubImageForData(unsigned char* aData,
gfxWarning() << "DrawTargetCairo.CreateSubImageForData null aData";
return nullptr;
}
unsigned char *data = aData +
aRect.y * aStride +
aRect.x * BytesPerPixel(aFormat);

unsigned char* data = aData + aRect.y * aStride;
cairo_surface_t *image =
cairo_image_surface_create_for_data(data,
GfxFormatToCairoFormat(aFormat),
aRect.width,
aRect.height,
aStride);
// Set the subimage's location in its parent
cairo_surface_set_device_offset(image, -aRect.x, -aRect.y);
return image;
}
Expand Down
2 changes: 2 additions & 0 deletions gfx/thebes/gfxPlatformMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ gfxPlatformMac::IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags)

HTTP_OR_HTTPS_SUBDIR("hartzfacts.de", "/google-fonts/s/notoseriftc/v7/");

HTTP_OR_HTTPS_SUBDIR("som.yale.edu","/themes/custom/som/fonts/neuehaasunica/NeueHaasUnicaBlack");

// Check hostname and subpatterns (TenFourFox issue 477).
HOST_AND_KEY("www.latimes.com", "/fonts/KisFBDisplay-");
HOST_AND_KEY("www.nerdwallet.com", "Gotham-Book--critical");
Expand Down
Loading

0 comments on commit 700da3e

Please sign in to comment.