[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] Weird colors on 'A view from the bridge' columns @nature.
From: |
Thomas Dickey |
Subject: |
Re: [Lynx-dev] Weird colors on 'A view from the bridge' columns @nature.com |
Date: |
Thu, 24 Aug 2017 21:06:55 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Aug 24, 2017 at 01:41:07PM -0600, address@hidden wrote:
> Quoth Mr Thomas E. Dickey: 'I'd guess that the very-long class
> string causes lynx to provide the color...'
> Do you mean that they overflow a variable, causing spurious
> results? It comes up in foreground and background colors so similar I
no - there's no buffer overflow, but a hash-collision. The color-style
code computes a hash-code for each of the listed styles, and is using
both the tag-name and classes to compute a hash-code to match. Here's
a slice of the trace on a much-reduced test-case:
(during initialization)
LSS:li.red:reverse:red:yellow
parse_style(li.red:reverse:red:yellow)
CSSPARSE:li.red => 4648
CSS(PA):style d=141 / h=4648, e=li.red
check_color(yellow,-1)
=> 11
check_color(red,-1)
=> 1
parse_attributes 1/-1 11/-1 0
CSS(CURPAIR):17
CSS(SET): <li.red> hash=4648, ca=0x1100, ma=0x40000
(the element you're interested in)
STYLE.start_element: <DIV>.<hentry wpn-post wpn-publish wpn-post-1 wpn-odd
wpn-author-barbara-kiser wpn-has-excerpt wpn-category-arts
wpn-category-lab-life wpn-category-physics wpn-category-psychology>, hcode=4648.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature