Closed Bug 845985 Opened 11 years ago Closed 11 years ago

SVG Filters: feComponentTransfer type=discrete treats single-valued arrays incorrectly

Categories

(Core :: SVG, defect)

18 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: mmullany, Assigned: longsonr)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17

Steps to reproduce:

Created an SVG filter with a single value in the array for an feComponentTransfer.


Actual results:

The filter failed to convert the input values to the value contained in the array, and instead ignores the component transfer.


Expected results:

The spec says - for an input value C, where C<1, and an input array of [V0...Vn-1] find an index k where k/n <= C < (k+1)/n. C' (the output value) is Vk. And where C=1, define k=n-1. In the case where the array has a single value, this reduces to k<=C<k+1. In the case of an array with a single index (of 0) - 0 is a valid solution to this constraint. And where C=1, define k=0 ("n-1" is "1-1".)

Webkit treats this case correctly. Sample code for a filter below: which should add a red drop shadow displaced 80 userspace units in x from the filtered content. Firefox displays a black drop shadow (it ignores the feFuncR discrete filter).

<filter id="drop">
  <feComponentTransfer in="SourceAlpha" result="doo">
    <feFuncR type="discrete" tableValues="1" />
  </feComponentTransfer>

  <feOffset dx="80" dy="0"  in="doo" result="shadow"/>
  <feGaussianBlur stdDeviation="20 0" in="shadow" result="blurOut"/>

  <feComponentTransfer in="SourceGraphic" result="unbrightsource">
    <feFuncR type="linear" slope="0.4" />
  </feComponentTransfer>

  <feBlend mode="normal" in="unbrightsource" in2="blurOut" result="final"/>
Component: Untriaged → SVG
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch patchSplinter Review
Assignee: nobody → longsonr
Attachment #719415 - Flags: review?(roc)
https://hg.mozilla.org/mozilla-central/rev/7df619463b43
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: