Closed
Bug 828962
Opened 13 years ago
Closed 13 years ago
xml:space="preserve" changes how foreignObject html is rendered
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: reg-bugzilla, Assigned: heycam)
References
Details
(Keywords: regression)
Attachments
(2 files)
7.01 KB,
text/html
|
Details | |
513 bytes,
patch
|
longsonr
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130104151925
Steps to reproduce:
Insert a SVG with a foreign object containing HTML. Indent the HTML of the foreign object for better code readability.
Actual results:
The whitespaces within the source code of the SVG's foreign object are displayed in the rendered page. This destroys the layout of the SVG with its foreign object.
It worked correctly in the version 17 of firefox.
Expected results:
The white spaces used to indent the source code should be ignored when rendering the output.
Could you provide a minimal testcase, please.
Flags: needinfo?(reg-bugzilla)
Keywords: testcase-wanted
Reporter | ||
Comment 2•13 years ago
|
||
Flags: needinfo?(reg-bugzilla)
Updated•13 years ago
|
Attachment #703238 -
Attachment mime type: text/plain → text/html
Comment 3•13 years ago
|
||
Cameron, it seems the xml:space="preserve" now feeds into foreignObject child content. Any thoughts on if we should do anything and if so, what?
Keywords: testcase-wanted
Assignee | ||
Comment 4•13 years ago
|
||
So this is due to the new UA style rule in svg.css:
*[xml|space=preserve] {
white-space: -moz-pre-discard-newlines;
}
I admittedly did not consider how this might affect <foreignObject>s. We could change -moz-pre-discard-newlines to mean "only preformatted but discarding newlines on SVG elements, but like 'normal' on other elements". Or, we could add another rule
foreignObject {
white-space: normal;
}
although this might be confusing if you wrote for example:
<!doctype html>
<body style="white-space: pre-line">
<svg>
...
<foreignObject>
...
</foreignObject>
</svg>
</body>
Still, it might be acceptable, given that we really want to (at some point soon) convince people to use white-space rather than xml:space="".
Assignee | ||
Comment 5•13 years ago
|
||
And ideally the solution we choose should be palatable enough to put in specs.
Regression range:
m-c
good=2012-10-03
bad=2012-10-04
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=635fcc11d2b1&tochange=4cb8f88213f5
Suspected bug:
Cameron McCormack — Bug 655877 - Part 23b: Add UA style sheet rules to map xml:space='preserve' to white-space:-moz-pre-discard-newlines on SVG text elements. r=jwatt
Blocks: svgtext
Status: UNCONFIRMED → NEW
status-firefox18:
--- → affected
tracking-firefox19:
--- → ?
tracking-firefox20:
--- → ?
tracking-firefox21:
--- → ?
Ever confirmed: true
Keywords: regression
Assignee | ||
Comment 7•13 years ago
|
||
I posted to www-svg to see if people there have opinions too.
http://www.w3.org/mid/50F7E238.7040000@mcc.id.au
Comment 8•13 years ago
|
||
This will be odd with either solution.
<!doctype html>
<body style="white-space: pre-line">
<svg xml:space="preserve">
...
<foreignObject>
<p>Where did my white-space pre-line go?</p>
</foreignObject>
</svg>
</body>
Comment 9•13 years ago
|
||
FWIW I like your second idea more.
Comment 10•13 years ago
|
||
It appears that this issue can be easily worked around server-side, and has not caused significant breakage on the web. We'd accept uplift of a low risk fix, once found.
Updated•13 years ago
|
Summary: SVG with foreign objects source code not correctly rendered → xml:space="preserve" changes how foreignObject html is rendered
Updated•13 years ago
|
OS: Windows 7 → All
Hardware: x86_64 → All
Assignee | ||
Comment 12•13 years ago
|
||
No reply on the mailing list. Let's just do that second option for now. If others in the WG prefer a different solution, we can change.
Comment 13•13 years ago
|
||
Comment on attachment 706720 [details] [diff] [review]
patch
Please create reftests:
a) outer svg is xml:space="preserve" and fo has no white-space styles
b) outer svg is xml:space="preserve" and fo has white-space: "something != normal"
Attachment #706720 -
Flags: review?(longsonr) → review+
Assignee | ||
Comment 14•13 years ago
|
||
Flags: in-testsuite+
Comment 15•13 years ago
|
||
I don't think you pushed the reftest files themselves!
Assignee | ||
Comment 16•13 years ago
|
||
Forgot to "hg add" them...
Assignee | ||
Comment 17•13 years ago
|
||
Comment 18•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/52f1e645ce34
https://hg.mozilla.org/mozilla-central/rev/d4a40b1d2524
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
status-firefox21:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•