GNU bug report logs - #59549
EWW ordered list display irregularity

Previous Next

Package: emacs;

Reported by: Nicholas Drozd <nicholasdrozd <at> gmail.com>

Date: Thu, 24 Nov 2022 18:30:02 UTC

Severity: normal

To reply to this bug, email your comments to 59549 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Thu, 24 Nov 2022 18:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicholas Drozd <nicholasdrozd <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 24 Nov 2022 18:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicholas Drozd <nicholasdrozd <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: EWW ordered list display irregularity
Date: Thu, 24 Nov 2022 12:29:13 -0600
[Message part 1 (text/plain, inline)]
Here is the Wiktionary definition of the word "locus":
https://en.wiktionary.org/wiki/locus#Noun

When I open that page in EWW, I see five definition entries. But the second
entry is blank. I think: what is that missing definition, and why is it
missing?

When I open it in Firefox, I see that there are only four definitions, the
same ones as displayed in EWW. So EWW is not failing to display anything;
instead, it is inserting something extra. That extra something comes from
this piece of HTML:

  <li class="mw-empty-elt"></li>

I don't know why that's in there or how Firefox knows not to display it. It
would be cool if EWW also knew not to display it.

Bug report or feature request? You be the judge.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Mon, 23 Sep 2024 21:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 59549 <at> debbugs.gnu.org (full text, mbox):

From: Sebastián Monía <sebastian <at> sebasmonia.com>
To: Nicholas Drozd <nicholasdrozd <at> gmail.com>
Cc: 59549 <at> debbugs.gnu.org
Subject: Re: bug#59549: EWW ordered list display irregularity
Date: Mon, 23 Sep 2024 15:07:32 -0400
[Message part 1 (text/plain, inline)]
Hi everyone,


>  Here is the Wiktionary definition of the word "locus":
>  https://en.wiktionary.org/wiki/locus#Noun When I open that page in
>  EWW, I see five definition entries. But the second entry is blank.

I was able to reproduce.

>  So EWW is not failing to display anything; instead, it is inserting
>  something extra. That extra something comes from this piece of HTML:
>
>    <li class="mw-empty-elt"></li>

I wouldn't say for sure EWW is in the wrong here. Apparently inserting
empty li elements for styling purposed is a somewhat common practice.
Couldn't confirm how "correct" it is, but it is accepted.
(sidenote, stuff like this makes be glad I haven't worked in web stuff
in many many years)

>  I don't know why that's in there or how Firefox knows not to display
>  it. It would be cool if EWW also knew not to display it.

The attached patch does exactly that: skip any li elements that don't
have content.

[0001-shr-don-t-render-empty-li-tags-bug-59549.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
I tested with the Wiktionary page and a few other offline tests and it
worked as intended.

Regards,
Seb

-- 
Sebastián Monía
https://site.sebasmonia.com/

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Thu, 03 Oct 2024 18:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 59549 <at> debbugs.gnu.org (full text, mbox):

From: Sebastián Monía <sebastian <at> sebasmonia.com>
To: Nicholas Drozd <nicholasdrozd <at> gmail.com>
Cc: 59549 <at> debbugs.gnu.org
Subject: Re: bug#59549: EWW ordered list display irregularity
Date: Thu, 03 Oct 2024 14:27:37 -0400
Hello Nicholas!

Sebastián Monía <sebastian <at> sebasmonia.com> writes:
> The attached patch does exactly that: skip any li elements that don't
> have content.
>
> I tested with the Wiktionary page and a few other offline tests and it
> worked as intended.

If you could give the code in that email a try, the maintainers might
consider merging it to close this bug.

Thank you,
Seb

-- 
Sebastián Monía
https://site.sebasmonia.com/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Tue, 05 Nov 2024 14:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 59549 <at> debbugs.gnu.org (full text, mbox):

From: Sebastián Monía <sebastian <at> sebasmonia.com>
To: Nicholas Drozd <nicholasdrozd <at> gmail.com>, Jim Porter
 <jporterbugs <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 59549 <at> debbugs.gnu.org
Subject: Re: bug#59549: EWW ordered list display irregularity
Date: Tue, 05 Nov 2024 09:38:28 -0500
Sebastián Monía <sebastian <at> sebasmonia.com> writes:

Hi Eli, Jim,

Another older patch that maybe can be merged lurks here. This time, I am
the author.

If we think it is OK to render the empty items, then we could close this
bug instead of merging. Either way, one less item in the TODO list ;)

