Highlighting of elements and text

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Highlighting of elements and text

Ondrej Jaura
                Hello,

        It there any functionality to highlight an element or a text in Gecko?

        The highlighting functionality should:
i) not change the DOM tree, i.e.:
- no adding of <div> or <span> tags
- no changing of the style

ii) produce a permanent highlighting
- nsIRenderingContext.FillRect(...) is not sufficient


        I worked out my solution where I modified (h4ck3d :) the nsCSSRendering
class, but I would like to use a solution based on changing the computed
CSS style and to use features like propagating a (changed) value to
children elements, e.g. for tables.


        Thanks

        Ondrej
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting of elements and text

Boris Zbarsky
Ondrej Jaura wrote:
> It there any functionality to highlight an element or a text in Gecko?

Like the selection?

-Boris
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting of elements and text

Ondrej Jaura
Boris Zbarsky wrote:
> Ondrej Jaura wrote:
>>     It there any functionality to highlight an element or a text in
>> Gecko?
>
> Like the selection?

        Technically yes, but it should allow to highlight more elements (or
text parts) with different colours; this is not possible with the selection.
        And the selection is not resistant to user actions, is it?


        Greetings

        Ondrej
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting of elements and text

Martijn-4
On 6/23/06, Ondrej Jaura <[hidden email]> wrote:
>         Technically yes, but it should allow to highlight more elements (or
> text parts) with different colours; this is not possible with the selection.
>         And the selection is not resistant to user actions, is it?

I think the spellchecker is using the selection code and that is
resistant to user actions, so you might want to look on how that code
is working.

Regards,
Martijn


>         Greetings
>
>         Ondrej
> _______________________________________________
> dev-tech-layout mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-layout
>
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting of elements and text

Peter Kasting
Martijn wrote:

> On 6/23/06, Ondrej Jaura <[hidden email]> wrote:
>>         Technically yes, but it should allow to highlight more
>> elements (or
>> text parts) with different colours; this is not possible with the
>> selection.
>>         And the selection is not resistant to user actions, is it?
>
> I think the spellchecker is using the selection code and that is
> resistant to user actions, so you might want to look on how that code
> is working.

A very similar mechanism is how I'm planning to fix Find bar
highlighting at some point (bug 263683).  You use a different selection
type than SELECTION_NORMAL (which is the user selection and the find bar
current match).  I'm planning to add a type for highlighting.  That will
mean the find bar no longer has to goof with the DOM, which should fix a
lot of issues.

PK
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting of elements and text

Robert O'Callahan-3
In reply to this post by Martijn-4
Peter Kasting wrote:

> Martijn wrote:
>> On 6/23/06, Ondrej Jaura <[hidden email]> wrote:
>>>         Technically yes, but it should allow to highlight more
>>> elements (or
>>> text parts) with different colours; this is not possible with the
>>> selection.
>>>         And the selection is not resistant to user actions, is it?
>>
>> I think the spellchecker is using the selection code and that is
>> resistant to user actions, so you might want to look on how that code
>> is working.
>
> A very similar mechanism is how I'm planning to fix Find bar
> highlighting at some point (bug 263683).  You use a different selection
> type than SELECTION_NORMAL (which is the user selection and the find bar
> current match).  I'm planning to add a type for highlighting.  That will
> mean the find bar no longer has to goof with the DOM, which should fix a
> lot of issues.

And really, someone should make this extensible infrastructure so an
extension or API can define new selection types on demand.

/me nominates pkasting

Rob
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout