[webkit-reviews] review requested: [Bug 33478] Web Inspector shouldn't show a white color box for "-webkit-line-break: after-white-space" : [Attachment 48612] [PATCH] Smarter Regex

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 11 19:48:32 PST 2010


Joseph Pecoraro <joepeck at webkit.org> has asked	for review:
Bug 33478: Web Inspector shouldn't show a white color box for
"-webkit-line-break: after-white-space"
https://bugs.webkit.org/show_bug.cgi?id=33478

Attachment 48612: [PATCH] Smarter Regex
https://bugs.webkit.org/attachment.cgi?id=48612&action=review

------- Additional Comments from Joseph Pecoraro <joepeck at webkit.org>
These two lines from StylesSidebarPane are where the action is:

> var colorRegex =
/((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b)/g;
> var colorProcessor = processValue.bind(window, colorRegex, processColor,
null);

The colorRegex's "\b\w+\b" breaks down "after-white-space" and pulls out the
"white" in the middle. My simple solution was to throw a negative lookahead at
the end of this section ensuring there isn't a "-" after this text. But I want
to field you guys for some other possible edge cases, or solutions. My simple
patch is attached.


More information about the webkit-reviews mailing list