Bug 149018 - Links are unresponsive when they have { visibility: visible } and are contained in a { visibility: hidden } inline parent element
Summary: Links are unresponsive when they have { visibility: visible } and are contain...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: 3.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-20 05:24 UTC by Jim Dabell
Modified: 2009-11-08 20:28 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase (1.66 KB, text/html)
2007-08-20 05:32 UTC, Jim Dabell
Details
Testcase for bug #149018 (1.66 KB, text/html)
2007-08-20 05:35 UTC, Jim Dabell
Details
Patch (908 bytes, patch)
2007-09-10 10:36 UTC, Allan Sandfeld
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Dabell 2007-08-20 05:24:22 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Gentoo Packages

According to the CSS 2.1 specification, child elements marked as { visibility: visible } that are inside parent elements marked { visibility: hidden } should still be displayed, even though their parent elements are not.

Konqueror handles this correctly, but in the case of links with inline parent elements, the links are shown, but are unresponsive — the mouse pointer doesn't change when you hover over them and they do nothing when you click them.

In the case where the parent element is a block-level element, the links work properly.  It doesn't matter how deeply the { visibility: hidden } property value has been inherited, it doesn't have to be explicitly specified for the parent element.

The relevant part of the CSS 2.1 specification:

http://www.w3.org/TR/CSS21/visufx.html#visibility
Comment 1 Jim Dabell 2007-08-20 05:32:49 UTC
Created attachment 21435 [details]
Testcase
Comment 2 Jim Dabell 2007-08-20 05:35:18 UTC
Created attachment 21436 [details]
Testcase for bug #149018
Comment 3 Jim Dabell 2007-08-20 05:40:23 UTC
Works as expected in Opera 9, Firefox 2 and Safari 2.
Comment 4 Allan Sandfeld 2007-09-10 10:36:40 UTC
Created attachment 21583 [details]
Patch

Here is a quick patch that fixes the bug.

The problem is that lines are not hittest when inlines are hidden. This
actually looks like a regression, since the commented code above would have
been working. Germain?
Comment 5 Germain Garand 2007-09-11 23:48:24 UTC
-    if (/*hitTestAction != HitTestChildrenOnly &&*/ !inside && style()->visibility() != HIDDEN) {
+    if (/*hitTestAction != HitTestChildrenOnly &&*/ !inside ) {

yes indeed, visibility is tested at the linebox level now (e.g in InlineFlowBox::nodeAtPoint). It's a left over from how we did hit test before so it should be removed as well as the commented pieces (very untidy... must have forgot to clean that file before commit).

-    if (inside && element()) {
+    if (inside && element() && style()->visibility() != HIDDEN) {

I hope we can soon remove this trailing block making post-hittest corrections (also the same is present in RenderText). I never quite understood what they were supposed to fix (inline blocks unduly stealing the inner node? mmh). They came from WC, and WC got rid of them eventually.

> The problem is that lines are not hittest when inlines are hidden. This 
> actually looks like a regression, since the commented code above would have 
> been working. Germain? 

yes, if visibility was handled in the corresponding Render{Text/Image/etc.}::nodeAtPoint, it was probably working.

IIRC, overiding visibility from hidden to visible in children doesn't work everywhere (cf. wrong optimization in RenderLayer). 

Comment 6 Germain Garand 2009-11-08 20:28:46 UTC
SVN commit 1046454 by ggarand:

don't stop testing the inner line boxes if the parent inline is
visibility:hidden. Inner children might override visibility.

patch by Allan Sandfeld Jensen

BUG: 149018

 M  +3 -9      render_inline.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1046454