From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:400c:c09::234; helo=mail-wm0-x234.google.com; envelope-from=arthompson1990@gmail.com; receiver= Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 03C4378925 for ; Wed, 21 Feb 2018 15:06:58 -0800 (PST) Received: by mail-wm0-x234.google.com with SMTP id t3so449488wmc.2 for ; Wed, 21 Feb 2018 15:08:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yORRMM/XA1GnwX+DOM640nH37pv42/ERTHRTnYb67Hg=; b=fpi5x3xMr8MBwsI46pG4Fn+iHpkJhXQhGJmDw1NQUWrDVUjr8WmL3oPh9SfNj3YYYv WWFeU0E524bUgBrbkRFvvb5GoLxtPhTfqDeh9lyaQ9OZYsXdeuDxXD5y7mCWB936U962 qLZ1RaSNI1g5rdKlQ+qWrw4WEeTbrMEIc1WqoUQjzhgsJjulbJpioJdqpW3hwqpSe1a4 diiGA3YtDSNpLffKr5Ax0wSlBrKTXtQDoOd+li4HijQVsLnWbqiBbxPnrVqygMzalLJG q1XBrmpG9Oie55hGtP1KIiLa0oZqE3Z78dAhr0JtVzfbG6qPhZ470XV2Asd5AR1KAzF3 0/pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yORRMM/XA1GnwX+DOM640nH37pv42/ERTHRTnYb67Hg=; b=En7qSk17Bfjc7/Iqt5Qmejd6pKV8W2zgcDdUG6IfQb82NlP84sBcnCUw0q8vcATotl bTUTJ+QtC9l0ZVCO6/GZg06w/8eAcklVF9WeW9Td7ipPR48nSd3cfVvyhmBX5IPIoT7M 1j8oy6Wk9F2xmtyBrJF99dE4dAT+yCAImp641N1l3rULntVOf6rQD09Wt7utkXnbRcN6 KN6mNX+XBd4aACRqjKtjugGPyQ16OJ6hIFGq35EFmn9b+dPjQnh1bliJlUJ1xFXBxFyc Uj1z8W1+zWdZyAM4r62YuWSPBzJ3I/sxWbSmOahAkXLTWR1CesmtewsYfHphVnI5aYCS 4QEQ== X-Gm-Message-State: APf1xPDtSKMoTlXG5pLslmLFxonMTUh7VtXDAigod9OnJMi9Mr3J/btr y2n1EPqEN4iGKzhgvOqbTpk= X-Google-Smtp-Source: AH8x2265mDyCCm8J3r7gzFNxU4W8RuCH/A/dGy/VM91HJd28dq4u2URIBks+Lnk3TLmj7GB19Csqcw== X-Received: by 10.28.17.141 with SMTP id 135mr3112242wmr.80.1519254479944; Wed, 21 Feb 2018 15:07:59 -0800 (PST) Received: from toaster (a.5.9.3.b.f.e.f.f.f.4.4.2.d.a.2.2.4.0.9.2.4.1.1.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1142:9042:2ad2:44ff:fefb:395a]) by smtp.gmail.com with ESMTPSA id a14sm31421096wrf.22.2018.02.21.15.07.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 15:07:58 -0800 (PST) Date: Wed, 21 Feb 2018 23:07:51 +0000 From: Adam Thompson To: Karl Dahlke Cc: Edbrowse-dev@lists.the-brannons.com Message-ID: <20180221230751.5orqxzkaixf5y5th@toaster> References: <20180120065652.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180120065652.eklhad@comcast.net> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [Edbrowse-dev] :before :after X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.25 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2018 23:06:59 -0000 On Tue, Feb 20, 2018 at 06:56:52AM -0500, Karl Dahlke wrote: > css can inject text into your document. I had no idea! > It's not just colors and fonts and decorations, it can inject words. > https://www.w3.org/TR/CSS21/generate.html Wow, yeah... I never even imagined it'd do something like that. > The first thing you'll notice is that :before is on the wrong side of the descriptor. It is a bad design that is cast in stone. > :before is a selector but it is always true, it doesn't select anything. > It is an action, and should be on the right. > So we have to move it, functionally, if not physically, to the right. > If present, *none* of the directives apply to the current node, except for content. > Content:blah puts blah before, or after, everything under the current node. > > p.note:before { content: "Note: " } > > I need to create a text node, or a span, probably a text node, with contents blah, > and then use either insertBefore or appendChild to paste it in. > From there it will be rendered and you'll see it as usual. > Not too hard, but there is fallout. Should it actually appear in the DOM as a node or is it just for display i.e. should js see this node, or does it matter if it can? Also, what happens if someone shoves html in there (if that's even possible). Should it be rendered and parsed into the DOM? > Here's the really bad news. > I don't do any of this stuff, because I didn't think I had to. > And that shaves almost 2 minutes off the browse time for stackoverflow, with its 5,000 selectors. > I apply selectors to each node on demand, if and when you access the style element, and I thought that was really clever, and I guess it is, > because I don't spend 2 minutes on stuff that doesn't matter, yet I still do what needs to be done on demand, but, > I'm not injecting snippets of text before or after elements, > and that changes the way the document might read. Yeah, it's annoying we lose this. I've not looked through the CSS parsing logic but is it possible to only apply *these* selectors and quickly skim over the rest and do the on-demand stuff for them? > All this may have to wait until after 3.7.2, because right now I'm not even sure how to procede. > BTW, I still hope we can cut 3.7.2 on Sunday, assuming we quit finding bugs, or at least problematic bugs. Sounds like a plan. Cheers, Adam.