Bug 1685078 - Support full <image> syntax in list-style-image as per spec. r=jrmuizel,TYLin

This allows supporting image-set(), etc, and simplifies the bullet frame
code significantly, too thanks to two changes:

  * Instead of manually managing the image request, use the CSS image
    loader, with the `REQUEST_REQUIRES_REFLOW` flag, to handle image
    loads correctly. This didn't exist when this code was initially
    implemented, but we can nicely use it now.

  * Instead of re-implementing another WebRender command-builder thing,
    we can just reuse the nsImageRenderer code.

Differential Revision: https://phabricator.services.mozilla.com/D100774
This commit is contained in:
Emilio Cobos Álvarez
2021-01-08 09:44:24 +00:00
parent a808ad22f5
commit c852e76f3c
19 changed files with 173 additions and 705 deletions

View File

@@ -42,7 +42,8 @@ HTMLLIAccessible::HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc)
if (nsBulletFrame* bulletFrame = if (nsBulletFrame* bulletFrame =
do_QueryFrame(nsLayoutUtils::GetMarkerFrame(aContent))) { do_QueryFrame(nsLayoutUtils::GetMarkerFrame(aContent))) {
const nsStyleList* styleList = bulletFrame->StyleList(); const nsStyleList* styleList = bulletFrame->StyleList();
if (styleList->GetListStyleImage() || !styleList->mCounterStyle.IsNone()) { if (!styleList->mListStyleImage.IsNone() ||
!styleList->mCounterStyle.IsNone()) {
mBullet = new HTMLListBulletAccessible(mContent, mDoc); mBullet = new HTMLListBulletAccessible(mContent, mDoc);
Document()->BindToDocument(mBullet, nullptr); Document()->BindToDocument(mBullet, nullptr);
AppendChild(mBullet); AppendChild(mBullet);
@@ -142,7 +143,7 @@ ENameValueFlag HTMLListBulletAccessible::Name(nsString& aName) const {
return eNameOK; return eNameOK;
} }
if (frame->StyleList()->GetListStyleImage()) { if (!frame->StyleList()->mListStyleImage.IsNone()) {
// Bullet is an image, so use default bullet character. // Bullet is an image, so use default bullet character.
const char16_t kDiscCharacter = 0x2022; const char16_t kDiscCharacter = 0x2022;
aName.Assign(kDiscCharacter); aName.Assign(kDiscCharacter);

View File

@@ -7418,8 +7418,21 @@ exports.CSS_PROPERTIES = {
"list-style-image", "list-style-image",
"list-style-type" "list-style-type"
], ],
"supports": [], "supports": [
"gradient"
],
"values": [ "values": [
"-moz-element",
"-moz-image-rect",
"-moz-linear-gradient",
"-moz-radial-gradient",
"-moz-repeating-linear-gradient",
"-moz-repeating-radial-gradient",
"-webkit-gradient",
"-webkit-linear-gradient",
"-webkit-radial-gradient",
"-webkit-repeating-linear-gradient",
"-webkit-repeating-radial-gradient",
"arabic-indic", "arabic-indic",
"armenian", "armenian",
"bengali", "bengali",
@@ -7429,6 +7442,7 @@ exports.CSS_PROPERTIES = {
"cjk-earthly-branch", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-heavenly-stem",
"cjk-ideographic", "cjk-ideographic",
"conic-gradient",
"decimal", "decimal",
"decimal-leading-zero", "decimal-leading-zero",
"devanagari", "devanagari",
@@ -7455,6 +7469,7 @@ exports.CSS_PROPERTIES = {
"korean-hanja-formal", "korean-hanja-formal",
"korean-hanja-informal", "korean-hanja-informal",
"lao", "lao",
"linear-gradient",
"lower-alpha", "lower-alpha",
"lower-armenian", "lower-armenian",
"lower-greek", "lower-greek",
@@ -7467,6 +7482,10 @@ exports.CSS_PROPERTIES = {
"oriya", "oriya",
"outside", "outside",
"persian", "persian",
"radial-gradient",
"repeating-conic-gradient",
"repeating-linear-gradient",
"repeating-radial-gradient",
"revert", "revert",
"simp-chinese-formal", "simp-chinese-formal",
"simp-chinese-informal", "simp-chinese-informal",
@@ -7491,11 +7510,30 @@ exports.CSS_PROPERTIES = {
"subproperties": [ "subproperties": [
"list-style-image" "list-style-image"
], ],
"supports": [], "supports": [
"gradient"
],
"values": [ "values": [
"-moz-element",
"-moz-image-rect",
"-moz-linear-gradient",
"-moz-radial-gradient",
"-moz-repeating-linear-gradient",
"-moz-repeating-radial-gradient",
"-webkit-gradient",
"-webkit-linear-gradient",
"-webkit-radial-gradient",
"-webkit-repeating-linear-gradient",
"-webkit-repeating-radial-gradient",
"conic-gradient",
"inherit", "inherit",
"initial", "initial",
"linear-gradient",
"none", "none",
"radial-gradient",
"repeating-conic-gradient",
"repeating-linear-gradient",
"repeating-radial-gradient",
"revert", "revert",
"unset", "unset",
"url" "url"

View File

@@ -7394,7 +7394,7 @@ bool nsBlockFrame::MarkerIsEmpty() const {
"should only care when we have an outside ::marker"); "should only care when we have an outside ::marker");
nsIFrame* marker = GetMarker(); nsIFrame* marker = GetMarker();
const nsStyleList* list = marker->StyleList(); const nsStyleList* list = marker->StyleList();
return list->mCounterStyle.IsNone() && !list->GetListStyleImage() && return list->mCounterStyle.IsNone() && list->mListStyleImage.IsNone() &&
marker->StyleContent()->ContentCount() == 0; marker->StyleContent()->ContentCount() == 0;
} }

View File

@@ -23,6 +23,7 @@
#include "mozilla/MathAlgorithms.h" #include "mozilla/MathAlgorithms.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/SVGImageContext.h" #include "mozilla/SVGImageContext.h"
#include "mozilla/css/ImageLoader.h"
#include "mozilla/dom/Document.h" #include "mozilla/dom/Document.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PathHelpers.h" #include "mozilla/gfx/PathHelpers.h"
@@ -41,6 +42,7 @@
#include "nsGenericHTMLElement.h" #include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsIURI.h" #include "nsIURI.h"
#include "nsLayoutUtils.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
@@ -51,7 +53,6 @@ using namespace mozilla;
using namespace mozilla::gfx; using namespace mozilla::gfx;
using namespace mozilla::image; using namespace mozilla::image;
using namespace mozilla::layout; using namespace mozilla::layout;
using mozilla::dom::Document;
nsIFrame* NS_NewBulletFrame(PresShell* aPresShell, ComputedStyle* aStyle) { nsIFrame* NS_NewBulletFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsBulletFrame(aStyle, aPresShell->GetPresContext()); return new (aPresShell) nsBulletFrame(aStyle, aPresShell->GetPresContext());
@@ -74,19 +75,6 @@ CounterStyle* nsBulletFrame::ResolveCounterStyle() {
StyleList()->mCounterStyle); StyleList()->mCounterStyle);
} }
void nsBulletFrame::DestroyFrom(nsIFrame* aDestructRoot,
PostDestroyData& aPostDestroyData) {
// Stop image loading first.
DeregisterAndCancelImageRequest();
if (mListener) {
mListener->SetFrame(nullptr);
}
// Let base class do the rest
nsIFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
}
#ifdef DEBUG_FRAME_DUMP #ifdef DEBUG_FRAME_DUMP
nsresult nsBulletFrame::GetFrameName(nsAString& aResult) const { nsresult nsBulletFrame::GetFrameName(nsAString& aResult) const {
return MakeFrameName(u"Bullet"_ns, aResult); return MakeFrameName(u"Bullet"_ns, aResult);
@@ -100,69 +88,36 @@ bool nsBulletFrame::IsSelfEmpty() {
} }
/* virtual */ /* virtual */
void nsBulletFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) { void nsBulletFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) {
nsIFrame::DidSetComputedStyle(aOldComputedStyle); nsIFrame::DidSetComputedStyle(aOldStyle);
imgRequestProxy* newRequest = StyleList()->GetListStyleImage(); css::ImageLoader* loader = PresContext()->Document()->StyleImageLoader();
imgIRequest* oldListImage =
if (newRequest) { aOldStyle ? aOldStyle->StyleList()->mListStyleImage.GetImageRequest()
if (!mListener) { : nullptr;
mListener = new nsBulletListener(); imgIRequest* newListImage = StyleList()->mListStyleImage.GetImageRequest();
mListener->SetFrame(this); if (oldListImage != newListImage) {
if (oldListImage && HasImageRequest()) {
loader->DisassociateRequestFromFrame(oldListImage, this);
} }
if (newListImage) {
bool needNewRequest = true; loader->AssociateRequestToFrame(
newListImage, this, css::ImageLoader::REQUEST_REQUIRES_REFLOW);
if (mImageRequest) {
// Reload the image, maybe...
nsCOMPtr<nsIURI> oldURI;
mImageRequest->GetURI(getter_AddRefs(oldURI));
nsCOMPtr<nsIURI> newURI;
newRequest->GetURI(getter_AddRefs(newURI));
if (oldURI && newURI) {
bool same;
newURI->Equals(oldURI, &same);
if (same) {
needNewRequest = false;
} }
} }
}
if (needNewRequest) {
RefPtr<imgRequestProxy> newRequestClone;
newRequest->SyncClone(mListener, PresContext()->Document(),
getter_AddRefs(newRequestClone));
// Deregister the old request. We wait until after Clone is done in case
// the old request and the new request are the same underlying image
// accessed via different URLs.
DeregisterAndCancelImageRequest();
// Register the new request.
mImageRequest = std::move(newRequestClone);
RegisterImageRequest(/* aKnownToBeAnimated = */ false);
// Image bullets can affect the layout of the page, so boost the image
// load priority.
mImageRequest->BoostPriority(imgIRequest::CATEGORY_SIZE_QUERY);
}
} else {
// No image request on the new ComputedStyle.
DeregisterAndCancelImageRequest();
}
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
// Update the list bullet accessible. If old style list isn't available then // Update the list bullet accessible. If old style list isn't available then
// no need to update the accessible tree because it's not created yet. // no need to update the accessible tree because it's not created yet.
if (aOldComputedStyle) { if (aOldStyle) {
if (nsAccessibilityService* accService = if (nsAccessibilityService* accService =
PresShell::GetAccessibilityService()) { PresShell::GetAccessibilityService()) {
const nsStyleList* oldStyleList = aOldComputedStyle->StyleList(); const nsStyleList* oldStyleList = aOldStyle->StyleList();
bool hadBullet = oldStyleList->GetListStyleImage() || bool hadBullet = !oldStyleList->mListStyleImage.IsNone() ||
!oldStyleList->mCounterStyle.IsNone(); !oldStyleList->mCounterStyle.IsNone();
const nsStyleList* newStyleList = StyleList(); const nsStyleList* newStyleList = StyleList();
bool hasBullet = newStyleList->GetListStyleImage() || bool hasBullet = !newStyleList->mListStyleImage.IsNone() ||
!newStyleList->mCounterStyle.IsNone(); !newStyleList->mCounterStyle.IsNone();
if (hadBullet != hasBullet) { if (hadBullet != hasBullet) {
@@ -195,11 +150,13 @@ class nsDisplayBulletGeometry
class BulletRenderer final { class BulletRenderer final {
public: public:
BulletRenderer(imgIContainer* image, const nsRect& dest) BulletRenderer(nsIFrame* aFrame, const StyleImage& aImage,
: mImage(image), const nsRect& aDest)
mDest(dest), : mDest(aDest),
mColor(NS_RGBA(0, 0, 0, 0)), mColor(NS_RGBA(0, 0, 0, 0)),
mListStyleType(NS_STYLE_LIST_STYLE_NONE) { mListStyleType(NS_STYLE_LIST_STYLE_NONE) {
mImageRenderer.emplace(aFrame, &aImage, 0);
mImageRenderer->SetPreferredSize({}, aDest.Size());
MOZ_ASSERT(IsImageType()); MOZ_ASSERT(IsImageType());
} }
@@ -235,8 +192,16 @@ class BulletRenderer final {
const nsRect& aDirtyRect, uint32_t aFlags, const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA, nsIFrame* aFrame); bool aDisableSubpixelAA, nsIFrame* aFrame);
bool IsImageType() const { bool IsImageType() const { return !!mImageRenderer; }
return mListStyleType == NS_STYLE_LIST_STYLE_NONE && mImage;
bool PrepareImage() {
MOZ_ASSERT(IsImageType());
return mImageRenderer->PrepareImage();
}
ImgDrawResult PrepareResult() const {
MOZ_ASSERT(IsImageType());
return mImageRenderer->PrepareResult();
} }
bool IsPathType() const { bool IsPathType() const {
@@ -260,9 +225,6 @@ class BulletRenderer final {
void PaintTextToContext(nsIFrame* aFrame, gfxContext* aCtx, void PaintTextToContext(nsIFrame* aFrame, gfxContext* aCtx,
bool aDisableSubpixelAA); bool aDisableSubpixelAA);
bool IsImageContainerAvailable(layers::LayerManager* aManager,
uint32_t aFlags);
private: private:
ImgDrawResult CreateWebRenderCommandsForImage( ImgDrawResult CreateWebRenderCommandsForImage(
nsDisplayItem* aItem, wr::DisplayListBuilder& aBuilder, nsDisplayItem* aItem, wr::DisplayListBuilder& aBuilder,
@@ -286,9 +248,9 @@ class BulletRenderer final {
nsDisplayListBuilder* aDisplayListBuilder); nsDisplayListBuilder* aDisplayListBuilder);
private: private:
// mImage and mDest are the properties for list-style-image. Maybe<nsImageRenderer> mImageRenderer;
// mImage is the image content and mDest is the image position.
RefPtr<imgIContainer> mImage; // The position and size of the image bullet.
nsRect mDest; nsRect mDest;
// Some bullet types are stored as a rect (in device pixels) instead of a Path // Some bullet types are stored as a rect (in device pixels) instead of a Path
@@ -347,11 +309,10 @@ ImgDrawResult BulletRenderer::Paint(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, uint32_t aFlags, const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA, nsIFrame* aFrame) { bool aDisableSubpixelAA, nsIFrame* aFrame) {
if (IsImageType()) { if (IsImageType()) {
SamplingFilter filter = nsLayoutUtils::GetSamplingFilterForFrame(aFrame); return mImageRenderer->DrawLayer(aFrame->PresContext(), aRenderingContext,
return nsLayoutUtils::DrawSingleImage( mDest, mDest, nsPoint(), aDirtyRect,
aRenderingContext, aFrame->PresContext(), mImage, filter, mDest, mDest.Size(),
aDirtyRect, /* aOpacity = */ 1.0f);
/* no SVGImageContext */ Nothing(), aFlags);
} }
if (IsPathType()) { if (IsPathType()) {
@@ -414,13 +375,6 @@ void BulletRenderer::PaintTextToContext(nsIFrame* aFrame, gfxContext* aCtx,
mText.Length(), mPoint); mText.Length(), mPoint);
} }
bool BulletRenderer::IsImageContainerAvailable(layers::LayerManager* aManager,
uint32_t aFlags) {
MOZ_ASSERT(IsImageType());
return mImage->IsImageContainerAvailable(aManager, aFlags);
}
ImgDrawResult BulletRenderer::CreateWebRenderCommandsForImage( ImgDrawResult BulletRenderer::CreateWebRenderCommandsForImage(
nsDisplayItem* aItem, wr::DisplayListBuilder& aBuilder, nsDisplayItem* aItem, wr::DisplayListBuilder& aBuilder,
wr::IpcResourceUpdateQueue& aResources, wr::IpcResourceUpdateQueue& aResources,
@@ -428,43 +382,10 @@ ImgDrawResult BulletRenderer::CreateWebRenderCommandsForImage(
mozilla::layers::RenderRootStateManager* aManager, mozilla::layers::RenderRootStateManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) { nsDisplayListBuilder* aDisplayListBuilder) {
MOZ_RELEASE_ASSERT(IsImageType()); MOZ_RELEASE_ASSERT(IsImageType());
MOZ_RELEASE_ASSERT(mImage); return mImageRenderer->BuildWebRenderDisplayItemsForLayer(
aItem->Frame()->PresContext(), aBuilder, aResources, aSc, aManager, aItem,
uint32_t flags = aDisplayListBuilder->GetImageDecodeFlags(); mDest, mDest, nsPoint(), mDest, mDest.Size(),
/* aOpacity = */ 1.0f);
const int32_t appUnitsPerDevPixel =
aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect destRect =
LayoutDeviceRect::FromAppUnits(mDest, appUnitsPerDevPixel);
Maybe<SVGImageContext> svgContext;
gfx::IntSize decodeSize =
nsLayoutUtils::ComputeImageContainerDrawingParameters(
mImage, aItem->Frame(), destRect, aSc, flags, svgContext);
RefPtr<layers::ImageContainer> container;
ImgDrawResult drawResult = mImage->GetImageContainerAtSize(
aManager->LayerManager(), decodeSize, svgContext, flags,
getter_AddRefs(container));
if (!container) {
return drawResult;
}
mozilla::wr::ImageRendering rendering = wr::ToImageRendering(
nsLayoutUtils::GetSamplingFilterForFrame(aItem->Frame()));
gfx::IntSize size;
Maybe<wr::ImageKey> key = aManager->CommandBuilder().CreateImageKey(
aItem, container, aBuilder, aResources, rendering, aSc, size, Nothing());
if (key.isNothing()) {
return drawResult;
}
wr::LayoutRect dest = wr::ToLayoutRect(destRect);
aBuilder.PushImage(dest, dest, !aItem->BackfaceIsHidden(), rendering,
key.value());
return drawResult;
} }
bool BulletRenderer::CreateWebRenderCommandsForPath( bool BulletRenderer::CreateWebRenderCommandsForPath(
@@ -608,18 +529,20 @@ bool nsDisplayBullet::CreateWebRenderCommands(
// (non-trivial refactor of all this code) // (non-trivial refactor of all this code)
RefPtr<gfxContext> screenRefCtx = gfxContext::CreateOrNull( RefPtr<gfxContext> screenRefCtx = gfxContext::CreateOrNull(
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget().get()); gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget().get());
ImgDrawResult drawResult;
Maybe<BulletRenderer> br = Maybe<BulletRenderer> br =
static_cast<nsBulletFrame*>(mFrame)->CreateBulletRenderer( static_cast<nsBulletFrame*>(mFrame)->CreateBulletRenderer(
*screenRefCtx, ToReferenceFrame()); *screenRefCtx, ToReferenceFrame(), &drawResult);
if (!br) { if (br) {
ImgDrawResult commandBuilderResult = br->CreateWebRenderCommands(
this, aBuilder, aResources, aSc, aManager, aDisplayListBuilder);
if (commandBuilderResult == ImgDrawResult::NOT_SUPPORTED) {
return false; return false;
} }
ImgDrawResult drawResult = br->CreateWebRenderCommands( drawResult &= commandBuilderResult;
this, aBuilder, aResources, aSc, aManager, aDisplayListBuilder);
if (drawResult == ImgDrawResult::NOT_SUPPORTED) {
return false;
} }
nsDisplayBulletGeometry::UpdateDrawResult(this, drawResult); nsDisplayBulletGeometry::UpdateDrawResult(this, drawResult);
@@ -648,37 +571,26 @@ void nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} }
Maybe<BulletRenderer> nsBulletFrame::CreateBulletRenderer( Maybe<BulletRenderer> nsBulletFrame::CreateBulletRenderer(
gfxContext& aRenderingContext, nsPoint aPt) { gfxContext& aRenderingContext, nsPoint aPt, ImgDrawResult* aDrawResult) {
const nsStyleList* myList = StyleList(); *aDrawResult = ImgDrawResult::SUCCESS;
CounterStyle* listStyleType = ResolveCounterStyle(); CounterStyle* listStyleType = ResolveCounterStyle();
nsMargin padding = mPadding.GetPhysicalMargin(GetWritingMode()); nsMargin padding = mPadding.GetPhysicalMargin(GetWritingMode());
if (!StyleList()->mListStyleImage.IsNone()) {
if (myList->GetListStyleImage() && mImageRequest) {
uint32_t status;
mImageRequest->GetImageStatus(&status);
if (!(status & imgIRequest::STATUS_ERROR)) {
if (status & imgIRequest::STATUS_LOAD_COMPLETE) {
nsCOMPtr<imgIContainer> imageCon;
mImageRequest->GetImage(getter_AddRefs(imageCon));
if (imageCon) {
imageCon = nsLayoutUtils::OrientImage(
imageCon, StyleVisibility()->mImageOrientation);
nsRect dest(padding.left, padding.top, nsRect dest(padding.left, padding.top,
mRect.width - (padding.left + padding.right), mRect.width - (padding.left + padding.right),
mRect.height - (padding.top + padding.bottom)); mRect.height - (padding.top + padding.bottom));
BulletRenderer br(imageCon, dest + aPt); BulletRenderer br(this, StyleList()->mListStyleImage, dest + aPt);
if (br.PrepareImage()) {
return Some(br); return Some(br);
} }
} else { *aDrawResult = br.PrepareResult();
// Boost the load priority further now that we know we want to display if (auto* request = StyleList()->mListStyleImage.GetImageRequest()) {
// the bullet image. request->BoostPriority(imgIRequest::CATEGORY_DISPLAY);
mImageRequest->BoostPriority(imgIRequest::CATEGORY_DISPLAY);
}
} }
} }
nscolor color = nsLayoutUtils::GetColor(this, &nsStyleText::mColor); nscolor color = nsLayoutUtils::GetColor(this, &nsStyleText::mColor);
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget(); DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel(); int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel();
@@ -802,13 +714,15 @@ ImgDrawResult nsBulletFrame::PaintBullet(gfxContext& aRenderingContext,
nsPoint aPt, const nsRect& aDirtyRect, nsPoint aPt, const nsRect& aDirtyRect,
uint32_t aFlags, uint32_t aFlags,
bool aDisableSubpixelAA) { bool aDisableSubpixelAA) {
Maybe<BulletRenderer> br = CreateBulletRenderer(aRenderingContext, aPt); ImgDrawResult drawResult;
Maybe<BulletRenderer> br =
CreateBulletRenderer(aRenderingContext, aPt, &drawResult);
if (!br) { if (!br) {
return ImgDrawResult::SUCCESS; return drawResult;
} }
return br->Paint(aRenderingContext, aPt, aDirtyRect, aFlags, return drawResult & br->Paint(aRenderingContext, aPt, aDirtyRect, aFlags,
aDisableSubpixelAA, this); aDisableSubpixelAA, this);
} }
@@ -861,39 +775,29 @@ void nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
aPadding->SizeTo(wm, 0, 0, 0, 0); aPadding->SizeTo(wm, 0, 0, 0, 0);
LogicalSize finalSize(wm); LogicalSize finalSize(wm);
const nsStyleList* myList = StyleList();
nscoord ascent; nscoord ascent;
RefPtr<nsFontMetrics> fm = RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetFontMetricsForFrame(this, aFontSizeInflation); nsLayoutUtils::GetFontMetricsForFrame(this, aFontSizeInflation);
RemoveStateBits(BULLET_FRAME_IMAGE_LOADING); RemoveStateBits(BULLET_FRAME_IMAGE_LOADING);
if (myList->GetListStyleImage() && mImageRequest) { if (RefPtr<imgIContainer> image = GetImage()) {
uint32_t status; int32_t w = 0;
mImageRequest->GetImageStatus(&status); int32_t h = 0;
if (status & imgIRequest::STATUS_SIZE_AVAILABLE && image->GetWidth(&w);
!(status & imgIRequest::STATUS_ERROR)) { image->GetHeight(&h);
LogicalSize size(GetWritingMode(), CSSPixel::ToAppUnits(CSSIntSize(w, h)));
// auto size the image // auto size the image
finalSize.ISize(wm) = mIntrinsicSize.ISize(wm); finalSize.ISize(wm) = size.ISize(wm);
aMetrics.SetBlockStartAscent(finalSize.BSize(wm) = finalSize.BSize(wm) = size.BSize(wm);
mIntrinsicSize.BSize(wm)); aMetrics.SetBlockStartAscent(size.BSize(wm));
aMetrics.SetSize(wm, finalSize); aMetrics.SetSize(wm, finalSize);
AppendSpacingToPadding(fm, aPadding); AppendSpacingToPadding(fm, aPadding);
AddStateBits(BULLET_FRAME_IMAGE_LOADING); AddStateBits(BULLET_FRAME_IMAGE_LOADING);
return; return;
} }
}
// If we're getting our desired size and don't have an image, reset
// mIntrinsicSize to (0,0). Otherwise, if we used to have an image, it
// changed, and the new one is coming in, but we're reflowing before it's
// fully there, we'll end up with mIntrinsicSize not matching our size, but
// won't trigger a reflow in OnStartContainer (because mIntrinsicSize will
// match the image size).
mIntrinsicSize.SizeTo(wm, 0, 0);
nscoord bulletSize; nscoord bulletSize;
@@ -904,7 +808,6 @@ void nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
finalSize.ISize(wm) = finalSize.BSize(wm) = 0; finalSize.ISize(wm) = finalSize.BSize(wm) = 0;
aMetrics.SetBlockStartAscent(0); aMetrics.SetBlockStartAscent(0);
break; break;
case NS_STYLE_LIST_STYLE_DISC: case NS_STYLE_LIST_STYLE_DISC:
case NS_STYLE_LIST_STYLE_CIRCLE: case NS_STYLE_LIST_STYLE_CIRCLE:
case NS_STYLE_LIST_STYLE_SQUARE: { case NS_STYLE_LIST_STYLE_SQUARE: {
@@ -1014,7 +917,8 @@ static inline bool IsIgnoreable(const nsIFrame* aFrame, nscoord aISize) {
return false; return false;
} }
auto listStyle = aFrame->StyleList(); auto listStyle = aFrame->StyleList();
return listStyle->mCounterStyle.IsNone() && !listStyle->GetListStyleImage(); return listStyle->mCounterStyle.IsNone() &&
listStyle->mListStyleImage.IsNone();
} }
/* virtual */ /* virtual */
@@ -1037,126 +941,6 @@ void nsBulletFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
} }
} }
void nsBulletFrame::Notify(imgIRequest* aRequest, int32_t aType,
const nsIntRect* aData) {
if (aType == imgINotificationObserver::SIZE_AVAILABLE) {
nsCOMPtr<imgIContainer> image;
aRequest->GetImage(getter_AddRefs(image));
return OnSizeAvailable(aRequest, image);
}
if (aType == imgINotificationObserver::FRAME_UPDATE) {
// The image has changed.
// Invalidate the entire content area. Maybe it's not optimal but it's
// simple and always correct, and I'll be a stunned mullet if it ever
// matters for performance
InvalidateFrame();
}
if (aType == imgINotificationObserver::IS_ANIMATED) {
// Register the image request with the refresh driver now that we know it's
// animated.
if (aRequest == mImageRequest) {
RegisterImageRequest(/* aKnownToBeAnimated = */ true);
}
}
if (aType == imgINotificationObserver::LOAD_COMPLETE) {
// Unconditionally start decoding for now.
// XXX(seth): We eventually want to decide whether to do this based on
// visibility. We should get that for free from bug 1091236.
nsCOMPtr<imgIContainer> container;
aRequest->GetImage(getter_AddRefs(container));
if (container) {
// Retrieve the intrinsic size of the image.
int32_t width = 0;
int32_t height = 0;
container->GetWidth(&width);
container->GetHeight(&height);
// Request a decode at that size.
container->RequestDecodeForSize(
IntSize(width, height), imgIContainer::DECODE_FLAGS_DEFAULT |
imgIContainer::FLAG_HIGH_QUALITY_SCALING);
}
InvalidateFrame();
}
if (aType == imgINotificationObserver::DECODE_COMPLETE) {
if (Document* parent = GetOurCurrentDoc()) {
nsCOMPtr<imgIContainer> container;
aRequest->GetImage(getter_AddRefs(container));
if (container) {
container->PropagateUseCounters(parent);
}
}
}
}
Document* nsBulletFrame::GetOurCurrentDoc() const {
nsIContent* parentContent = GetParent()->GetContent();
return parentContent ? parentContent->GetComposedDoc() : nullptr;
}
void nsBulletFrame::OnSizeAvailable(imgIRequest* aRequest,
imgIContainer* aImage) {
if (!aImage) return;
if (!aRequest) return;
uint32_t status;
aRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_ERROR) {
return;
}
nscoord w, h;
aImage->GetWidth(&w);
aImage->GetHeight(&h);
nsPresContext* presContext = PresContext();
LogicalSize newsize(GetWritingMode(),
nsSize(nsPresContext::CSSPixelsToAppUnits(w),
nsPresContext::CSSPixelsToAppUnits(h)));
if (mIntrinsicSize != newsize) {
mIntrinsicSize = newsize;
// Now that the size is available (or an error occurred), trigger
// a reflow of the bullet frame.
mozilla::PresShell* presShell = presContext->GetPresShell();
if (presShell) {
presShell->FrameNeedsReflow(this, IntrinsicDirty::StyleChange,
NS_FRAME_IS_DIRTY);
}
}
// Handle animations
aImage->SetAnimationMode(presContext->ImageAnimationMode());
// Ensure the animation (if any) is started. Note: There is no
// corresponding call to Decrement for this. This Increment will be
// 'cleaned up' by the Request when it is destroyed, but only then.
aRequest->IncrementAnimationConsumers();
}
void nsBulletFrame::GetLoadGroup(nsPresContext* aPresContext,
nsILoadGroup** aLoadGroup) {
if (!aPresContext) return;
MOZ_ASSERT(nullptr != aLoadGroup, "null OUT parameter pointer");
mozilla::PresShell* presShell = aPresContext->GetPresShell();
if (!presShell) {
return;
}
Document* doc = presShell->GetDocument();
if (!doc) return;
*aLoadGroup = doc->GetDocumentLoadGroup().take();
}
float nsBulletFrame::GetFontSizeInflation() const { float nsBulletFrame::GetFontSizeInflation() const {
if (!HasFontSizeInflation()) { if (!HasFontSizeInflation()) {
return 1.0f; return 1.0f;
@@ -1178,12 +962,11 @@ void nsBulletFrame::SetFontSizeInflation(float aInflation) {
} }
already_AddRefed<imgIContainer> nsBulletFrame::GetImage() const { already_AddRefed<imgIContainer> nsBulletFrame::GetImage() const {
if (mImageRequest && StyleList()->GetListStyleImage()) { if (auto* request = StyleList()->mListStyleImage.GetImageRequest()) {
nsCOMPtr<imgIContainer> imageCon; nsCOMPtr<imgIContainer> imageCon;
mImageRequest->GetImage(getter_AddRefs(imageCon)); request->GetImage(getter_AddRefs(imageCon));
return imageCon.forget(); return imageCon.forget();
} }
return nullptr; return nullptr;
} }
@@ -1264,42 +1047,6 @@ void nsBulletFrame::GetSpokenText(nsAString& aText) {
} }
#endif #endif
void nsBulletFrame::RegisterImageRequest(bool aKnownToBeAnimated) {
if (mImageRequest) {
// mRequestRegistered is a bitfield; unpack it temporarily so we can take
// the address.
bool isRequestRegistered = mRequestRegistered;
if (aKnownToBeAnimated) {
nsLayoutUtils::RegisterImageRequest(PresContext(), mImageRequest,
&isRequestRegistered);
} else {
nsLayoutUtils::RegisterImageRequestIfAnimated(
PresContext(), mImageRequest, &isRequestRegistered);
}
mRequestRegistered = isRequestRegistered;
}
}
void nsBulletFrame::DeregisterAndCancelImageRequest() {
if (mImageRequest) {
// mRequestRegistered is a bitfield; unpack it temporarily so we can take
// the address.
bool isRequestRegistered = mRequestRegistered;
// Deregister our image request from the refresh driver.
nsLayoutUtils::DeregisterImageRequest(PresContext(), mImageRequest,
&isRequestRegistered);
mRequestRegistered = isRequestRegistered;
// Cancel the image request and forget about it.
mImageRequest->CancelAndForgetObserver(NS_ERROR_FAILURE);
mImageRequest = nullptr;
}
}
void nsBulletFrame::SetOrdinal(int32_t aOrdinal, bool aNotify) { void nsBulletFrame::SetOrdinal(int32_t aOrdinal, bool aNotify) {
if (mOrdinal == aOrdinal) { if (mOrdinal == aOrdinal) {
return; return;
@@ -1310,17 +1057,3 @@ void nsBulletFrame::SetOrdinal(int32_t aOrdinal, bool aNotify) {
NS_FRAME_IS_DIRTY); NS_FRAME_IS_DIRTY);
} }
} }
NS_IMPL_ISUPPORTS(nsBulletListener, imgINotificationObserver)
nsBulletListener::nsBulletListener() : mFrame(nullptr) {}
nsBulletListener::~nsBulletListener() = default;
void nsBulletListener::Notify(imgIRequest* aRequest, int32_t aType,
const nsIntRect* aData) {
if (!mFrame) {
return;
}
return mFrame->Notify(aRequest, aType, aData);
}

View File

@@ -12,32 +12,11 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "imgIContainer.h"
#include "imgINotificationObserver.h"
class imgIContainer; class imgIContainer;
class imgRequestProxy;
class nsBulletFrame; class nsBulletFrame;
class BulletRenderer; class BulletRenderer;
class nsFontMetrics; class nsFontMetrics;
class nsBulletListener final : public imgINotificationObserver {
public:
nsBulletListener();
NS_DECL_ISUPPORTS
NS_DECL_IMGINOTIFICATIONOBSERVER
void SetFrame(nsBulletFrame* frame) { mFrame = frame; }
private:
virtual ~nsBulletListener();
nsBulletFrame* mFrame;
};
/** /**
* A simple class that manages the layout and rendering of html bullets. * A simple class that manages the layout and rendering of html bullets.
* This class also supports the CSS list-style properties. * This class also supports the CSS list-style properties.
@@ -52,36 +31,26 @@ class nsBulletFrame final : public nsIFrame {
#endif #endif
explicit nsBulletFrame(ComputedStyle* aStyle, nsPresContext* aPresContext) explicit nsBulletFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsIFrame(aStyle, aPresContext, kClassID), : nsIFrame(aStyle, aPresContext, kClassID), mPadding(GetWritingMode()) {}
mPadding(GetWritingMode()),
mIntrinsicSize(GetWritingMode()),
mRequestRegistered(false) {}
virtual ~nsBulletFrame(); virtual ~nsBulletFrame();
void Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aData);
// nsIFrame // nsIFrame
virtual void DestroyFrom(nsIFrame* aDestructRoot, void BuildDisplayList(nsDisplayListBuilder*,
PostDestroyData& aPostDestroyData) override; const nsDisplayListSet&) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, void DidSetComputedStyle(ComputedStyle* aOldStyle) override;
const nsDisplayListSet& aLists) override;
virtual void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
#ifdef DEBUG_FRAME_DUMP #ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override; nsresult GetFrameName(nsAString& aResult) const override;
#endif #endif
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics, void Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
const ReflowInput& aReflowInput, const ReflowInput&, nsReflowStatus&) override;
nsReflowStatus& aStatus) override; nscoord GetMinISize(gfxContext*) override;
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override; nscoord GetPrefISize(gfxContext*) override;
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override; void AddInlineMinISize(gfxContext*, nsIFrame::InlineMinISizeData*) override;
void AddInlineMinISize(gfxContext* aRenderingContext, void AddInlinePrefISize(gfxContext*, nsIFrame::InlinePrefISizeData*) override;
nsIFrame::InlineMinISizeData* aData) override;
void AddInlinePrefISize(gfxContext* aRenderingContext,
nsIFrame::InlinePrefISizeData* aData) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override { bool IsFrameOfType(uint32_t aFlags) const override {
if (aFlags & (eSupportsCSSTransforms | eSupportsContainLayoutAndPaint)) { if (aFlags & (eSupportsCSSTransforms | eSupportsContainLayoutAndPaint)) {
return false; return false;
} }
@@ -99,20 +68,20 @@ class nsBulletFrame final : public nsIFrame {
#endif #endif
Maybe<BulletRenderer> CreateBulletRenderer(gfxContext& aRenderingContext, Maybe<BulletRenderer> CreateBulletRenderer(gfxContext& aRenderingContext,
nsPoint aPt); nsPoint aPt,
ImgDrawResult* aOutDrawResult);
ImgDrawResult PaintBullet(gfxContext& aRenderingContext, nsPoint aPt, ImgDrawResult PaintBullet(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, uint32_t aFlags, const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA); bool aDisableSubpixelAA);
virtual bool IsEmpty() override; bool IsEmpty() override;
virtual bool IsSelfEmpty() override; bool IsSelfEmpty() override;
// XXXmats note that this method returns a non-standard baseline that includes // XXXmats note that this method returns a non-standard baseline that includes
// the ::marker block-start margin. New code should probably use // the ::marker block-start margin. New code should probably use
// GetNaturalBaselineBOffset instead, which returns a normal baseline offset // GetNaturalBaselineBOffset instead, which returns a normal baseline offset
// as documented in nsIFrame.h. // as documented in nsIFrame.h.
virtual nscoord GetLogicalBaseline( nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
mozilla::WritingMode aWritingMode) const override;
bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM, bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
BaselineSharingGroup aBaselineGroup, BaselineSharingGroup aBaselineGroup,
@@ -130,8 +99,6 @@ class nsBulletFrame final : public nsIFrame {
already_AddRefed<imgIContainer> GetImage() const; already_AddRefed<imgIContainer> GetImage() const;
protected: protected:
void OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage);
void AppendSpacingToPadding(nsFontMetrics* aFontMetrics, void AppendSpacingToPadding(nsFontMetrics* aFontMetrics,
mozilla::LogicalMargin* aPadding); mozilla::LogicalMargin* aPadding);
void GetDesiredSize(nsPresContext* aPresContext, void GetDesiredSize(nsPresContext* aPresContext,
@@ -139,27 +106,14 @@ class nsBulletFrame final : public nsIFrame {
float aFontSizeInflation, float aFontSizeInflation,
mozilla::LogicalMargin* aPadding); mozilla::LogicalMargin* aPadding);
void GetLoadGroup(nsPresContext* aPresContext, nsILoadGroup** aLoadGroup);
mozilla::dom::Document* GetOurCurrentDoc() const;
mozilla::LogicalMargin mPadding; mozilla::LogicalMargin mPadding;
RefPtr<imgRequestProxy> mImageRequest;
RefPtr<nsBulletListener> mListener;
mozilla::LogicalSize mIntrinsicSize;
private: private:
mozilla::CounterStyle* ResolveCounterStyle(); mozilla::CounterStyle* ResolveCounterStyle();
nscoord GetListStyleAscent() const; nscoord GetListStyleAscent() const;
void RegisterImageRequest(bool aKnownToBeAnimated);
void DeregisterAndCancelImageRequest();
// Requires being set via SetOrdinal. // Requires being set via SetOrdinal.
int32_t mOrdinal = 0; int32_t mOrdinal = 0;
// This is a boolean flag indicating whether or not the current image request
// has been registered with the refresh driver.
bool mRequestRegistered : 1;
}; };
#endif /* nsBulletFrame_h___ */ #endif /* nsBulletFrame_h___ */

View File

@@ -603,7 +603,7 @@ nsChangeHint nsStyleOutline::CalcDifference(
nsStyleList::nsStyleList(const Document& aDocument) nsStyleList::nsStyleList(const Document& aDocument)
: mListStylePosition(NS_STYLE_LIST_STYLE_POSITION_OUTSIDE), : mListStylePosition(NS_STYLE_LIST_STYLE_POSITION_OUTSIDE),
mQuotes(StyleQuotes::Auto()), mQuotes(StyleQuotes::Auto()),
mListStyleImage(StyleImageUrlOrNone::None()), mListStyleImage(StyleImage::None()),
mImageRegion(StyleClipRectOrAuto::Auto()), mImageRegion(StyleClipRectOrAuto::Auto()),
mMozListReversed(StyleMozListReversed::False) { mMozListReversed(StyleMozListReversed::False) {
MOZ_COUNT_CTOR(nsStyleList); MOZ_COUNT_CTOR(nsStyleList);
@@ -627,14 +627,8 @@ nsStyleList::nsStyleList(const nsStyleList& aSource)
void nsStyleList::TriggerImageLoads(Document& aDocument, void nsStyleList::TriggerImageLoads(Document& aDocument,
const nsStyleList* aOldStyle) { const nsStyleList* aOldStyle) {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
mListStyleImage.ResolveImage(
if (mListStyleImage.IsUrl() && !mListStyleImage.AsUrl().IsImageResolved()) { aDocument, aOldStyle ? &aOldStyle->mListStyleImage : nullptr);
auto* oldUrl = aOldStyle && aOldStyle->mListStyleImage.IsUrl()
? &aOldStyle->mListStyleImage.AsUrl()
: nullptr;
const_cast<StyleComputedImageUrl&>(mListStyleImage.AsUrl())
.ResolveImage(aDocument, oldUrl);
}
} }
nsChangeHint nsStyleList::CalcDifference( nsChangeHint nsStyleList::CalcDifference(

View File

@@ -672,11 +672,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleList {
nsChangeHint CalcDifference(const nsStyleList& aNewData, nsChangeHint CalcDifference(const nsStyleList& aNewData,
const nsStyleDisplay& aOldDisplay) const; const nsStyleDisplay& aOldDisplay) const;
imgRequestProxy* GetListStyleImage() const {
return mListStyleImage.IsUrl() ? mListStyleImage.AsUrl().GetImage()
: nullptr;
}
nsRect GetImageRegion() const { nsRect GetImageRegion() const {
if (!mImageRegion.IsRect()) { if (!mImageRegion.IsRect()) {
return nsRect(); return nsRect();
@@ -690,7 +685,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleList {
mozilla::CounterStylePtr mCounterStyle; mozilla::CounterStylePtr mCounterStyle;
mozilla::StyleQuotes mQuotes; mozilla::StyleQuotes mQuotes;
mozilla::StyleImageUrlOrNone mListStyleImage; mozilla::StyleImage mListStyleImage;
// the rect to use within an image. // the rect to use within an image.
mozilla::StyleClipRectOrAuto mImageRegion; mozilla::StyleClipRectOrAuto mImageRegion;

View File

@@ -6413,8 +6413,11 @@ var gCSSProperties = {
"url('data:text/plain,\\\"')", "url('data:text/plain,\\\"')",
'url("data:text/plain,\\\'")', 'url("data:text/plain,\\\'")',
"url(data:text/plain,\\\\)", "url(data:text/plain,\\\\)",
], ].concat(validNonUrlImageValues),
invalid_values: [], invalid_values: ["url('border.png') url('border.png')"].concat(
invalidNonUrlImageValues
),
unbalanced_values: [].concat(unbalancedGradientAndElementValues),
}, },
"list-style-position": { "list-style-position": {
domProp: "listStylePosition", domProp: "listStylePosition",

View File

@@ -612,8 +612,7 @@ imgRequestProxy* nsImageBoxFrame::GetRequestFromStyle() {
return nullptr; return nullptr;
} }
} }
return StyleList()->mListStyleImage.GetImageRequest();
return StyleList()->GetListStyleImage();
} }
/* virtual */ /* virtual */

View File

@@ -1862,7 +1862,8 @@ nsresult nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol,
} else { } else {
// Obtain the URL from the ComputedStyle. // Obtain the URL from the ComputedStyle.
aAllowImageRegions = true; aAllowImageRegions = true;
styleRequest = aComputedStyle->StyleList()->GetListStyleImage(); styleRequest =
aComputedStyle->StyleList()->mListStyleImage.GetImageRequest();
if (!styleRequest) return NS_OK; if (!styleRequest) return NS_OK;
nsCOMPtr<nsIURI> uri; nsCOMPtr<nsIURI> uri;
styleRequest->GetURI(getter_AddRefs(uri)); styleRequest->GetURI(getter_AddRefs(uri));

View File

@@ -52,10 +52,10 @@ ${helpers.single_keyword(
${helpers.predefined_type( ${helpers.predefined_type(
"list-style-image", "list-style-image",
"url::ImageUrlOrNone", "Image",
engines="gecko servo-2013", engines="gecko servo-2013",
initial_value="computed::url::ImageUrlOrNone::none()", initial_value="computed::Image::None",
initial_specified_value="specified::url::ImageUrlOrNone::none()", initial_specified_value="specified::Image::None",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image", spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",

View File

@@ -10,7 +10,7 @@
derive_serialize="True" derive_serialize="True"
spec="https://drafts.csswg.org/css-lists/#propdef-list-style"> spec="https://drafts.csswg.org/css-lists/#propdef-list-style">
use crate::properties::longhands::{list_style_image, list_style_position, list_style_type}; use crate::properties::longhands::{list_style_image, list_style_position, list_style_type};
use crate::values::specified::url::ImageUrlOrNone; use crate::values::specified::Image;
pub fn parse_value<'i, 't>( pub fn parse_value<'i, 't>(
context: &ParserContext, context: &ParserContext,
@@ -69,7 +69,7 @@
(true, 2, None, None) => { (true, 2, None, None) => {
Ok(expanded! { Ok(expanded! {
list_style_position: position, list_style_position: position,
list_style_image: ImageUrlOrNone::none(), list_style_image: Image::None,
list_style_type: ListStyleType::None, list_style_type: ListStyleType::None,
}) })
} }
@@ -83,14 +83,14 @@
(true, 1, Some(list_style_type), None) => { (true, 1, Some(list_style_type), None) => {
Ok(expanded! { Ok(expanded! {
list_style_position: position, list_style_position: position,
list_style_image: ImageUrlOrNone::none(), list_style_image: Image::None,
list_style_type: list_style_type, list_style_type: list_style_type,
}) })
} }
(true, 1, None, None) => { (true, 1, None, None) => {
Ok(expanded! { Ok(expanded! {
list_style_position: position, list_style_position: position,
list_style_image: ImageUrlOrNone::none(), list_style_image: Image::None,
list_style_type: ListStyleType::None, list_style_type: ListStyleType::None,
}) })
} }

View File

@@ -13,6 +13,3 @@ pub use crate::servo::url::{ComputedImageUrl, ComputedUrl};
/// Computed <url> | <none> /// Computed <url> | <none>
pub type UrlOrNone = GenericUrlOrNone<ComputedUrl>; pub type UrlOrNone = GenericUrlOrNone<ComputedUrl>;
/// Computed image <url> | <none>
pub type ImageUrlOrNone = GenericUrlOrNone<ComputedImageUrl>;

View File

@@ -13,6 +13,3 @@ pub use crate::servo::url::{SpecifiedImageUrl, SpecifiedUrl};
/// Specified <url> | <none> /// Specified <url> | <none>
pub type UrlOrNone = GenericUrlOrNone<SpecifiedUrl>; pub type UrlOrNone = GenericUrlOrNone<SpecifiedUrl>;
/// Specified image <url> | <none>
pub type ImageUrlOrNone = GenericUrlOrNone<SpecifiedImageUrl>;

View File

@@ -177,7 +177,6 @@ include = [
"ComputedUrl", "ComputedUrl",
"ComputedImageUrl", "ComputedImageUrl",
"UrlOrNone", "UrlOrNone",
"ImageUrlOrNone",
"Filter", "Filter",
"Gradient", "Gradient",
"GridTemplateAreas", "GridTemplateAreas",

View File

@@ -459,34 +459,6 @@ mod shorthand_serialization {
} }
} }
mod list_style {
use style::properties::longhands::list_style_position::SpecifiedValue as ListStylePosition;
use style::properties::longhands::list_style_type::SpecifiedValue as ListStyleType;
use style::values::generics::url::UrlOrNone as ImageUrlOrNone;
use super::*;
#[test]
fn list_style_should_show_all_properties_when_values_are_set() {
let mut properties = Vec::new();
let position = ListStylePosition::Inside;
let image = ImageUrlOrNone::Url(SpecifiedUrl::new_for_testing("http://servo/test.png"));
let style_type = ListStyleType::Disc;
properties.push(PropertyDeclaration::ListStylePosition(position));
#[cfg(feature = "gecko")]
properties.push(PropertyDeclaration::ListStyleImage(Box::new(image)));
#[cfg(not(feature = "gecko"))]
properties.push(PropertyDeclaration::ListStyleImage(image));
properties.push(PropertyDeclaration::ListStyleType(style_type));
let serialization = shorthand_properties_to_string(properties);
assert_eq!(serialization, "list-style: inside url(\"http://servo/test.png\") disc;");
}
}
mod background { mod background {
use super::*; use super::*;

View File

@@ -2,16 +2,6 @@
[CSS Transitions: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/blue-20.png)\]] [CSS Transitions: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
[CSS Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [url(../resources/green-20.png)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Web Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (-0.3) should be [url(../resources/green-20.png)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
@@ -21,90 +11,29 @@
[CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/blue-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
[CSS Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [none\]] [CSS Transitions: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [none\]]
expected: FAIL expected: FAIL
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/green-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Web Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [url(../resources/green-20.png)\]] [CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Web Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [linear-gradient(-45deg, red, yellow)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [none\] to [url(../resources/stripes-20.png)\] at (0.3) should be [none\]] [CSS Transitions with transition: all: property <list-style-image> from [none\] to [url(../resources/stripes-20.png)\] at (0.3) should be [none\]]
expected: FAIL expected: FAIL
[Web Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (0) should be [none\]] [CSS Transitions with transition: all: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (0) should be [none\]]
expected: FAIL expected: FAIL
[CSS Transitions: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (0.3) should be [none\]] [CSS Transitions: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (0.3) should be [none\]]
expected: FAIL expected: FAIL
[Web Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [linear-gradient(-45deg, red, yellow)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [linear-gradient(-45deg, red, yellow)\]] [CSS Transitions: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [linear-gradient(-45deg, red, yellow)\]]
expected: FAIL expected: FAIL
@@ -117,42 +46,12 @@
[CSS Transitions: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [linear-gradient(-45deg, red, yellow)\]] [CSS Transitions: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [linear-gradient(-45deg, red, yellow)\]]
expected: FAIL expected: FAIL
[Web Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [linear-gradient(-45deg, red, yellow)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Transitions with transition: all: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (-0.3) should be [url(../resources/green-20.png)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Web Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (-0.3) should be [linear-gradient(-45deg, red, yellow)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (-0.3) should be [linear-gradient(-45deg, red, yellow)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/blue-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
@@ -168,29 +67,8 @@
[CSS Transitions with transition: all: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (0.3) should be [none\]] [CSS Transitions with transition: all: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (0.3) should be [none\]]
expected: FAIL expected: FAIL
[CSS Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/blue-20.png)\]] [CSS Transitions: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
[CSS Transitions: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Web Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/blue-20.png)\]] [CSS Transitions: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
@@ -212,22 +90,12 @@
[CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[Web Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0) should be [url(../resources/green-20.png)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/blue-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [inherit\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/green-20.png)\]] [CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[Web Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/blue-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
@@ -240,24 +108,8 @@
[CSS Transitions: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/green-20.png)\]] [CSS Transitions: property <list-style-image> from neutral to [url(../resources/stripes-20.png)\] at (0) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[Web Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [none\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [none\]] [CSS Transitions: property <list-style-image> from [none\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [none\]]
expected: FAIL expected: FAIL
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
@@ -270,29 +122,9 @@
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Transitions with transition: all: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [url(../resources/green-20.png)\]] [CSS Transitions with transition: all: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected: FAIL expected: FAIL
[CSS Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (1) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions with transition: all: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.6) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/blue-20.png)\]] [CSS Transitions: property <list-style-image> from [unset\] to [url(../resources/stripes-20.png)\] at (-0.3) should be [url(../resources/blue-20.png)\]]
expected: FAIL expected: FAIL
@@ -308,18 +140,3 @@
[CSS Transitions: property <list-style-image> from [none\] to [url(../resources/stripes-20.png)\] at (0) should be [none\]] [CSS Transitions: property <list-style-image> from [none\] to [url(../resources/stripes-20.png)\] at (0) should be [none\]]
expected: FAIL expected: FAIL
[CSS Animations: property <list-style-image> from [linear-gradient(-45deg, red, yellow)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [linear-gradient(-45deg, red, yellow)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[CSS Transitions: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (1.5) should be [linear-gradient(45deg, blue, orange)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Web Animations: property <list-style-image> from [url(../resources/green-20.png)\] to [linear-gradient(45deg, blue, orange)\] at (0.3) should be [url(../resources/green-20.png)\]]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL

View File

@@ -1,26 +0,0 @@
[list-style-image-computed.sub.html]
[Property list-style-image value 'linear-gradient(to left bottom, red , blue )']
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Property list-style-image value 'radial-gradient(ellipse calc(-0.5em + 10px) calc(0.5em + 10px) at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))']
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Property list-style-image value 'radial-gradient(10px at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))']
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Property list-style-image value 'radial-gradient(circle calc(-0.5em + 10px) at calc(-1em + 10px) calc(-2em + 10px), rgb(255, 0, 0), rgb(0, 0, 255))']
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL
[Property list-style-image value 'radial-gradient(ellipse calc(0.5em + 10px) calc(-0.5em + 10px) at 20px 30px, rgb(255, 0, 0), rgb(0, 0, 255))']
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL

View File

@@ -1,6 +0,0 @@
[list-style-image-valid.html]
[e.style['list-style-image'\] = "linear-gradient(to left bottom, red, blue)" should set the property value]
expected:
if (os == "linux") and not webrender and not debug: ["FAIL", "PASS"]
FAIL