Cleanup a bit nsImageMap.

RESOLVED FIXED in Firefox 56

Status

()

Core
Layout: Images
RESOLVED FIXED
11 months ago
11 months ago

People

(Reporter: emilio, Assigned: emilio)

Tracking

(Blocks: 1 bug)

unspecified
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

11 months ago
I did a this as I tried to get bug 135040 fixed, and I think it's worth landing.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Updated

11 months ago
Blocks: 135040

Comment 3

11 months ago
mozreview-review
Comment on attachment 8888249 [details]
Bug 1382593: Clean a bit nsImageMap.

https://reviewboard.mozilla.org/r/159200/#review165078

::: layout/generic/nsImageMap.cpp:716
(Diff revision 2)
>  }
>  
>  void
>  nsImageMap::FreeAreas()
>  {
> -  uint32_t i, n = mAreas.Length();
> +  for (const auto* area : mAreas) {

Leave off the "const"?  I don't think it adds anything really.

::: layout/generic/nsImageMap.cpp
(Diff revision 2)
> -  if (!area)
> -    return NS_ERROR_OUT_OF_MEMORY;

Maybe upgrade the NS_NOTREACHED above to MOZ_ASSERT_UNREACHABLE?

::: layout/generic/nsImageMap.cpp:862
(Diff revision 2)
>  
>  nsIContent*
>  nsImageMap::GetArea(nscoord aX, nscoord aY) const
>  {
>    NS_ASSERTION(mMap, "Not initialized");
> -  uint32_t i, n = mAreas.Length();
> +  for (const auto* area : mAreas) {

Wouldn't bother with const here either.
Attachment #8888249 - Flags: review?(cam) → review+
Comment hidden (mozreview-request)

Comment 5

11 months ago
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/5a67359d51b4
Clean a bit nsImageMap. r=heycam
https://hg.mozilla.org/mozilla-central/rev/5a67359d51b4
Status: NEW → RESOLVED
Last Resolved: 11 months ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.