Closed
Bug 1142982
Opened 7 years ago
Closed 7 years ago
Value "middle" of SVG attribute dominant-baseline is treated as "central"
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: torbasow, Assigned: longsonr)
Details
Attachments
(2 files, 1 obsolete file)
262 bytes,
image/svg+xml
|
Details | |
5.64 KB,
patch
|
heycam
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0 Build ID: 20150305021524 Steps to reproduce: Set SVG attribute dominant-baseline to "middle". Actual results: Text position as dominant-baseline has value "central", the distance between middle baseline and alphabetic baseline equals to 0.5em. Expected results: Value middle "identifies a baseline that is offset from the alphabetic baseline in the shift-direction by 1/2 the value of the x-height font characteristic". So the distance between middle baseline and alphabetic baseline must be equal to 0.5ex. Google Chrome 38 does so, but not the Firefox.
Reporter | ||
Updated•7 years ago
|
Whiteboard: SVG
Assignee | ||
Updated•7 years ago
|
Component: Untriaged → SVG
Product: Firefox → Core
Whiteboard: SVG
Comment 1•7 years ago
|
||
We should be able to handle mapping middle internally to a vertical-align:0.5ex value. ConvertSVGDominantBaselineToVerticalAlign in nsFrame.cpp will need to return an nsStyleCoord rather than a uint8_t.
Comment 2•7 years ago
|
||
Actually, we already map dominant-baseline:middle to vertical-align:middle, which does shift things by 0.5ex (see where NS_STYLE_VERTICAL_ALIGN_MIDDLE is mentioned in nsLineLayout::VerticalAlignFrames) -- I wonder why isn't that enough?
Comment 3•7 years ago
|
||
Oh, I think it is GetBaselinePosition in SVGTextFrame.cpp that needs updating.
Comment 5•7 years ago
|
||
Comment on attachment 8588653 [details] [diff] [review] baseline.txt Review of attachment 8588653 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! Please add a test too, something along the lines of comparing <text dominant-baseline="middle">abc</text> to <text dy="0.5ex">abc</text>.
Attachment #8588653 -
Flags: review?(cam) → review+
Assignee | ||
Comment 6•7 years ago
|
||
For some reason it just doesn't work quite right. Presumably the units conversion is wrong somehow.
Assignee | ||
Comment 7•7 years ago
|
||
worth another review since I clearly didn't get the units right last time.
Assignee: nobody → longsonr
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8589216 -
Flags: review?(cam)
Assignee | ||
Updated•7 years ago
|
Attachment #8588653 -
Attachment is obsolete: true
Updated•7 years ago
|
Attachment #8589216 -
Flags: review?(cam) → review+
Assignee | ||
Comment 8•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e0ea57133f02
Comment hidden (obsolete) |
Assignee | ||
Comment 10•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e91b500ca39c
Assignee | ||
Comment 11•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=375abe9704ee
Assignee | ||
Comment 12•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/efa8f733c5a4
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/efa8f733c5a4
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•