Closed Bug 939830 Opened 11 years ago Closed 11 years ago

combination of "overflow-x:hidden; overflow-y:visible" does not work as expected

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jfkthame, Unassigned)

Details

Testcase:
data:text/html,<div style="height:0.7em;width:2em;overflow-x:hidden;overflow-y:visible;border:1px solid red">foobar

Expected result:
The text should be clipped in the horizontal direction, but visible below the border of the div in the vertical direction.

Actual result:
Clipped in both dimensions.

According to [1], "some combinations [of overflow-x/y] with ‘visible’ are not possible", but this only applies when one is "scroll" or "auto"; AFAICS the combination of hidden with visible should be accepted.

mstange pointed out on irc (thanks!) that nsRuleNode[2] doesn't allow this; it claims that NS_STYLE_OVERFLOW_VISIBLE is "meaningful only when used in both dimensions". But it's not obvious to me why that should be the case, and it doesn't appear to match the css3-box spec.

[1] http://dev.w3.org/csswg/css-box/#overflow
[2] http://mxr.mozilla.org/mozilla-central/source/layout/style/nsRuleNode.cpp#5153
The spec seems to be wrong here: overflow:hidden stuff is still scrollable programmatically, so it has the same issues as "auto" as far as I can see.
I think CSS Overflow is the spec that will define 'overflow'.  It says (in bullet 2):

"if one cascaded values is one of the _scrolling values_ and the other is ‘visible’, then computed values are the cascaded values with ‘visible’ changed to ‘hidden’."

where _scrolling values_ are defined as hidden, scroll or auto.
http://dev.w3.org/csswg/css-overflow/#overflow-properties
dbaron posted about this on www-style in June 2012 (with no replies afaict -- maybe it was sorted
out off-list?):
http://lists.w3.org/Archives/Public/www-style/2012Jun/0421.html
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.