@media styling tests

5 views
Skip to first unread message

Ric Wright

unread,
Mar 20, 2014, 12:51:21 PM3/20/14
to epub-testsu...@googlegroups.com
Running through the @media styling tests this morning (EPUB 101, tests 210-213).  I am kind of wondering what the tests are telling us.  Take the “handheld” test (212).  The HTML content is:

   <section id="style-212" class="ctest">

    <h3><span class="nature">[REQUIRED]</span> <span class="test-id">style-212</span> <code>handheld</code></h3>

    <p class="desc">Tests whether the <code>@media</code> rule set to <code>handheld</code> is supported.</p>

    <p class="media-handheld">FAIL</p>

    <p class="eval">If the preceding paragraph reads "FAIL", the test fails.</p>

    </section>


And the CSS:


@media handheld

  {p.media-handheld {display:none;}}


So if the underlying rendering system responds to the @media handheld with “no this is not a handheld device” the rule isn’t applied and the the test “Fails”.  But does it really?  I am testing with a iPad which Webkit categorizes as NOT a handheld.  So isn’t the fact that the rule is NOT applied the correct behaviour?  I believe the answer is yes.


Seems like the test SHOULD be something like


“If the preceding sentence says that your device is NOT a handheld device and it is not a handheld device, then the test passes.”


And the HTML would be:


    <p class="media-handheld>This device is NOT a handheld device</p>


Alternatively one could invert the logic (probably better).  But the point is that as far as I can tell, Webkit says that the iPad IS “all” and IS a “screen” but is NOT a “handheld” and NOT a “tv”.  All of which are correct.


Ric


Reply all
Reply to author
Forward
0 new messages