[ImageMap] s/IsInside/GetArea to simplify the code

RESOLVED FIXED in mozilla10

Status

()

Core
Layout: Images
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

Trunk
mozilla10
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

4.66 KB, patch
Details | Diff | Splinter Review
(Assignee)

Description

6 years ago
Created attachment 570506 [details] [diff] [review]
patch
(Assignee)

Updated

6 years ago
Attachment #570506 - Attachment is patch: true
Attachment #570506 - Flags: review?(matspal)
(Assignee)

Comment 1

6 years ago
https://tbpl.mozilla.org/?tree=Try&rev=2bdc56372afb
Comment on attachment 570506 [details] [diff] [review]
patch

In layout/generic/nsImageFrame.cpp:
> nsImageFrame::GetCursor(const nsPoint& aPoint,
> ...
>     nsCOMPtr<nsIContent> area;
>-    if (map->IsInside(p.x, p.y, getter_AddRefs(area))) {
>+    if ((area = map->GetArea(p.x, p.y))) {

I'd prefer:
      nsCOMPtr<nsIContent> area = map->GetArea(p.x, p.y);
      if (area) {


In layout/generic/nsImageMap.h:
>+   * See if the given aX,aY pixel coordinates are in the image
>+   * map. If they are then pointer to the relevant area element is returned.
>+   * If the coordinates are not in the map then nsnull
>    * is returned.

Let's try to improve this doc comment while we're here.  How about:

"Return the first area element (in content order) for the given aX,aY pixel
coordinate or nsnull if the coordinate is outside all areas."
Attachment #570506 - Flags: review?(matspal) → review+
(Assignee)

Comment 3

6 years ago
Created attachment 570565 [details] [diff] [review]
patch
Assignee: nobody → Olli.Pettay
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/mozilla-central/rev/100b46734dd2
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Attachment #570506 - Attachment is obsolete: true

Updated

6 years ago
Flags: in-testsuite-
OS: Linux → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla10
Version: unspecified → Trunk

Updated

6 years ago
Depends on: 699228
You need to log in before you can comment on or make changes to this bug.