emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTML-Info design


From: Yuri Khan
Subject: Re: HTML-Info design
Date: Wed, 4 Mar 2015 18:51:46 +0600

On Wed, Mar 4, 2015 at 6:19 PM, Phillip Lord
<address@hidden> wrote:
> Okay. Not seen that before. org-info uses single keypresses for
> next/prev, to enable search or occur functionality. What are you seeing,
> and what you be expecting it to do? I'm not sure how the org-info
> functionality could NOT conflict with this sort of find-as-you-type
> functionality.

OK, here’s a formal bug report.

The conflict can be avoided if the event handler notifies the browser
that it has handled the event, as detailed below.

===
Versions:

* Firefox 35.0.1 on Ubuntu 14.04 x86_64
* http://orgmode.org/org-info.js as retrieved from the origin server
on 2015-03-04

To reproduce:

0. In the Firefox Preferences dialog, Advanced | General tab,
    Accessibility section, check the checkbox [x] Search for text when
    I start typing.
1. Open the page
http://homepages.cs.ncl.ac.uk/phillip.lord/lentic/lenticular.html
    * Observed behavior: The node(?) “1 Introduction” is displayed.
2. Press “n”.
    * Expected behavior:
        1. The original node is hidden.
        2. The next node is displayed.
        3. No other activity happens.
    * Observed behavior:
        1. The original node is hidden, as expected.
        2. The next node (1.1 Caveat) is displayed, as expected.
        3. Find-as-you-type is activated with the search text set to
            the single character “n”, finding the character “n” in
            “Le[n]ticular Text For Emacs”.
3. Wait until the search bar times out, or press ESC to dismiss it.
4. Press “p”.
    * Expected behavior:
        1. The current node is hidden.
        2. The previous node (1 Introduction) is displayed.
        3. No other activity happens.
    * Observed behavior:
        1. The node (1.1 Caveat) is hidden, as expected.
        2. The next node (1 Introduction) is displayed, as expected.
        3. Find-as-you-type is activated with the search text set to
            the single character “p”, finding the character “P” in
            “HELP”.

Cause:

The event handler function, OrgHtmlManagerKeyEvent, receives an event
object as its argument b. It analyzes this object and performs any
actions associated with the pressed key (or does nothing if the key is
not recognized). The browser then also analyzes the object, notices
that default handling has not been prevented, and applies the default
handling, which is to start a search within the page.

To prevent the default handling, the handler function is supposed to
invoke the preventDefault() method on the event object, or cause that
method to be invoked by other functions involved in the handling
(namely, org_html_manager.getKey()), when and only when the event
represents a key known to the handler.

References:

* https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault
* 
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event-preventDefault
===



reply via email to

[Prev in Thread] Current Thread [Next in Thread]