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

View File

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

View File

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

View File

@@ -23,6 +23,7 @@
#include "mozilla/MathAlgorithms.h"
#include "mozilla/PresShell.h"
#include "mozilla/SVGImageContext.h"
#include "mozilla/css/ImageLoader.h"
#include "mozilla/dom/Document.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PathHelpers.h"
@@ -41,6 +42,7 @@
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsIURI.h"
#include "nsLayoutUtils.h"
#include "nsPresContext.h"
#ifdef ACCESSIBILITY
@@ -51,7 +53,6 @@ using namespace mozilla;
using namespace mozilla::gfx;
using namespace mozilla::image;
using namespace mozilla::layout;
using mozilla::dom::Document;
nsIFrame* NS_NewBulletFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsBulletFrame(aStyle, aPresShell->GetPresContext());
@@ -74,19 +75,6 @@ CounterStyle* nsBulletFrame::ResolveCounterStyle() {
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
nsresult nsBulletFrame::GetFrameName(nsAString& aResult) const {
return MakeFrameName(u"Bullet"_ns, aResult);
@@ -100,69 +88,36 @@ bool nsBulletFrame::IsSelfEmpty() {
}
/* virtual */
void nsBulletFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) {
nsIFrame::DidSetComputedStyle(aOldComputedStyle);
void nsBulletFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) {
nsIFrame::DidSetComputedStyle(aOldStyle);
imgRequestProxy* newRequest = StyleList()->GetListStyleImage();
if (newRequest) {
if (!mListener) {
mListener = new nsBulletListener();
mListener->SetFrame(this);
css::ImageLoader* loader = PresContext()->Document()->StyleImageLoader();
imgIRequest* oldListImage =
aOldStyle ? aOldStyle->StyleList()->mListStyleImage.GetImageRequest()
: nullptr;
imgIRequest* newListImage = StyleList()->mListStyleImage.GetImageRequest();
if (oldListImage != newListImage) {
if (oldListImage && HasImageRequest()) {
loader->DisassociateRequestFromFrame(oldListImage, this);
}
bool needNewRequest = true;
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 (newListImage) {
loader->AssociateRequestToFrame(
newListImage, this, css::ImageLoader::REQUEST_REQUIRES_REFLOW);
}
}
}
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
// 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.
if (aOldComputedStyle) {
if (aOldStyle) {
if (nsAccessibilityService* accService =
PresShell::GetAccessibilityService()) {
const nsStyleList* oldStyleList = aOldComputedStyle->StyleList();
bool hadBullet = oldStyleList->GetListStyleImage() ||
const nsStyleList* oldStyleList = aOldStyle->StyleList();
bool hadBullet = !oldStyleList->mListStyleImage.IsNone() ||
!oldStyleList->mCounterStyle.IsNone();
const nsStyleList* newStyleList = StyleList();
bool hasBullet = newStyleList->GetListStyleImage() ||
bool hasBullet = !newStyleList->mListStyleImage.IsNone() ||
!newStyleList->mCounterStyle.IsNone();
if (hadBullet != hasBullet) {
@@ -195,11 +150,13 @@ class nsDisplayBulletGeometry
class BulletRenderer final {
public:
BulletRenderer(imgIContainer* image, const nsRect& dest)
: mImage(image),
mDest(dest),
BulletRenderer(nsIFrame* aFrame, const StyleImage& aImage,
const nsRect& aDest)
: mDest(aDest),
mColor(NS_RGBA(0, 0, 0, 0)),
mListStyleType(NS_STYLE_LIST_STYLE_NONE) {
mImageRenderer.emplace(aFrame, &aImage, 0);
mImageRenderer->SetPreferredSize({}, aDest.Size());
MOZ_ASSERT(IsImageType());
}
@@ -235,8 +192,16 @@ class BulletRenderer final {
const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA, nsIFrame* aFrame);
bool IsImageType() const {
return mListStyleType == NS_STYLE_LIST_STYLE_NONE && mImage;
bool IsImageType() const { return !!mImageRenderer; }
bool PrepareImage() {
MOZ_ASSERT(IsImageType());
return mImageRenderer->PrepareImage();
}
ImgDrawResult PrepareResult() const {
MOZ_ASSERT(IsImageType());
return mImageRenderer->PrepareResult();
}
bool IsPathType() const {
@@ -260,9 +225,6 @@ class BulletRenderer final {
void PaintTextToContext(nsIFrame* aFrame, gfxContext* aCtx,
bool aDisableSubpixelAA);
bool IsImageContainerAvailable(layers::LayerManager* aManager,
uint32_t aFlags);
private:
ImgDrawResult CreateWebRenderCommandsForImage(
nsDisplayItem* aItem, wr::DisplayListBuilder& aBuilder,
@@ -286,9 +248,9 @@ class BulletRenderer final {
nsDisplayListBuilder* aDisplayListBuilder);
private:
// mImage and mDest are the properties for list-style-image.
// mImage is the image content and mDest is the image position.
RefPtr<imgIContainer> mImage;
Maybe<nsImageRenderer> mImageRenderer;
// The position and size of the image bullet.
nsRect mDest;
// 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,
bool aDisableSubpixelAA, nsIFrame* aFrame) {
if (IsImageType()) {
SamplingFilter filter = nsLayoutUtils::GetSamplingFilterForFrame(aFrame);
return nsLayoutUtils::DrawSingleImage(
aRenderingContext, aFrame->PresContext(), mImage, filter, mDest,
aDirtyRect,
/* no SVGImageContext */ Nothing(), aFlags);
return mImageRenderer->DrawLayer(aFrame->PresContext(), aRenderingContext,
mDest, mDest, nsPoint(), aDirtyRect,
mDest.Size(),
/* aOpacity = */ 1.0f);
}
if (IsPathType()) {
@@ -414,13 +375,6 @@ void BulletRenderer::PaintTextToContext(nsIFrame* aFrame, gfxContext* aCtx,
mText.Length(), mPoint);
}
bool BulletRenderer::IsImageContainerAvailable(layers::LayerManager* aManager,
uint32_t aFlags) {
MOZ_ASSERT(IsImageType());
return mImage->IsImageContainerAvailable(aManager, aFlags);
}
ImgDrawResult BulletRenderer::CreateWebRenderCommandsForImage(
nsDisplayItem* aItem, wr::DisplayListBuilder& aBuilder,
wr::IpcResourceUpdateQueue& aResources,
@@ -428,43 +382,10 @@ ImgDrawResult BulletRenderer::CreateWebRenderCommandsForImage(
mozilla::layers::RenderRootStateManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) {
MOZ_RELEASE_ASSERT(IsImageType());
MOZ_RELEASE_ASSERT(mImage);
uint32_t flags = aDisplayListBuilder->GetImageDecodeFlags();
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;
return mImageRenderer->BuildWebRenderDisplayItemsForLayer(
aItem->Frame()->PresContext(), aBuilder, aResources, aSc, aManager, aItem,
mDest, mDest, nsPoint(), mDest, mDest.Size(),
/* aOpacity = */ 1.0f);
}
bool BulletRenderer::CreateWebRenderCommandsForPath(
@@ -608,18 +529,20 @@ bool nsDisplayBullet::CreateWebRenderCommands(
// (non-trivial refactor of all this code)
RefPtr<gfxContext> screenRefCtx = gfxContext::CreateOrNull(
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget().get());
ImgDrawResult drawResult;
Maybe<BulletRenderer> br =
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;
}
ImgDrawResult drawResult = br->CreateWebRenderCommands(
this, aBuilder, aResources, aSc, aManager, aDisplayListBuilder);
if (drawResult == ImgDrawResult::NOT_SUPPORTED) {
return false;
drawResult &= commandBuilderResult;
}
nsDisplayBulletGeometry::UpdateDrawResult(this, drawResult);
@@ -648,37 +571,26 @@ void nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
Maybe<BulletRenderer> nsBulletFrame::CreateBulletRenderer(
gfxContext& aRenderingContext, nsPoint aPt) {
const nsStyleList* myList = StyleList();
gfxContext& aRenderingContext, nsPoint aPt, ImgDrawResult* aDrawResult) {
*aDrawResult = ImgDrawResult::SUCCESS;
CounterStyle* listStyleType = ResolveCounterStyle();
nsMargin padding = mPadding.GetPhysicalMargin(GetWritingMode());
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);
if (!StyleList()->mListStyleImage.IsNone()) {
nsRect dest(padding.left, padding.top,
mRect.width - (padding.left + padding.right),
mRect.height - (padding.top + padding.bottom));
BulletRenderer br(imageCon, dest + aPt);
BulletRenderer br(this, StyleList()->mListStyleImage, dest + aPt);
if (br.PrepareImage()) {
return Some(br);
}
} else {
// Boost the load priority further now that we know we want to display
// the bullet image.
mImageRequest->BoostPriority(imgIRequest::CATEGORY_DISPLAY);
}
*aDrawResult = br.PrepareResult();
if (auto* request = StyleList()->mListStyleImage.GetImageRequest()) {
request->BoostPriority(imgIRequest::CATEGORY_DISPLAY);
}
}
nscolor color = nsLayoutUtils::GetColor(this, &nsStyleText::mColor);
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel();
@@ -802,13 +714,15 @@ ImgDrawResult nsBulletFrame::PaintBullet(gfxContext& aRenderingContext,
nsPoint aPt, const nsRect& aDirtyRect,
uint32_t aFlags,
bool aDisableSubpixelAA) {
Maybe<BulletRenderer> br = CreateBulletRenderer(aRenderingContext, aPt);
ImgDrawResult drawResult;
Maybe<BulletRenderer> br =
CreateBulletRenderer(aRenderingContext, aPt, &drawResult);
if (!br) {
return ImgDrawResult::SUCCESS;
return drawResult;
}
return br->Paint(aRenderingContext, aPt, aDirtyRect, aFlags,
return drawResult & br->Paint(aRenderingContext, aPt, aDirtyRect, aFlags,
aDisableSubpixelAA, this);
}
@@ -861,39 +775,29 @@ void nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
aPadding->SizeTo(wm, 0, 0, 0, 0);
LogicalSize finalSize(wm);
const nsStyleList* myList = StyleList();
nscoord ascent;
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetFontMetricsForFrame(this, aFontSizeInflation);
RemoveStateBits(BULLET_FRAME_IMAGE_LOADING);
if (myList->GetListStyleImage() && mImageRequest) {
uint32_t status;
mImageRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_SIZE_AVAILABLE &&
!(status & imgIRequest::STATUS_ERROR)) {
if (RefPtr<imgIContainer> image = GetImage()) {
int32_t w = 0;
int32_t h = 0;
image->GetWidth(&w);
image->GetHeight(&h);
LogicalSize size(GetWritingMode(), CSSPixel::ToAppUnits(CSSIntSize(w, h)));
// auto size the image
finalSize.ISize(wm) = mIntrinsicSize.ISize(wm);
aMetrics.SetBlockStartAscent(finalSize.BSize(wm) =
mIntrinsicSize.BSize(wm));
finalSize.ISize(wm) = size.ISize(wm);
finalSize.BSize(wm) = size.BSize(wm);
aMetrics.SetBlockStartAscent(size.BSize(wm));
aMetrics.SetSize(wm, finalSize);
AppendSpacingToPadding(fm, aPadding);
AddStateBits(BULLET_FRAME_IMAGE_LOADING);
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;
@@ -904,7 +808,6 @@ void nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
finalSize.ISize(wm) = finalSize.BSize(wm) = 0;
aMetrics.SetBlockStartAscent(0);
break;
case NS_STYLE_LIST_STYLE_DISC:
case NS_STYLE_LIST_STYLE_CIRCLE:
case NS_STYLE_LIST_STYLE_SQUARE: {
@@ -1014,7 +917,8 @@ static inline bool IsIgnoreable(const nsIFrame* aFrame, nscoord aISize) {
return false;
}
auto listStyle = aFrame->StyleList();
return listStyle->mCounterStyle.IsNone() && !listStyle->GetListStyleImage();
return listStyle->mCounterStyle.IsNone() &&
listStyle->mListStyleImage.IsNone();
}
/* 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 {
if (!HasFontSizeInflation()) {
return 1.0f;
@@ -1178,12 +962,11 @@ void nsBulletFrame::SetFontSizeInflation(float aInflation) {
}
already_AddRefed<imgIContainer> nsBulletFrame::GetImage() const {
if (mImageRequest && StyleList()->GetListStyleImage()) {
if (auto* request = StyleList()->mListStyleImage.GetImageRequest()) {
nsCOMPtr<imgIContainer> imageCon;
mImageRequest->GetImage(getter_AddRefs(imageCon));
request->GetImage(getter_AddRefs(imageCon));
return imageCon.forget();
}
return nullptr;
}
@@ -1264,42 +1047,6 @@ void nsBulletFrame::GetSpokenText(nsAString& aText) {
}
#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) {
if (mOrdinal == aOrdinal) {
return;
@@ -1310,17 +1057,3 @@ void nsBulletFrame::SetOrdinal(int32_t aOrdinal, bool aNotify) {
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 "nsIFrame.h"
#include "imgIContainer.h"
#include "imgINotificationObserver.h"
class imgIContainer;
class imgRequestProxy;
class nsBulletFrame;
class BulletRenderer;
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.
* This class also supports the CSS list-style properties.
@@ -52,36 +31,26 @@ class nsBulletFrame final : public nsIFrame {
#endif
explicit nsBulletFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
: nsIFrame(aStyle, aPresContext, kClassID),
mPadding(GetWritingMode()),
mIntrinsicSize(GetWritingMode()),
mRequestRegistered(false) {}
: nsIFrame(aStyle, aPresContext, kClassID), mPadding(GetWritingMode()) {}
virtual ~nsBulletFrame();
void Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aData);
// nsIFrame
virtual void DestroyFrom(nsIFrame* aDestructRoot,
PostDestroyData& aPostDestroyData) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) override;
virtual void DidSetComputedStyle(ComputedStyle* aOldComputedStyle) override;
void BuildDisplayList(nsDisplayListBuilder*,
const nsDisplayListSet&) override;
void DidSetComputedStyle(ComputedStyle* aOldStyle) override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
nsresult GetFrameName(nsAString& aResult) const override;
#endif
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) override;
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
void AddInlineMinISize(gfxContext* aRenderingContext,
nsIFrame::InlineMinISizeData* aData) override;
void AddInlinePrefISize(gfxContext* aRenderingContext,
nsIFrame::InlinePrefISizeData* aData) override;
void Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
const ReflowInput&, nsReflowStatus&) override;
nscoord GetMinISize(gfxContext*) override;
nscoord GetPrefISize(gfxContext*) override;
void AddInlineMinISize(gfxContext*, nsIFrame::InlineMinISizeData*) override;
void AddInlinePrefISize(gfxContext*, nsIFrame::InlinePrefISizeData*) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override {
bool IsFrameOfType(uint32_t aFlags) const override {
if (aFlags & (eSupportsCSSTransforms | eSupportsContainLayoutAndPaint)) {
return false;
}
@@ -99,20 +68,20 @@ class nsBulletFrame final : public nsIFrame {
#endif
Maybe<BulletRenderer> CreateBulletRenderer(gfxContext& aRenderingContext,
nsPoint aPt);
nsPoint aPt,
ImgDrawResult* aOutDrawResult);
ImgDrawResult PaintBullet(gfxContext& aRenderingContext, nsPoint aPt,
const nsRect& aDirtyRect, uint32_t aFlags,
bool aDisableSubpixelAA);
virtual bool IsEmpty() override;
virtual bool IsSelfEmpty() override;
bool IsEmpty() override;
bool IsSelfEmpty() override;
// XXXmats note that this method returns a non-standard baseline that includes
// the ::marker block-start margin. New code should probably use
// GetNaturalBaselineBOffset instead, which returns a normal baseline offset
// as documented in nsIFrame.h.
virtual nscoord GetLogicalBaseline(
mozilla::WritingMode aWritingMode) const override;
nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
BaselineSharingGroup aBaselineGroup,
@@ -130,8 +99,6 @@ class nsBulletFrame final : public nsIFrame {
already_AddRefed<imgIContainer> GetImage() const;
protected:
void OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage);
void AppendSpacingToPadding(nsFontMetrics* aFontMetrics,
mozilla::LogicalMargin* aPadding);
void GetDesiredSize(nsPresContext* aPresContext,
@@ -139,27 +106,14 @@ class nsBulletFrame final : public nsIFrame {
float aFontSizeInflation,
mozilla::LogicalMargin* aPadding);
void GetLoadGroup(nsPresContext* aPresContext, nsILoadGroup** aLoadGroup);
mozilla::dom::Document* GetOurCurrentDoc() const;
mozilla::LogicalMargin mPadding;
RefPtr<imgRequestProxy> mImageRequest;
RefPtr<nsBulletListener> mListener;
mozilla::LogicalSize mIntrinsicSize;
private:
mozilla::CounterStyle* ResolveCounterStyle();
nscoord GetListStyleAscent() const;
void RegisterImageRequest(bool aKnownToBeAnimated);
void DeregisterAndCancelImageRequest();
// Requires being set via SetOrdinal.
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___ */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -10,7 +10,7 @@
derive_serialize="True"
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::values::specified::url::ImageUrlOrNone;
use crate::values::specified::Image;
pub fn parse_value<'i, 't>(
context: &ParserContext,
@@ -69,7 +69,7 @@
(true, 2, None, None) => {
Ok(expanded! {
list_style_position: position,
list_style_image: ImageUrlOrNone::none(),
list_style_image: Image::None,
list_style_type: ListStyleType::None,
})
}
@@ -83,14 +83,14 @@
(true, 1, Some(list_style_type), None) => {
Ok(expanded! {
list_style_position: position,
list_style_image: ImageUrlOrNone::none(),
list_style_image: Image::None,
list_style_type: list_style_type,
})
}
(true, 1, None, None) => {
Ok(expanded! {
list_style_position: position,
list_style_image: ImageUrlOrNone::none(),
list_style_image: Image::None,
list_style_type: ListStyleType::None,
})
}

View File

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

View File

@@ -177,7 +177,6 @@ include = [
"ComputedUrl",
"ComputedImageUrl",
"UrlOrNone",
"ImageUrlOrNone",
"Filter",
"Gradient",
"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 {
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)\]]
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)\]]
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)\]]
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)\]]
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\]]
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)\]]
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)\]]
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)\]]
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\]]
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\]]
expected: FAIL
[CSS Transitions: property <list-style-image> from [initial\] to [url(../resources/stripes-20.png)\] at (0.3) should be [none\]]
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)\]]
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)\]]
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)\]]
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)\]]
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)\]]
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\]]
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)\]]
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)\]]
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)\]]
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)\]]
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)\]]
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)\]]
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)\]]
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\]]
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)\]]
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)\]]
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)\]]
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)\]]
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\]]
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