Closed Bug 1472427 Opened 6 years ago Closed 6 years ago

[FIX] HTMLImageElement.cpp should use IsInComposedDoc and GetUseMap should be fixed for work in Shadow DOM

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

      No description provided.
Priority: -- → P3
This is a bit larger patch. Moving image map handling from nsIDocument to nsImageLoadingContent since that is what nsImageFrame after all expects
(it gets usemap attribute value from mContent and then gets the image map stuff).
We do create temporary nsContentList for usemap images in shadow DOM, but it isn't live list, and usemaps should be very rare.

In general our usemap handling is rather inconsistent, but I'm _not_ trying to fix that here. (though fixing the inconsistencies may become easier after the patch)

remote: View your change here:
remote:   https://hg.mozilla.org/try/rev/6d91419cdb3eaf8fcbfcdc7dd7dfb16d7487da83
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=6d91419cdb3eaf8fcbfcdc7dd7dfb16d7487da83
remote: recorded changegroup in replication log in 0.109s
Assignee: nobody → bugs
Attachment #8989574 - Flags: review?(mrbkap)
Summary: HTMLImageElement.cpp should use IsInComposedDoc and GetUseMap should be fixed for work in Shadow DOM → [FIX] HTMLImageElement.cpp should use IsInComposedDoc and GetUseMap should be fixed for work in Shadow DOM
and wrong tryserver push :/
remote: View your change here:
remote:   https://hg.mozilla.org/try/rev/3b85bffc5b58692f09f974efca89fba8669063af
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=3b85bffc5b58692f09f974efca89fba8669063af
remote: recorded changegroup in replication log in 0.102s
Comment on attachment 8989574 [details] [diff] [review]
usemap_in_shadowdom.diff

See comment 1 for explanation.
Attachment #8989574 - Flags: review?(mrbkap) → review?(amarchesini)
Comment on attachment 8989574 [details] [diff] [review]
usemap_in_shadowdom.diff

Review of attachment 8989574 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsImageLoadingContent.cpp
@@ +1757,5 @@
> +  int32_t hash = useMap.FindChar('#');
> +  if (hash < 0) {
> +    return nullptr;
> +  }
> +  // aUsemap contains a '#', set start to point right after the '#'

aUseMap -> useMap

@@ +1761,5 @@
> +  // aUsemap contains a '#', set start to point right after the '#'
> +  start.advance(hash + 1);
> +
> +  if (start == end) {
> +    return nullptr; // aUsemap == "#"

aUseMap -> useMap

@@ +1794,5 @@
> +  }
> +
> +  return nullptr;
> +}
> +

no extra line here.
Attachment #8989574 - Flags: review?(amarchesini) → review+
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fcc1e5fa1c42
<img usemap> should work in shadow DOM, r=baku
https://hg.mozilla.org/mozilla-central/rev/fcc1e5fa1c42
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: