Bug 695994 - child selector not working in ePub CSS
Summary: child selector not working in 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-18 09:26 UTC by Pablo Rodríguez
Modified: 2015-05-19 10:18 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
ePub document with child and descendant selectors (3.47 KB, application/epub+zip)
2015-05-18 09:26 UTC, Pablo Rodríguez
Details
display selectors (mupdf vs. ebook-viewer) (15.12 KB, image/png)
2015-05-18 09:27 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-18 09:26:19 UTC
Created attachment 11687 [details]
ePub document with child and descendant selectors

Tor,

the attached ePub document contains the following code:

    <div id="leftaligned-title" class="section level2 part">
        <h2>Left–aligned title</h2>
        <div id="centered-title" class="section level3">
            <h3>Centered title</h3>
        </div>
    </div>
    
    <div id="leftaligned-title-1" class="section level2 mark">
        <h2>Left–aligned title</h2>
        <div id="centered-title-1" class="section level3">
            <h3>Centered title</h3>
        </div>
    </div>

The child selector (http://www.w3.org/TR/CSS2/selector.html#child-selectors) doesn’t work:

    .mark > .level3 > h3

Althought the descendant selector is working:

    .part .level3 h3

Could you implement this?

Many thanks for your help,


Pablo
Comment 1 Pablo Rodríguez 2015-05-18 09:27:53 UTC
Created attachment 11688 [details]
display selectors (mupdf vs. ebook-viewer)

mupdf-x11 display on the left and ebook-viewer (from calibre-2.28) on the right.

Centered titles should be centered.
Comment 2 Tor Andersson 2015-05-19 08:38:09 UTC
Should be fixed in:

commit 02cc7931ef0f04218bd50b3e0e396a6dcb009962
Author: Tor Andersson <tor.andersson@artifex.com>
Date:   Tue May 19 17:14:28 2015 +0200

    epub: Parse CSS combinators left-associatively.
    
    Fixes bug 695994 where multiple child selectors would not match properly.
    
    The "a > b > c" rule should be interpreted as ((a > b) > c) in order
    to match properly.
Comment 3 Pablo Rodríguez 2015-05-19 10:18:55 UTC
Tor,

child selectors work fine now.

Many thanks for the fix,

Pablo