Thanks,
Seb

> Hello Nicholas!
>
> Sebastián Monía <sebastian <at> sebasmonia.com> writes:
>> The attached patch does exactly that: skip any li elements that don't
>> have content.
>>
>> I tested with the Wiktionary page and a few other offline tests and it
>> worked as intended.
>
> If you could give the code in that email a try, the maintainers might
> consider merging it to close this bug.
>
> Thank you,
> Seb

-- 
Sebastián Monía
https://site.sebasmonia.com/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Tue, 05 Nov 2024 17:11:02 GMT) Full text and rfc822 format available.

Message #17 received at 59549 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sebastián Monía <sebastian <at> sebasmonia.com>
Cc: jporterbugs <at> gmail.com, 59549 <at> debbugs.gnu.org, nicholasdrozd <at> gmail.com
Subject: Re: bug#59549: EWW ordered list display irregularity
Date: Tue, 05 Nov 2024 19:10:19 +0200
> From: Sebastián Monía <sebastian <at> sebasmonia.com>
> Cc: 59549 <at> debbugs.gnu.org
> Date: Tue, 05 Nov 2024 09:38:28 -0500
> 
> Sebastián Monía <sebastian <at> sebasmonia.com> writes:
> 
> Hi Eli, Jim,
> 
> Another older patch that maybe can be merged lurks here. This time, I am
> the author.
> 
> If we think it is OK to render the empty items, then we could close this
> bug instead of merging. Either way, one less item in the TODO list ;)

Thanks.

I'm not enough of an HTML expert to be sure that this is the right fix
in general, sorry.  I hope someone else will be able to tell.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Tue, 05 Nov 2024 19:52:02 GMT) Full text and rfc822 format available.

Message #20 received at 59549 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Sebastián Monía
 <sebastian <at> sebasmonia.com>
Cc: 59549 <at> debbugs.gnu.org, nicholasdrozd <at> gmail.com
Subject: Re: bug#59549: EWW ordered list display irregularity
Date: Tue, 5 Nov 2024 11:50:19 -0800
On 11/5/2024 9:10 AM, Eli Zaretskii wrote:
>> From: Sebastián Monía <sebastian <at> sebasmonia.com>
>> Cc: 59549 <at> debbugs.gnu.org
>> Date: Tue, 05 Nov 2024 09:38:28 -0500
>>
>> If we think it is OK to render the empty items, then we could close this
>> bug instead of merging. Either way, one less item in the TODO list ;)
> 
> Thanks.
> 
> I'm not enough of an HTML expert to be sure that this is the right fix
> in general, sorry.  I hope someone else will be able to tell.

I think the current behavior with the empty list item is correct, 
actually. Other browsers don't show the list item (and renumber the list 
as appropriate) because the CSS rule for ".mw-empty-elt" has "display: 
none". EWW/SHR don't parse CSS[1], and so we show the empty item.

You can see the same "problem" in Firefox if you load 
<https://en.wiktionary.org/wiki/locus#Noun> and go to View -> Page Style 
-> No Style. Since that's roughly what EWW/SHR is doing, I think we're 
consistent with other browsers here.

[1] Well, they can parse some limited inline CSS using the "style" 
attribute, but that doesn't apply here since the styling comes from a 
CSS class.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Wed, 06 Nov 2024 03:21:01 GMT) Full text and rfc822 format available.

Message #23 received at 59549 <at> debbugs.gnu.org (full text, mbox):

