Bug 695984 - <pre> wrongly inherits values from <p> (ePub CSS)
Summary: <pre> wrongly inherits values from <p> (ePub CSS)
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: master
Hardware: Other All
: P4 normal
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks: 695935
  Show dependency tree
 
Reported: 2015-05-12 11:10 UTC by Pablo Rodríguez
Modified: 2015-05-26 06:37 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
book with <pre> element (3.52 KB, application/epub+zip)
2015-05-12 11:10 UTC, Pablo Rodríguez
Details
ePub that shows wrong <pre> inheritance (66.21 KB, image/png)
2015-05-12 11:15 UTC, Pablo Rodríguez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo Rodríguez 2015-05-12 11:10:15 UTC
Created attachment 11670 [details]
book with <pre> element

Tor,

I have tried latest mupdf latest commit from http://git.ghostscript.com/?p=user/tor/mupdf.git (which implements the white-space property).

The attached ePub document shows a bug with no space after the <pre> element. This is caused by the fact that <pre> inherits values from <p>.

Being both block elements, I’m afraid this is wrong. They may have a common ancestor, but none of these elements can contain the other.

This is why I’m afraid there is a bug here. <pre> shouldn’t inherit values from <p>.

Many thanks for your help and your excellent work,


Pablo
Comment 1 Pablo Rodríguez 2015-05-12 11:15:16 UTC
Created attachment 11673 [details]
ePub that shows wrong <pre> inheritance

The attached image shows the display from mupdf-x11 on the left and the display from ebook-viewer (calibre) on the right.
Comment 2 Tor Andersson 2015-05-18 05:23:17 UTC
The missing space has nothing to do with inheritance -- it's the default 'margin' property of <pre> elements being set to 0 (as per the CSS defaults given in http://www.w3.org/TR/CSS2/sample.html). Your stylesheet sets the <p> top-margin to 0 as well, hence no margin between the <pre> and following <p> elements.
Comment 3 Pablo Rodríguez 2015-05-18 09:16:38 UTC
(In reply to Tor Andersson from comment #2)
> The missing space has nothing to do with inheritance -- it's the default
> 'margin' property of <pre> elements being set to 0 (as per the CSS defaults
> given in http://www.w3.org/TR/CSS2/sample.html). Your stylesheet sets the
> <p> top-margin to 0 as well, hence no margin between the <pre> and following
> <p> elements.

You’re right, Tor.

Wrong report. It could be closed as invalid (sorry, but I shouldn’t close my own reports).
Comment 4 Tor Andersson 2015-05-26 06:37:25 UTC
Improved the default CSS styles to be more similar to web browsers.