Closed Bug 1315155 Opened 8 years ago Closed 7 years ago

use nsStyleImageRequest in nsStyleContentData

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: heycam, Assigned: heycam)

Details

Attachments

(4 files)

The last style struct image values that still use imgRequestProxy directly are those in nsStyleContentData objects.  This bug is for changing that to nsStyleImageRequest.
Assignee: nobody → cam
Status: NEW → ASSIGNED
Comment on attachment 8807408 [details]
Stop setting the now-removed nsStyleContentData::mImageTracked.

https://reviewboard.mozilla.org/r/90546/#review90268
Attachment #8807408 - Flags: review?(manishearth) → review+
Comment on attachment 8807405 [details]
Bug 1315155 - Part 1: Encapsulate nsStyleContentData.

https://reviewboard.mozilla.org/r/90540/#review90292

r=me with the following issues addressed

::: layout/style/nsComputedDOMStyle.cpp:1130
(Diff revision 1)
> -          }
> +        }
> -          else {
> +        else {
> -            str.AppendLiteral("counters(");
> +          str.AppendLiteral("counters(");
> -          }
> +        }
> -          // WRITE ME
> +        // WRITE ME
> -          nsCSSValue::Array *a = data.mContent.mCounters;
> +        nsCSSValue::Array *a = data.GetCounters();

As far as you are here, `nsCSSValue::Array* a = ...` instead.

::: layout/style/nsStyleStruct.h
(Diff revision 1)
>    {
> +    MOZ_ASSERT(mType == eStyleContentType_Uninitialized,
> +               "should only initialize nsStyleContentData once");
>      MOZ_ASSERT(!mImageTracked,
>                 "Setting a new image without untracking the old one!");
> -    MOZ_ASSERT(mType == eStyleContentType_Image, "Wrong type!");

Forgot to set `mType` here?
Attachment #8807405 - Flags: review?(xidorn+moz) → review+
Comment on attachment 8807406 [details]
Bug 1315155 - Make nsStyleContentData use nsStyleImageRequest for images.

https://reviewboard.mozilla.org/r/90542/#review90300

Looks good.

::: layout/style/nsStyleStruct.h:3199
(Diff revision 1)
> +    MOZ_ASSERT(mType == eStyleContentType_Image);
> +    return mContent.mImage->get();

Probably just `GetImageRequest()->get()`.

::: layout/style/nsStyleStruct.h:3243
(Diff revision 1)
> -               "Setting a new image without untracking the old one!");
> -    NS_IF_ADDREF(mContent.mImage = aRequest);
> +    mContent.mImage = aRequest;
> +    mContent.mImage->AddRef();

`do_AddRef(aRequest).take()` is probably shorter.
Attachment #8807406 - Flags: review?(xidorn+moz) → review+
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0433dc15a629
Part 1: Encapsulate nsStyleContentData. r=xidorn
https://hg.mozilla.org/integration/mozilla-inbound/rev/48004b990f96
Part 2: Make nsStyleContentData use nsStyleImageRequest for images. r=xidorn
https://hg.mozilla.org/mozilla-central/rev/0433dc15a629
https://hg.mozilla.org/mozilla-central/rev/48004b990f96
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: