Closed Bug 1449010 Opened 6 years ago Closed 6 years ago

Respect ::-moz-selection background for images.

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

Test-case:

<!doctype html>
<style>
::selection {
  color: white;
  background: green;
}
::-moz-selection {
  color: white;
  background: green;
}
</style>

<p>
Some text <img src="https://placehold.it/200x200"> some.
</p>

When selecting over the image the overlay should be of the selection background.
Comment on attachment 8962529 [details]
Bug 1449010: Respect ::selection background styles for image overlays.

https://reviewboard.mozilla.org/r/231324/#review237366

I don't see any reason to change the existing blending as part of this bug. We can do it later if we decide that it's inferior to what blink/WebKit are doing.

The generic cleanup changes (last bit of nsFrame.cpp and nsImageFrame.cpp) would be better as a separate patch, just for slightly saner history :)
Attachment #8962529 - Flags: review?(matt.woodrow) → review+
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0765c7dabbea
Some minor cleanup in selection-related code. r=matwoodrow
https://hg.mozilla.org/integration/mozilla-inbound/rev/6d2897cca552
Respect ::selection background styles for image overlays. r=mattwoodrow
(In reply to Matt Woodrow (:mattwoodrow) from comment #3)
> Comment on attachment 8962529 [details]
> Bug 1449010: Respect ::selection background styles for image overlays.
> 
> https://reviewboard.mozilla.org/r/231324/#review237366
> 
> I don't see any reason to change the existing blending as part of this bug.
> We can do it later if we decide that it's inferior to what blink/WebKit are
> doing.

Yeah, agreed.

> The generic cleanup changes (last bit of nsFrame.cpp and nsImageFrame.cpp)
> would be better as a separate patch, just for slightly saner history :)

Thanks! Did it that way.

I decided to split this from the unprefixing patches and land ahead adding ::-moz-selection to the tests to reduce a bit my local patch queue.
https://hg.mozilla.org/mozilla-central/rev/0765c7dabbea
https://hg.mozilla.org/mozilla-central/rev/6d2897cca552
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Created web-platform-tests PR https://github.com/w3c/web-platform-tests/pull/10316 for changes under testing/web-platform/tests
QA Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: