On Fri, Dec 04, 2015 at 05:56:01PM -0800, Paul E. McKenney wrote:
> On Fri, Dec 04, 2015 at 04:38:42PM -0800, Josh Triplett wrote:

[ . . . ]

> > Because you don't want to complicate the script, or because you don't
> > want to accidentally edit the wrong version?  (Note that a carefully
> > written script would mean it doesn't matter which version you edit.)
> 
> I prefer the simpler script.
> 
> > A third alternative would be to include the answers inline right after
> > the questions, and optionally add a tiny bit of JavaScript that hides
> > them by default and lets you click to show the answer. :)
> 
> That does have some advantages.  I would welcome a patch that added
> the JavaScript.

And I did try a CSS approach with this CSS definition:

        <style media="screen" type="text/css">
        .quick-quiz-wrap {
                position: relative;
        }
        .quick-quiz-wrap .quick-quiz-content {
                display: none;
                position: absolute;
                bottom: -10px;
                left: 10px;
                right: 10px;
                background-color: lightgrey;
                padding: 20px;
        }
        .quick-quiz-wrap:hover .quick-quiz-content {
                display: block;
        }
        </style>

I linked to this as follows:

        <link rel="stylesheet" type="text/css" href="../quick-quiz.css" 
media="screen">

And used it like this:

        <p><b>Quick Quiz:</b>
        Wait a minute!
        You said that updaters can make useful forward progress concurrently
        with readers, but pre-existing readers will block
        <tt>synchronize_rcu()</tt>!!!
        Just who are you trying to fool???
        </p>

        <div class="quick-quiz-wrap">
                <b>Quick Quiz Answer</b>
                <div class="quick-quiz-content">
                        <p>First, if updaters do not wish to be blocked
                        by readers, they can use <tt>call_rcu()</tt> or
                        <tt>kfree_rcu()</tt>, which will be discussed later.
                        Second, even when using <tt>synchronize_rcu()</tt>,
                        the other update-side code does run concurrently with
                        readers, whether pre-existing or not.
                </div> 
        </div>

This proved fragile.  It worked in trivial cases, but with non-trivial
content in a non-trivial document, it refused to show anything on mouse
hover.  Even in trivial cases, it sometimes made strange choices on
where to display the text.  At this point, I drop back to the old-school
scripted approach.  It has the advantage of working consistently and
providing good user experience, with the HTML unconditionally present. ;-)

                                                        Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to