Merge lp:~jtv/lazr-js/bug-427263-3 into lp:lazr-js

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Graham Binns
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~jtv/lazr-js/bug-427263-3
Merge into: lp:lazr-js
Diff against target: 28 lines (+15/-3)
1 file modified
src-js/lazrjs/inlineedit/assets/editor-core.css (+15/-3)
To merge this branch: bzr merge lp:~jtv/lazr-js/bug-427263-3
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+18882@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

= Bug 427263 =

This is a bug that's been bothering us for far too long. The inline editor's edit button doesn't always show up on Konqueror.

It used not to show up in Konqueror at all. In a previous attempt at a fix, I set an empty "content" attribute for the button's :link and :visited pseudo-classes. The browser should ignore these, but Konqueror doesn't. It didn't matter that the content string was empty, even if Konqueror actually obeyed that attribute, since text-wise the button really is empty. We're using a sprite so it's the background that matters.

What _did_ matter is that Konqueror still doesn't seem to render the button in some cases if the content string is empty. So I made it non-empty. It now contains a zero-width, minimally-invasive Unicode character. Other browsers will ignore it; but even in Konqueror it looks good now.

Tested with Arora 0.10.1; Chromium 5.0.320.0; Epiphany 2.28.0; Firefox 3.5.7; Galeon 2.0.7; and Konqueror 4.3.2.

Jeroen

lp:~jtv/lazr-js/bug-427263-3 updated
168. By Jeroen T. Vermeulen

Oops, confused prototype for actual solution.

Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src-js/lazrjs/inlineedit/assets/editor-core.css'
2--- src-js/lazrjs/inlineedit/assets/editor-core.css 2009-11-18 11:00:32 +0000
3+++ src-js/lazrjs/inlineedit/assets/editor-core.css 2010-02-09 16:52:14 +0000
4@@ -17,9 +17,21 @@
5
6 /* Konqueror doesn't render the multiline editor's button if there's
7 * no apparent content in it (the sprite we use is a background image).
8- * This bit of CSS is meaningless, but tricks Konqueror into rendering
9- * the button.
10+ * This bit of CSS is meaningless; it sets the edit link's content to
11+ * a zero-width non-joiner (an invisible, odorless Unicode character).
12+ *
13+ * Browsers should ignore the content attribute for :link and :visited
14+ * pseudo-classes, but Konqueror doesn't. Setting non-empty text
15+ * content here tricks it into rendering the button.
16+ *
17+ * Other things we tried instead of this hack:
18+ * - Insert an HTML comment in the <a>. No effect.
19+ * - Insert a &nbsp; in the <a>. No effect.
20+ * - Insert whitespace in the <a>. No effect.
21+ * - Insert a span or div in the <a>. No effect.
22+ * - Use a regular <img> tag instead of a sprite. Ugly in all browsers.
23+ * - Set the content to ".". Ugly in Konqueror.
24 */
25 .yui-editable_text-trigger:link, .yui-editable_text-trigger:visited {
26- content: "";
27+ content: "\200c";
28 }

Subscribers

People subscribed via source and target branches