From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#49344: shr: Add support for "data-src" attribute in nodes Date: Sun, 04 Jul 2021 17:46:43 +1200 Message-ID: <313d84e33a30dfc7b789ecbda17b88fa@webmail.orcon.net.nz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21975"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Orcon Webmail Cc: 49344@debbugs.gnu.org To: =?UTF-8?Q?=E6=9D=A8=E8=8B=B1=E8=B6=85?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 04 07:47:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lzuyE-0005Vo-7D for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 07:47:10 +0200 Original-Received: from localhost ([::1]:45344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzuyC-0002eS-2D for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 01:47:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzuy6-0002eE-9r for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2021 01:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzuy6-0000ea-2r for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2021 01:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lzuy5-0004tk-Vo for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2021 01:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jul 2021 05:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49344 X-GNU-PR-Package: emacs Original-Received: via spool by 49344-submit@debbugs.gnu.org id=B49344.162537761018786 (code B ref 49344); Sun, 04 Jul 2021 05:47:01 +0000 Original-Received: (at 49344) by debbugs.gnu.org; 4 Jul 2021 05:46:50 +0000 Original-Received: from localhost ([127.0.0.1]:40318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzuxu-0004sv-CJ for submit@debbugs.gnu.org; Sun, 04 Jul 2021 01:46:50 -0400 Original-Received: from smtp-1.orcon.net.nz ([60.234.4.34]:38417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzuxr-0004sa-0h for 49344@debbugs.gnu.org; Sun, 04 Jul 2021 01:46:49 -0400 Original-Received: from [10.253.37.70] (port=42497 helo=webmail.orcon.net.nz) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1lzuxn-0005K3-Nc; Sun, 04 Jul 2021 17:46:44 +1200 Original-Received: from ip-116-251-162-85.kinect.net.nz ([116.251.162.85]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Sun, 04 Jul 2021 17:46:43 +1200 In-Reply-To: X-Sender: psainty@orcon.net.nz X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209381 Archived-At: On 2021-07-03 12:56, 杨英超 wrote: > https://www.geeksforgeeks.org/why-card-images-use-data-src-not-src-for-image-in-bootstrap-4/ The meaning of any 'data-*' attribute is 100% application-defined. I don't think that any web browsers should be assuming that a 'data-src' attribute is actually a 'src' attribute (that's not any kind of standard AFAIK), nor implement workarounds for specific web sites that are not generating sane HTML. The initial markup should have a proper 'src' attribute. If the site wants the initial state to be different in the presence of Javascript, then it should be using Javascript to modify the initial state accordingly, following a progressive-enhancement approach. As eww doesn't support Javascript, this particular case is only one of many things which won't work when the site developers make bad assumptions about Javascript. I would expect your example to fail in any web browser where JS was disabled or not supported. E.g. for me, using Firefox, the site looks very similar in Firefox and eww because I use the uMatrix extension to only permit Javascript to run on sites where I have explicitly allowed it. (Actually, the site looks *better* in eww, because their code blocks in Firefox are barely readable on account of the appallingly poor contrast between background and text.) This is simply bad web design, and I don't think that's eww's problem to solve. -Phil