From: Sebastián Monía <sebastian <at> sebasmonia.com>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 59549 <at> debbugs.gnu.org,
 nicholasdrozd <at> gmail.com
Subject: Re: bug#59549: EWW ordered list display irregularity
Date: Tue, 05 Nov 2024 22:20:45 -0500
Jim Porter <jporterbugs <at> gmail.com> writes:

> On 11/5/2024 9:10 AM, Eli Zaretskii wrote:
>>> From: Sebastián Monía <sebastian <at> sebasmonia.com>
>>> Cc: 59549 <at> debbugs.gnu.org
>>> Date: Tue, 05 Nov 2024 09:38:28 -0500
>>>
>>> If we think it is OK to render the empty items, then we could close this
>>> bug instead of merging. Either way, one less item in the TODO list ;)
>> Thanks.
>> I'm not enough of an HTML expert to be sure that this is the right
>> fix
>> in general, sorry.  I hope someone else will be able to tell.
>
> I think the current behavior with the empty list item is correct,
> actually. Other browsers don't show the list item (and renumber the
> list as appropriate) because the CSS rule for ".mw-empty-elt" has
> "display: none". EWW/SHR don't parse CSS[1], and so we show the empty
> item.
>
> You can see the same "problem" in Firefox if you load
> <https://en.wiktionary.org/wiki/locus#Noun> and go to View -> Page
> Style -> No Style. Since that's roughly what EWW/SHR is doing, I think
> we're consistent with other browsers here.
>
> [1] Well, they can parse some limited inline CSS using the "style"
> attribute, but that doesn't apply here since the styling comes from a
> CSS class.

Then we can close this report? Since it isn't really a bug, but "working
as intended".

Thanks,
Seb

-- 
Sebastián Monía
https://site.sebasmonia.com/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59549; Package emacs. (Wed, 06 Nov 2024 12:38:02 GMT) Full text and rfc822 format available.

Message #26 received at 59549 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sebastián Monía <sebastian <at> sebasmonia.com>
Cc: jporterbugs <at> gmail.com, 59549 <at> debbugs.gnu.org, nicholasdrozd <at> gmail.com
Subject: Re: bug#59549: EWW ordered list display irregularity
Date: Wed, 06 Nov 2024 14:37:39 +0200
> From: Sebastián Monía <sebastian <at> sebasmonia.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  59549 <at> debbugs.gnu.org,
>   nicholasdrozd <at> gmail.com
> Date: Tue, 05 Nov 2024 22:20:45 -0500
> 
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
> > On 11/5/2024 9:10 AM, Eli Zaretskii wrote:
> >>> From: Sebastián Monía <sebastian <at> sebasmonia.com>
> >>> Cc: 59549 <at> debbugs.gnu.org
> >>> Date: Tue, 05 Nov 2024 09:38:28 -0500
> >>>
> >>> If we think it is OK to render the empty items, then we could close this
> >>> bug instead of merging. Either way, one less item in the TODO list ;)
> >> Thanks.
> >> I'm not enough of an HTML expert to be sure that this is the right
> >> fix
> >> in general, sorry.  I hope someone else will be able to tell.
> >
> > I think the current behavior with the empty list item is correct,
> > actually. Other browsers don't show the list item (and renumber the
> > list as appropriate) because the CSS rule for ".mw-empty-elt" has
> > "display: none". EWW/SHR don't parse CSS[1], and so we show the empty
> > item.
> >
> > You can see the same "problem" in Firefox if you load
> > <https://en.wiktionary.org/wiki/locus#Noun> and go to View -> Page
> > Style -> No Style. Since that's roughly what EWW/SHR is doing, I think
> > we're consistent with other browsers here.
> >
> > [1] Well, they can parse some limited inline CSS using the "style"
> > attribute, but that doesn't apply here since the styling comes from a
> > CSS class.
> 
> Then we can close this report? Since it isn't really a bug, but "working
> as intended".

Yes, I think so.




This bug report was last modified 222 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.