Open
Bug 290664
Opened 19 years ago
Updated 2 years ago
implement -moz-box-orient: inherit-opposite
Categories
(Core :: XUL, enhancement)
Tracking
()
NEW
People
(Reporter: vlad, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
4.08 KB,
patch
|
bzbarsky
:
review-
|
Details | Diff | Splinter Review |
In the case of some UI elements that can be used in either a horizontal or vertical fashion, it would be useful to be able to specify that the orient of a <box> should be inherited as the opposite of its parent. We can already do -moz-box-orient: inherit through normal CSS inheritance; how hard would it be to add a -moz-box-orient specific inherit-opposite, that flips horizontal to vertical and vice versa?
Comment 1•19 years ago
|
||
Implementing that shouldn't be too hard, actually...
Reporter | ||
Comment 2•19 years ago
|
||
dbaron is suggesting "opposite" as the keyword instead of "inherit-opposite"; I have no strong feelings either way, anyone else have any comments?
Reporter | ||
Comment 3•19 years ago
|
||
So here's a first patch for this. As I found out though, we don't so much map XUL attributes into style or vice versa like we do for HTML; this means that switching the orient via setAttribute("orient", ....) doesn't so much allow 'opposite' to work (the computed style is never updated). Also, switching -moz-box-orient via style doesn't have any effect on the box itself. This makes this patch less than useful. :)
Assignee: nobody → vladimir
Status: NEW → ASSIGNED
Reporter | ||
Comment 4•19 years ago
|
||
Ok, with dbaron's help, this seems to work. It's only really useful for specifying -xul-box-orient via CSS, and specifying it via an attribute will cause strange things to happen -- but that's not unlike what happens when you mix the two now anyway.
Reporter | ||
Updated•19 years ago
|
Attachment #181578 -
Attachment is obsolete: true
Reporter | ||
Updated•19 years ago
|
Attachment #181589 -
Flags: superreview?(dbaron)
Attachment #181589 -
Flags: review?(bzbarsky)
I have a question: where is NS_STYLE_BOX_ORIENT_OPPOSITE supposed to be defined? I can't find it, and neither can my compiler.
Comment 6•19 years ago
|
||
I won't be able to get to this for a bit... (a week?)
Reporter | ||
Comment 7•19 years ago
|
||
Whoops, diff too deep in the tree. I'll put a new patch up shortly. bz: no hurry, whenever you get a chance to poke at it.
Comment 8•19 years ago
|
||
Comment on attachment 181589 [details] [diff] [review] xul-box-opposite-1.patch This seems to be missing some nsStyleConsts.h changes, no? >Index: nsRuleNode.cpp > if (parentContext && >- aRuleDetail != eRuleFullReset && >- aRuleDetail != eRulePartialReset && I'm not so happy about this change, actually... And we need similar changes elsewhere, or a better system of handling this, unfortunately. For example, "color: currentColor" needs similar treatment. I _think_ that's it, but I didn't do a thorough audit. What sort of performance testing has been done with this patch? >+ if (xul->mBoxOrient == NS_STYLE_BOX_ORIENT_OPPOSITE) { >+ inherited = PR_TRUE; >+ if (parentXUL->mBoxOrient == NS_STYLE_BOX_ORIENT_VERTICAL) >+ xul->mBoxOrient = NS_STYLE_BOX_ORIENT_HORIZONTAL; >+ else >+ xul->mBoxOrient = NS_STYLE_BOX_ORIENT_VERTICAL; So "opposite" is equivalent to "vertical" on the root. Is that documented somewhere? I guess that's the opposite of the default direction, so it makes _some_ sense....
Comment 9•19 years ago
|
||
Comment on attachment 181589 [details] [diff] [review] xul-box-opposite-1.patch Per comment 8
Attachment #181589 -
Flags: review?(bzbarsky) → review-
Reporter | ||
Updated•19 years ago
|
Attachment #181589 -
Flags: superreview?(dbaron)
> I'm not so happy about this change, actually... And we need similar changes > elsewhere, or a better system of handling this, unfortunately. For example, > "color: currentColor" needs similar treatment. Bug 332333 has another way of fixing color:currentcolor.
Reporter | ||
Updated•17 years ago
|
Assignee: vladimir → nobody
Status: ASSIGNED → NEW
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.widgets
Comment 11•14 years ago
|
||
very nice improvement, i hope to see this soon in a nightly version :)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•